From fb5ea8a21207189cca3de8af3e9886dfde983179 Mon Sep 17 00:00:00 2001 From: Brendan Coles Date: Mon, 2 Nov 2020 06:28:14 +0000 Subject: WindowServer+LibGfx: Add Gfx::StandardCursor::Hidden cursor --- Services/WindowServer/Cursor.cpp | 2 ++ Services/WindowServer/WindowManager.cpp | 1 + Services/WindowServer/WindowManager.h | 2 ++ 3 files changed, 5 insertions(+) (limited to 'Services/WindowServer') diff --git a/Services/WindowServer/Cursor.cpp b/Services/WindowServer/Cursor.cpp index d69ec8a14c..78d5bff74e 100644 --- a/Services/WindowServer/Cursor.cpp +++ b/Services/WindowServer/Cursor.cpp @@ -54,6 +54,8 @@ RefPtr Cursor::create(Gfx::StandardCursor standard_cursor) switch (standard_cursor) { case Gfx::StandardCursor::None: return nullptr; + case Gfx::StandardCursor::Hidden: + return WindowManager::the().hidden_cursor(); case Gfx::StandardCursor::Arrow: return WindowManager::the().arrow_cursor(); case Gfx::StandardCursor::Crosshair: diff --git a/Services/WindowServer/WindowManager.cpp b/Services/WindowServer/WindowManager.cpp index 668a0b1580..35543d5c76 100644 --- a/Services/WindowServer/WindowManager.cpp +++ b/Services/WindowServer/WindowManager.cpp @@ -112,6 +112,7 @@ void WindowManager::reload_config(bool set_screen) set_resolution(m_config->read_num_entry("Screen", "Width", 1920), m_config->read_num_entry("Screen", "Height", 1080)); } + m_hidden_cursor = get_cursor("Hidden"); m_arrow_cursor = get_cursor("Arrow", { 2, 2 }); m_hand_cursor = get_cursor("Hand", { 8, 4 }); m_help_cursor = get_cursor("Help", { 1, 1 }); diff --git a/Services/WindowServer/WindowManager.h b/Services/WindowServer/WindowManager.h index 96c1ada58b..3e2b587e19 100644 --- a/Services/WindowServer/WindowManager.h +++ b/Services/WindowServer/WindowManager.h @@ -123,6 +123,7 @@ public: Gfx::IntRect desktop_rect() const; const Cursor& active_cursor() const; + const Cursor& hidden_cursor() const { return *m_hidden_cursor; } const Cursor& arrow_cursor() const { return *m_arrow_cursor; } const Cursor& crosshair_cursor() const { return *m_crosshair_cursor; } const Cursor& hand_cursor() const { return *m_hand_cursor; } @@ -247,6 +248,7 @@ private: void do_move_to_front(Window&, bool, bool); + RefPtr m_hidden_cursor; RefPtr m_arrow_cursor; RefPtr m_hand_cursor; RefPtr m_help_cursor; -- cgit v1.2.3