summaryrefslogtreecommitdiff
path: root/Userland/Services/WindowServer
diff options
context:
space:
mode:
authorNick Vella <nick@nxk.io>2021-01-16 15:56:41 +1100
committerAndreas Kling <kling@serenityos.org>2021-01-16 09:09:04 +0100
commitfcf50af53dc7534ad2ccceaa88548121790549c8 (patch)
treefa33a514279a61e30022784a9fc0e4c17418ad3e /Userland/Services/WindowServer
parentfdc9b3c5a0e52af330d8c5109ec7064535fbe478 (diff)
downloadserenity-fcf50af53dc7534ad2ccceaa88548121790549c8.zip
WindowServer, LibGUI: RefreshSystemTheme implementation
Adds a mechanism through which windowing clients can re-request an UpdateSystemTheme message. This is currently used in SystemMenu's ShutdownDialog to refresh it's theme when the dialog is instantiated.
Diffstat (limited to 'Userland/Services/WindowServer')
-rw-r--r--Userland/Services/WindowServer/ClientConnection.cpp6
-rw-r--r--Userland/Services/WindowServer/ClientConnection.h1
-rw-r--r--Userland/Services/WindowServer/WindowServer.ipc1
3 files changed, 8 insertions, 0 deletions
diff --git a/Userland/Services/WindowServer/ClientConnection.cpp b/Userland/Services/WindowServer/ClientConnection.cpp
index a561a1290c..18fd74c8b3 100644
--- a/Userland/Services/WindowServer/ClientConnection.cpp
+++ b/Userland/Services/WindowServer/ClientConnection.cpp
@@ -869,6 +869,12 @@ void ClientConnection::handle(const Messages::WindowServer::SetWindowProgress& m
it->value->set_progress(message.progress());
}
+void ClientConnection::handle(const Messages::WindowServer::RefreshSystemTheme&)
+{
+ // Post the client an UpdateSystemTheme message to refresh its theme.
+ post_message(Messages::WindowClient::UpdateSystemTheme(Gfx::current_system_theme_buffer_id()));
+}
+
void ClientConnection::handle(const Messages::WindowServer::Pong&)
{
m_ping_timer = nullptr;
diff --git a/Userland/Services/WindowServer/ClientConnection.h b/Userland/Services/WindowServer/ClientConnection.h
index 12174e9189..40aa3839a4 100644
--- a/Userland/Services/WindowServer/ClientConnection.h
+++ b/Userland/Services/WindowServer/ClientConnection.h
@@ -143,6 +143,7 @@ private:
virtual void handle(const Messages::WindowServer::EnableDisplayLink&) override;
virtual void handle(const Messages::WindowServer::DisableDisplayLink&) override;
virtual void handle(const Messages::WindowServer::SetWindowProgress&) override;
+ virtual void handle(const Messages::WindowServer::RefreshSystemTheme&) override;
virtual void handle(const Messages::WindowServer::Pong&) override;
virtual OwnPtr<Messages::WindowServer::GetGlobalCursorPositionResponse> handle(const Messages::WindowServer::GetGlobalCursorPosition&) override;
virtual OwnPtr<Messages::WindowServer::SetMouseAccelerationResponse> handle(const Messages::WindowServer::SetMouseAcceleration&) override;
diff --git a/Userland/Services/WindowServer/WindowServer.ipc b/Userland/Services/WindowServer/WindowServer.ipc
index efda3e41b1..3ab9feed6c 100644
--- a/Userland/Services/WindowServer/WindowServer.ipc
+++ b/Userland/Services/WindowServer/WindowServer.ipc
@@ -98,6 +98,7 @@ endpoint WindowServer = 2
SetSystemTheme(String theme_path, [UTF8] String theme_name) => (bool success)
GetSystemTheme() => ([UTF8] String theme_name)
+ RefreshSystemTheme() =|
SetWindowBaseSizeAndSizeIncrement(i32 window_id, Gfx::IntSize base_size, Gfx::IntSize size_increment) => ()
SetWindowResizeAspectRatio(i32 window_id, Optional<Gfx::IntSize> resize_aspect_ratio) => ()