From 2235a1cbd06440911c2679204dbc8b7d47b7e83f Mon Sep 17 00:00:00 2001 From: Markus Sauermann <6299227+Sauermann@users.noreply.github.com> Date: Wed, 4 Oct 2023 19:20:01 +0200 Subject: Add screen-related attributes to mouse input events --- platform/linuxbsd/wayland/wayland_thread.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'platform/linuxbsd/wayland/wayland_thread.cpp') 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 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 inputev_msg; inputev_msg.instantiate(); -- cgit v1.2.3