mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 15:40:41 -05:00
c4fa30ac7d
The method `relative_motion_across_outputs` is used to adjust the distance/delta of a mouse movement across multiple monitors to take the different scale factors of those monitors into account. This works by getting the adjacent monitors that the movement-line/vector intersects with and adjusting the final position (or end point of the movement-line) by multiplying the parts of the line spanning across different monitors with the scale factors of those monitors. In the end of this calculation, we always want to set the new end coordinates of the relative motion to the new end coordinates of the adjusted movement-line. We currently only do that if all adjacent monitors the line is crossing actually exist, because only then we end up inside the "We reached the dest logical monitor" else-block and set `x` and `y` to the correct values. Fix that and make sure the returned values are also correct in case an adjacent monitor doesn't exist by adding separate `target_x` and `target_y` variables which we update during each pass of the while loop so we're always prepared for the while loop exiting before the destination monitor was found. Thanks to Axel Kittenberger for reporting the initial bug and tracking the issue down to `relative_motion_across_outputs`. Fixes https://gitlab.gnome.org/GNOME/mutter/issues/774 |
||
---|---|---|
.. | ||
backends | ||
compositor | ||
core | ||
meta | ||
tests | ||
ui | ||
wayland | ||
x11 | ||
libmutter.pc.in | ||
meson.build | ||
meta-marshal.list | ||
org.freedesktop.login1.xml | ||
org.gnome.Mutter.DisplayConfig.xml | ||
org.gnome.Mutter.IdleMonitor.xml | ||
org.gnome.Mutter.RemoteDesktop.xml | ||
org.gnome.Mutter.ScreenCast.xml |