diff options
author | Andreas Kling <kling@serenityos.org> | 2020-04-21 18:40:27 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-04-21 18:40:52 +0200 |
commit | 0fa7cf70b5606dc4a4335a8e406340a28a645c07 (patch) | |
tree | fb1f955c52878fe45d1be600ff64e0aadc0e7747 /Servers | |
parent | b6d035aa05df71c7b71cda40517da789fe4b86c3 (diff) | |
download | serenity-0fa7cf70b5606dc4a4335a8e406340a28a645c07.zip |
WindowServer+SystemMenu: Check the current system theme on startup
Diffstat (limited to 'Servers')
-rw-r--r-- | Servers/WindowServer/ClientConnection.cpp | 7 | ||||
-rw-r--r-- | Servers/WindowServer/ClientConnection.h | 1 | ||||
-rw-r--r-- | Servers/WindowServer/WindowServer.ipc | 1 |
3 files changed, 9 insertions, 0 deletions
diff --git a/Servers/WindowServer/ClientConnection.cpp b/Servers/WindowServer/ClientConnection.cpp index 9f28a77a87..8a4d61bf41 100644 --- a/Servers/WindowServer/ClientConnection.cpp +++ b/Servers/WindowServer/ClientConnection.cpp @@ -730,6 +730,13 @@ OwnPtr<Messages::WindowServer::SetSystemThemeResponse> ClientConnection::handle( return make<Messages::WindowServer::SetSystemThemeResponse>(success); } +OwnPtr<Messages::WindowServer::GetSystemThemeResponse> ClientConnection::handle(const Messages::WindowServer::GetSystemTheme&) +{ + auto wm_config = Core::ConfigFile::open("/etc/WindowServer/WindowServer.ini"); + auto name = wm_config->read_entry("Theme", "Name"); + return make<Messages::WindowServer::GetSystemThemeResponse>(name); +} + void ClientConnection::boost() { // FIXME: Re-enable this when we have a solution for boosting. diff --git a/Servers/WindowServer/ClientConnection.h b/Servers/WindowServer/ClientConnection.h index 3a8766c6c5..ebbcb3d282 100644 --- a/Servers/WindowServer/ClientConnection.h +++ b/Servers/WindowServer/ClientConnection.h @@ -122,6 +122,7 @@ private: virtual OwnPtr<Messages::WindowServer::StartDragResponse> handle(const Messages::WindowServer::StartDrag&) override; virtual OwnPtr<Messages::WindowServer::SetSystemMenuResponse> handle(const Messages::WindowServer::SetSystemMenu&) override; virtual OwnPtr<Messages::WindowServer::SetSystemThemeResponse> handle(const Messages::WindowServer::SetSystemTheme&) override; + virtual OwnPtr<Messages::WindowServer::GetSystemThemeResponse> handle(const Messages::WindowServer::GetSystemTheme&) override; virtual OwnPtr<Messages::WindowServer::SetWindowBaseSizeAndSizeIncrementResponse> handle(const Messages::WindowServer::SetWindowBaseSizeAndSizeIncrement&) override; virtual void handle(const Messages::WindowServer::EnableDisplayLink&) override; virtual void handle(const Messages::WindowServer::DisableDisplayLink&) override; diff --git a/Servers/WindowServer/WindowServer.ipc b/Servers/WindowServer/WindowServer.ipc index 82348778eb..ab73161f90 100644 --- a/Servers/WindowServer/WindowServer.ipc +++ b/Servers/WindowServer/WindowServer.ipc @@ -87,6 +87,7 @@ endpoint WindowServer = 2 StartDrag(String text, String data_type, String data, i32 bitmap_id, Gfx::Size bitmap_size) => (bool started) SetSystemTheme(String theme_path, String theme_name) => (bool success) + GetSystemTheme() => (String theme_name) SetWindowBaseSizeAndSizeIncrement(i32 window_id, Gfx::Size base_size, Gfx::Size size_increment) => () |