mutter/src
Carlos Garnacho 8f268f2930 backends/native: Keep general direction when crossing monitors
When the pointer crosses monitors, we account for a single motion event
resulting in the pointer moving across more than 2 monitors, in order
to correctly account each monitor scale and the distance traversed
across each monitor in the resulting relative motion vector.

However, memory on the direction is kept short, each iteration to
find the target view just remembers the direction it came from. This
brings a pathological case with 4 monitors with the same resolution
in a 2x2 grid, and a motion vector that crosses monitors at the
intersection of all 4 in a perfect diagonal. (Say, monitors are
all 1920x1080 and pointer moves from 1920,1080 to 1919,1079).

In that case, the intersection point at the crossing between 4
monitors (say, 1920,1080) will be considered to intersect with 2
edges of each view. Since there is always at least 2 directions to
try, the loop will always find the direction other than the one
it came from, and as a result endlessly jump across all 4 possible
choices.

In order to fix this, consider only the global v/h directions,
we already know if the pointer moves left/right or up/down, so
only consider those directions to jump across monitors.

For the case at hand, this will result in three monitors visited,
(either bottomright/bottomleft/topleft, or bottomright/topright/topleft)
with a total distance of 0,0 in the middle one, effectively
resulting in a correct diagonal motion.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2598
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2803>
2023-01-24 17:30:46 +00:00
..
backends backends/native: Keep general direction when crossing monitors 2023-01-24 17:30:46 +00:00
compositor clutter: Pass 'ClutterFrame' in all stage update signals 2023-01-23 15:57:50 +01:00
core util: Make meta_topic() log using the debug level in tests 2023-01-24 13:09:42 +00:00
frames frames: Quit immediately on SIGTERM 2023-01-20 21:25:02 +00:00
meta util: Make meta_topic() log using the debug level in tests 2023-01-24 13:09:42 +00:00
tests tests/color: Assert we saw the expected messages 2023-01-24 13:09:42 +00:00
wayland clutter: Pass 'ClutterFrame' in all stage update signals 2023-01-23 15:57:50 +01:00
x11 x11: Account for variable being possibly NULL 2023-01-20 22:23:55 +00:00
libmutter.pc.in build: Fix libs and cflags in autotools .pc file 2018-11-10 16:20:46 +00:00
meson.build build: Make GTK dependency specific to X11 2022-12-22 15:13:54 +01:00
meta-private-enum-types.c.in build: Add missing include 2022-08-10 20:28:40 +02:00
meta-private-enum-types.h.in screen-cast: Add screen cast flag to streams 2020-07-30 09:51:16 +02:00