You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
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.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user