diff options
author | Markus Sauermann <6299227+Sauermann@users.noreply.github.com> | 2023-10-04 19:20:01 +0200 |
---|---|---|
committer | Markus Sauermann <6299227+Sauermann@users.noreply.github.com> | 2024-02-05 23:30:15 +0100 |
commit | 2235a1cbd06440911c2679204dbc8b7d47b7e83f (patch) | |
tree | 5d8177bd57a670fe49d59f88847ebbf56d305ed1 /platform/linuxbsd/wayland/wayland_thread.cpp | |
parent | d3352813ea44447bfbf135efdec23acc4d1d3f89 (diff) | |
download | redot-engine-2235a1cbd06440911c2679204dbc8b7d47b7e83f.tar.gz |
Add screen-related attributes to mouse input events
Diffstat (limited to 'platform/linuxbsd/wayland/wayland_thread.cpp')
-rw-r--r-- | platform/linuxbsd/wayland/wayland_thread.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/platform/linuxbsd/wayland/wayland_thread.cpp b/platform/linuxbsd/wayland/wayland_thread.cpp index 7e96f2dd75..99f9cc6600 100644 --- a/platform/linuxbsd/wayland/wayland_thread.cpp +++ b/platform/linuxbsd/wayland/wayland_thread.cpp @@ -1506,6 +1506,8 @@ void WaylandThread::_wl_pointer_on_frame(void *data, struct wl_pointer *wl_point mm->set_relative(pd.position - old_pd.position); mm->set_velocity((Vector2)pos_delta / time_delta); } + mm->set_relative_screen_position(mm->get_relative()); + mm->set_screen_velocity(mm->get_velocity()); Ref<InputEventMessage> msg; msg.instantiate(); @@ -2399,11 +2401,13 @@ void WaylandThread::_wp_tablet_tool_on_frame(void *data, struct zwp_tablet_tool_ mm->set_pen_inverted(td.is_eraser); mm->set_relative(td.position - old_td.position); + mm->set_relative_screen_position(mm->get_relative()); // FIXME: Stop doing this to calculate speed. // FIXME2: It has been done, port this from the pointer logic once this works again. Input::get_singleton()->set_mouse_position(td.position); mm->set_velocity(Input::get_singleton()->get_last_mouse_velocity()); + mm->set_screen_velocity(mm->get_velocity()); Ref<InputEventMessage> inputev_msg; inputev_msg.instantiate(); |