1
0
Fork 0

backends/eis-client: Use scroll source 'wheel' instead of 'unknown'

CLUTTER_SCROLL_SOURCE_UNKNOWN only generates continuous scroll events
and no discrete scroll events.
As a result, scrolling only works in applications, that support high
resolution scroll wheels, like GTK4 applications.
GTK3 applications, on the other hand, don't support high resolution
scroll wheel events, and such scrolling does not work in these
applications.

Fix this issue by using the scroll source CLUTTER_SCROLL_SOURCE_WHEEL.
Since commit 92a90774a4 ([0]),
CLUTTER_SCROLL_SOURCE_WHEEL generates discrete events to ensure that
scrolling in legacy applications still works.

[0]: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2664

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3235>
This commit is contained in:
Pascal Nowack 2023-09-02 10:57:53 +02:00 committed by Marge Bot
parent b20d7a5cc4
commit 38cdaaf1f8

View file

@ -420,7 +420,7 @@ handle_scroll (MetaEisClient *client,
clutter_virtual_input_device_notify_scroll_continuous (device->device, clutter_virtual_input_device_notify_scroll_continuous (device->device,
g_get_monotonic_time (), g_get_monotonic_time (),
dx, dy, dx, dy,
CLUTTER_SCROLL_SOURCE_UNKNOWN, CLUTTER_SCROLL_SOURCE_WHEEL,
CLUTTER_SCROLL_FINISHED_NONE); CLUTTER_SCROLL_FINISHED_NONE);
} }
@ -441,7 +441,7 @@ handle_scroll_stop (MetaEisClient *client,
clutter_virtual_input_device_notify_scroll_continuous (device->device, clutter_virtual_input_device_notify_scroll_continuous (device->device,
g_get_monotonic_time (), g_get_monotonic_time (),
0.0, 0.0, 0.0, 0.0,
CLUTTER_SCROLL_SOURCE_UNKNOWN, CLUTTER_SCROLL_SOURCE_WHEEL,
finish_flags); finish_flags);
} }
@ -466,7 +466,7 @@ handle_scroll_cancel (MetaEisClient *client,
clutter_virtual_input_device_notify_scroll_continuous (device->device, clutter_virtual_input_device_notify_scroll_continuous (device->device,
g_get_monotonic_time (), g_get_monotonic_time (),
dx, dy, dx, dy,
CLUTTER_SCROLL_SOURCE_UNKNOWN, CLUTTER_SCROLL_SOURCE_WHEEL,
CLUTTER_SCROLL_FINISHED_NONE); CLUTTER_SCROLL_FINISHED_NONE);
} }
@ -490,7 +490,7 @@ handle_scroll_discrete (MetaEisClient *client,
clutter_virtual_input_device_notify_discrete_scroll (device->device, clutter_virtual_input_device_notify_discrete_scroll (device->device,
g_get_monotonic_time (), g_get_monotonic_time (),
CLUTTER_SCROLL_RIGHT, CLUTTER_SCROLL_RIGHT,
CLUTTER_SCROLL_SOURCE_UNKNOWN); CLUTTER_SCROLL_SOURCE_WHEEL);
dx--; dx--;
} }
else if (dx < 0) else if (dx < 0)
@ -498,7 +498,7 @@ handle_scroll_discrete (MetaEisClient *client,
clutter_virtual_input_device_notify_discrete_scroll (device->device, clutter_virtual_input_device_notify_discrete_scroll (device->device,
g_get_monotonic_time (), g_get_monotonic_time (),
CLUTTER_SCROLL_LEFT, CLUTTER_SCROLL_LEFT,
CLUTTER_SCROLL_SOURCE_UNKNOWN); CLUTTER_SCROLL_SOURCE_WHEEL);
dx++; dx++;
} }
@ -507,7 +507,7 @@ handle_scroll_discrete (MetaEisClient *client,
clutter_virtual_input_device_notify_discrete_scroll (device->device, clutter_virtual_input_device_notify_discrete_scroll (device->device,
g_get_monotonic_time (), g_get_monotonic_time (),
CLUTTER_SCROLL_DOWN, CLUTTER_SCROLL_DOWN,
CLUTTER_SCROLL_SOURCE_UNKNOWN); CLUTTER_SCROLL_SOURCE_WHEEL);
dy--; dy--;
} }
else if (dy < 0) else if (dy < 0)
@ -515,7 +515,7 @@ handle_scroll_discrete (MetaEisClient *client,
clutter_virtual_input_device_notify_discrete_scroll (device->device, clutter_virtual_input_device_notify_discrete_scroll (device->device,
g_get_monotonic_time (), g_get_monotonic_time (),
CLUTTER_SCROLL_UP, CLUTTER_SCROLL_UP,
CLUTTER_SCROLL_SOURCE_UNKNOWN); CLUTTER_SCROLL_SOURCE_WHEEL);
dy++; dy++;
} }
} }