diff options
author | Riteo <riteo@posteo.net> | 2024-09-13 18:59:38 +0200 |
---|---|---|
committer | Riteo <riteo@posteo.net> | 2024-09-13 19:08:53 +0200 |
commit | c15cd3acc43b7b5012e41844c1715b84f6c7834c (patch) | |
tree | f9e876a12c4b7a5565e4e5fd2a698c2c67d512a4 /platform/linuxbsd/wayland/wayland_thread.h | |
parent | 74de05a01c8716a42d4e3427f607d7bea76b35e5 (diff) | |
download | redot-engine-c15cd3acc43b7b5012e41844c1715b84f6c7834c.tar.gz |
Wayland: Simplify cursor code and fix custom cursors
Initially the WaylandThread cursor code was supposed to be as stateless
as possible but, as time went on, this wasn't possible.
This expectation made the resulting API quite convoluted, so this patch
aims to simplify it substantially bot in terms of API surface and, most
importantly, in terms of actual implementation complexity.
This patch also fixes custom cursors since I accidentally changed the
mmap flags to MAP_PRIVATE some time ago. This took me hours to notice.
Diffstat (limited to 'platform/linuxbsd/wayland/wayland_thread.h')
-rw-r--r-- | platform/linuxbsd/wayland/wayland_thread.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/platform/linuxbsd/wayland/wayland_thread.h b/platform/linuxbsd/wayland/wayland_thread.h index 84e9bdc2dc..ad2e843a74 100644 --- a/platform/linuxbsd/wayland/wayland_thread.h +++ b/platform/linuxbsd/wayland/wayland_thread.h @@ -469,7 +469,6 @@ public: uint32_t *buffer_data = nullptr; uint32_t buffer_data_size = 0; - RID rid; Point2i hotspot; }; @@ -506,10 +505,8 @@ private: HashMap<DisplayServer::CursorShape, CustomCursor> custom_cursors; - struct wl_cursor *current_wl_cursor = nullptr; - struct CustomCursor *current_custom_cursor = nullptr; - - DisplayServer::CursorShape last_cursor_shape = DisplayServer::CURSOR_ARROW; + DisplayServer::CursorShape cursor_shape = DisplayServer::CURSOR_ARROW; + bool cursor_visible = true; PointerConstraint pointer_constraint = PointerConstraint::NONE; @@ -962,7 +959,7 @@ public: DisplayServer::WindowID pointer_get_pointed_window_id() const; BitField<MouseButtonMask> pointer_get_button_mask() const; - void cursor_hide(); + void cursor_set_visible(bool p_visible); void cursor_set_shape(DisplayServer::CursorShape p_cursor_shape); void cursor_set_custom_shape(DisplayServer::CursorShape p_cursor_shape); |