1
0
Fork 0

clutter: Pass scroll source to discrete events

This piece of information was lost, always returning
"unknown". We can do better on the native backend.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3642>
This commit is contained in:
Carlos Garnacho 2024-03-05 12:51:30 +01:00 committed by Marge Bot
parent 3c217d2902
commit 7aebc9e63d
4 changed files with 5 additions and 0 deletions

View file

@ -64,6 +64,7 @@ ClutterEvent * clutter_event_scroll_discrete_new (ClutterEventFlags flags,
ClutterInputDeviceTool *tool, ClutterInputDeviceTool *tool,
ClutterModifierType modifiers, ClutterModifierType modifiers,
graphene_point_t coords, graphene_point_t coords,
ClutterScrollSource scroll_source,
ClutterScrollDirection direction); ClutterScrollDirection direction);
CLUTTER_EXPORT CLUTTER_EXPORT
ClutterEvent * clutter_event_crossing_new (ClutterEventType type, ClutterEvent * clutter_event_crossing_new (ClutterEventType type,

View file

@ -2017,6 +2017,7 @@ clutter_event_scroll_discrete_new (ClutterEventFlags flags,
ClutterInputDeviceTool *tool, ClutterInputDeviceTool *tool,
ClutterModifierType modifiers, ClutterModifierType modifiers,
graphene_point_t coords, graphene_point_t coords,
ClutterScrollSource scroll_source,
ClutterScrollDirection direction) ClutterScrollDirection direction)
{ {
ClutterEvent *event; ClutterEvent *event;
@ -2031,6 +2032,7 @@ clutter_event_scroll_discrete_new (ClutterEventFlags flags,
event->scroll.x = coords.x; event->scroll.x = coords.x;
event->scroll.y = coords.y; event->scroll.y = coords.y;
event->scroll.direction = direction; event->scroll.direction = direction;
event->scroll.scroll_source = scroll_source;
event->scroll.modifier_state = modifiers; event->scroll.modifier_state = modifiers;
event->scroll.tool = tool; event->scroll.tool = tool;

View file

@ -990,6 +990,7 @@ notify_discrete_scroll (ClutterInputDevice *input_device,
NULL, NULL,
modifiers, modifiers,
GRAPHENE_POINT_INIT (x, y), GRAPHENE_POINT_INIT (x, y),
scroll_source,
direction); direction);
queue_event (seat_impl, event); queue_event (seat_impl, event);

View file

@ -2378,6 +2378,7 @@ meta_seat_x11_translate_event (MetaSeatX11 *seat,
tool, tool,
state, state,
GRAPHENE_POINT_INIT (x, y), GRAPHENE_POINT_INIT (x, y),
CLUTTER_SCROLL_SOURCE_UNKNOWN,
scroll_direction); scroll_direction);
g_debug ("scroll: win:0x%x, device:%d '%s', time:%d " g_debug ("scroll: win:0x%x, device:%d '%s', time:%d "