diff options
author | Riteo <riteo@posteo.net> | 2024-07-07 08:39:53 +0200 |
---|---|---|
committer | Riteo <riteo@posteo.net> | 2024-07-07 08:39:53 +0200 |
commit | 3e0632cbd217c258a201560d850fdce495fc7954 (patch) | |
tree | af66b4d40ab26be93223b4dcb48efc1f8f400b09 | |
parent | b97110cd307e4d78e20bfafe5de6c082194b2cd6 (diff) | |
download | redot-engine-3e0632cbd217c258a201560d850fdce495fc7954.tar.gz |
Wayland: scale relative pointer motion
Oops, forgot to do that. Motion-dependent stuff should now work properly
when using scaled displays.
-rw-r--r-- | platform/linuxbsd/wayland/wayland_thread.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/platform/linuxbsd/wayland/wayland_thread.cpp b/platform/linuxbsd/wayland/wayland_thread.cpp index 341cc517e3..7bdc75db29 100644 --- a/platform/linuxbsd/wayland/wayland_thread.cpp +++ b/platform/linuxbsd/wayland/wayland_thread.cpp @@ -2049,9 +2049,14 @@ void WaylandThread::_wp_relative_pointer_on_relative_motion(void *data, struct z PointerData &pd = ss->pointer_data_buffer; + WindowState *ws = wl_surface_get_window_state(ss->pointed_surface); + ERR_FAIL_NULL(ws); + pd.relative_motion.x = wl_fixed_to_double(dx); pd.relative_motion.y = wl_fixed_to_double(dy); + pd.relative_motion *= window_state_get_scale_factor(ws); + pd.relative_motion_time = uptime_lo; } |