summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaciej Zygmanowski <sppmacd@pm.me>2021-08-01 17:23:31 +0200
committerAndreas Kling <kling@serenityos.org>2021-08-23 01:41:53 +0200
commit0363cd3d551753e435b9765f49ea2e7d7bc18a27 (patch)
tree585c715dae42e918a30e0efa322db078f631f86a
parent040a723f1f75de0220abffa5aff085d3d2a45cd2 (diff)
downloadserenity-0363cd3d551753e435b9765f49ea2e7d7bc18a27.zip
WindowServer: Add IPC calls for controlling cursor theme
This commit adds two new IPC calls for WindowServer: apply_cursor_theme and get_cursor_theme.
-rw-r--r--Userland/Services/WindowServer/ClientConnection.cpp12
-rw-r--r--Userland/Services/WindowServer/ClientConnection.h2
-rw-r--r--Userland/Services/WindowServer/WindowServer.ipc3
3 files changed, 17 insertions, 0 deletions
diff --git a/Userland/Services/WindowServer/ClientConnection.cpp b/Userland/Services/WindowServer/ClientConnection.cpp
index 035f329047..38ae778882 100644
--- a/Userland/Services/WindowServer/ClientConnection.cpp
+++ b/Userland/Services/WindowServer/ClientConnection.cpp
@@ -758,6 +758,18 @@ Messages::WindowServer::GetSystemThemeResponse ClientConnection::get_system_them
return name;
}
+void ClientConnection::apply_cursor_theme(String const& name)
+{
+ WindowManager::the().apply_cursor_theme(name);
+}
+
+Messages::WindowServer::GetCursorThemeResponse ClientConnection::get_cursor_theme()
+{
+ auto config = Core::ConfigFile::open("/etc/WindowServer.ini");
+ auto name = config->read_entry("Mouse", "CursorTheme");
+ return name;
+}
+
Messages::WindowServer::SetSystemFontsResponse ClientConnection::set_system_fonts(String const& default_font_query, String const& fixed_width_font_query)
{
if (!Gfx::FontDatabase::the().get_by_name(default_font_query)
diff --git a/Userland/Services/WindowServer/ClientConnection.h b/Userland/Services/WindowServer/ClientConnection.h
index d315ef1447..eddfc8bb02 100644
--- a/Userland/Services/WindowServer/ClientConnection.h
+++ b/Userland/Services/WindowServer/ClientConnection.h
@@ -139,6 +139,8 @@ private:
virtual Messages::WindowServer::StartDragResponse start_drag(String const&, HashMap<String, ByteBuffer> const&, Gfx::ShareableBitmap const&) override;
virtual Messages::WindowServer::SetSystemThemeResponse set_system_theme(String const&, String const&) override;
virtual Messages::WindowServer::GetSystemThemeResponse get_system_theme() override;
+ virtual void apply_cursor_theme(String const&) override;
+ virtual Messages::WindowServer::GetCursorThemeResponse get_cursor_theme() override;
virtual Messages::WindowServer::SetSystemFontsResponse set_system_fonts(String const&, String const&) override;
virtual void set_window_base_size_and_size_increment(i32, Gfx::IntSize const&, Gfx::IntSize const&) override;
virtual void set_window_resize_aspect_ratio(i32, Optional<Gfx::IntSize> const&) override;
diff --git a/Userland/Services/WindowServer/WindowServer.ipc b/Userland/Services/WindowServer/WindowServer.ipc
index 14e7e0bd99..41accd5251 100644
--- a/Userland/Services/WindowServer/WindowServer.ipc
+++ b/Userland/Services/WindowServer/WindowServer.ipc
@@ -114,6 +114,9 @@ endpoint WindowServer
get_system_theme() => ([UTF8] String theme_name)
refresh_system_theme() =|
+ apply_cursor_theme(String name) =|
+ get_cursor_theme() => (String name)
+
set_system_fonts(String default_font_query, String fixed_width_font_query) => (bool success)
set_window_base_size_and_size_increment(i32 window_id, Gfx::IntSize base_size, Gfx::IntSize size_increment) =|