diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-05-03 21:07:16 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-05-03 21:07:16 +0200 |
commit | 6a5d92f0ad9c5e03d8cfe0257497d65fc0e93c17 (patch) | |
tree | c96bce3fbd05e6855f2f675bedfafdeae28a38a5 /Servers/WindowServer/WSClientConnection.cpp | |
parent | 2470fdcd9b75a0b2bf2ac025b7030a7f53c8ac89 (diff) | |
download | serenity-6a5d92f0ad9c5e03d8cfe0257497d65fc0e93c17.zip |
WindowServer+LibGUI: Allow changing whether windows have alpha channels.
Use this in Terminal to tell the window server to not bother with the alpha
channel in the backing store if we're running without transparency.
Semi-transparent terminals look neat but they slow everything down, so this
keeps things fast while making it easy to switch to the flashy mode. :^)
Diffstat (limited to 'Servers/WindowServer/WSClientConnection.cpp')
-rw-r--r-- | Servers/WindowServer/WSClientConnection.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Servers/WindowServer/WSClientConnection.cpp b/Servers/WindowServer/WSClientConnection.cpp index b1dec3740d..2f3514e011 100644 --- a/Servers/WindowServer/WSClientConnection.cpp +++ b/Servers/WindowServer/WSClientConnection.cpp @@ -629,6 +629,24 @@ void WSClientConnection::handle_request(const WSAPISetWindowOverrideCursorReques window.set_override_cursor(WSCursor::create(request.cursor())); } +void WSClientConnection::handle_request(const WSAPISetWindowHasAlphaChannelRequest& request) +{ + int window_id = request.window_id(); + auto it = m_windows.find(window_id); + if (it == m_windows.end()) { + post_error("WSAPISetWindowHasAlphaChannelRequest: Bad window ID"); + return; + } + auto& window = *(*it).value; + window.set_has_alpha_channel(request.value()); + + WSAPI_ServerMessage response; + response.type = WSAPI_ServerMessage::Type::DidSetWindowHasAlphaChannel; + response.window_id = window_id; + response.value = request.value(); + post_message(response); +} + void WSClientConnection::handle_request(const WSWMAPISetActiveWindowRequest& request) { auto* client = WSClientConnection::from_client_id(request.target_client_id()); @@ -747,6 +765,8 @@ void WSClientConnection::on_request(const WSAPIClientRequest& request) return handle_request(static_cast<const WSAPIPopupMenuRequest&>(request)); case WSEvent::APIDismissMenuRequest: return handle_request(static_cast<const WSAPIDismissMenuRequest&>(request)); + case WSEvent::APISetWindowHasAlphaChannelRequest: + return handle_request(static_cast<const WSAPISetWindowHasAlphaChannelRequest&>(request)); default: break; } |