diff options
author | Brendan Coles <bcoles@gmail.com> | 2020-11-02 06:28:14 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-11-02 20:58:07 +0100 |
commit | fb5ea8a21207189cca3de8af3e9886dfde983179 (patch) | |
tree | 6bab5f07f882a25f34add2db5d6e47f551418227 /Services/WindowServer | |
parent | 328915a27988c223b1eedd722396470377a00845 (diff) | |
download | serenity-fb5ea8a21207189cca3de8af3e9886dfde983179.zip |
WindowServer+LibGfx: Add Gfx::StandardCursor::Hidden cursor
Diffstat (limited to 'Services/WindowServer')
-rw-r--r-- | Services/WindowServer/Cursor.cpp | 2 | ||||
-rw-r--r-- | Services/WindowServer/WindowManager.cpp | 1 | ||||
-rw-r--r-- | Services/WindowServer/WindowManager.h | 2 |
3 files changed, 5 insertions, 0 deletions
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> 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<Cursor> m_hidden_cursor; RefPtr<Cursor> m_arrow_cursor; RefPtr<Cursor> m_hand_cursor; RefPtr<Cursor> m_help_cursor; |