1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:17:45 +00:00

WindowServer: Add IPC calls for controlling cursor theme

This commit adds two new IPC calls for WindowServer: apply_cursor_theme
and get_cursor_theme.
This commit is contained in:
Maciej Zygmanowski 2021-08-01 17:23:31 +02:00 committed by Andreas Kling
parent 040a723f1f
commit 0363cd3d55
3 changed files with 17 additions and 0 deletions

View file

@ -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)

View file

@ -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;

View file

@ -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) =|