mirror of
https://github.com/brl/mutter.git
synced 2024-11-23 00:20:42 -05:00
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:
parent
b20d7a5cc4
commit
38cdaaf1f8
@ -420,7 +420,7 @@ handle_scroll (MetaEisClient *client,
|
||||
clutter_virtual_input_device_notify_scroll_continuous (device->device,
|
||||
g_get_monotonic_time (),
|
||||
dx, dy,
|
||||
CLUTTER_SCROLL_SOURCE_UNKNOWN,
|
||||
CLUTTER_SCROLL_SOURCE_WHEEL,
|
||||
CLUTTER_SCROLL_FINISHED_NONE);
|
||||
}
|
||||
|
||||
@ -441,7 +441,7 @@ handle_scroll_stop (MetaEisClient *client,
|
||||
clutter_virtual_input_device_notify_scroll_continuous (device->device,
|
||||
g_get_monotonic_time (),
|
||||
0.0, 0.0,
|
||||
CLUTTER_SCROLL_SOURCE_UNKNOWN,
|
||||
CLUTTER_SCROLL_SOURCE_WHEEL,
|
||||
finish_flags);
|
||||
}
|
||||
|
||||
@ -466,7 +466,7 @@ handle_scroll_cancel (MetaEisClient *client,
|
||||
clutter_virtual_input_device_notify_scroll_continuous (device->device,
|
||||
g_get_monotonic_time (),
|
||||
dx, dy,
|
||||
CLUTTER_SCROLL_SOURCE_UNKNOWN,
|
||||
CLUTTER_SCROLL_SOURCE_WHEEL,
|
||||
CLUTTER_SCROLL_FINISHED_NONE);
|
||||
}
|
||||
|
||||
@ -490,7 +490,7 @@ handle_scroll_discrete (MetaEisClient *client,
|
||||
clutter_virtual_input_device_notify_discrete_scroll (device->device,
|
||||
g_get_monotonic_time (),
|
||||
CLUTTER_SCROLL_RIGHT,
|
||||
CLUTTER_SCROLL_SOURCE_UNKNOWN);
|
||||
CLUTTER_SCROLL_SOURCE_WHEEL);
|
||||
dx--;
|
||||
}
|
||||
else if (dx < 0)
|
||||
@ -498,7 +498,7 @@ handle_scroll_discrete (MetaEisClient *client,
|
||||
clutter_virtual_input_device_notify_discrete_scroll (device->device,
|
||||
g_get_monotonic_time (),
|
||||
CLUTTER_SCROLL_LEFT,
|
||||
CLUTTER_SCROLL_SOURCE_UNKNOWN);
|
||||
CLUTTER_SCROLL_SOURCE_WHEEL);
|
||||
dx++;
|
||||
}
|
||||
|
||||
@ -507,7 +507,7 @@ handle_scroll_discrete (MetaEisClient *client,
|
||||
clutter_virtual_input_device_notify_discrete_scroll (device->device,
|
||||
g_get_monotonic_time (),
|
||||
CLUTTER_SCROLL_DOWN,
|
||||
CLUTTER_SCROLL_SOURCE_UNKNOWN);
|
||||
CLUTTER_SCROLL_SOURCE_WHEEL);
|
||||
dy--;
|
||||
}
|
||||
else if (dy < 0)
|
||||
@ -515,7 +515,7 @@ handle_scroll_discrete (MetaEisClient *client,
|
||||
clutter_virtual_input_device_notify_discrete_scroll (device->device,
|
||||
g_get_monotonic_time (),
|
||||
CLUTTER_SCROLL_UP,
|
||||
CLUTTER_SCROLL_SOURCE_UNKNOWN);
|
||||
CLUTTER_SCROLL_SOURCE_WHEEL);
|
||||
dy++;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user