mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-09 18:30:08 +00:00
Drop pointer_emulated discrete scroll events
GTK4 has had smooth scroll events since the beginning, so we prefer not to emit emulated discrete scroll events at all
This commit is contained in:
parent
8514457d0f
commit
7752467847
@ -189,8 +189,7 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
|
||||
message->pointer.state,
|
||||
message->scroll.dir == 0
|
||||
? GDK_SCROLL_UP
|
||||
: GDK_SCROLL_DOWN,
|
||||
FALSE);
|
||||
: GDK_SCROLL_DOWN);
|
||||
|
||||
node = _gdk_event_queue_append (display, event);
|
||||
_gdk_windowing_got_event (display, node, event, message->base.serial);
|
||||
|
@ -920,14 +920,6 @@ gdk_event_get_pointer_emulated (GdkEvent *event)
|
||||
return tevent->pointer_emulated;
|
||||
}
|
||||
|
||||
case GDK_SCROLL:
|
||||
case GDK_SCROLL_SMOOTH:
|
||||
{
|
||||
GdkScrollEvent *sevent = (GdkScrollEvent *) event;
|
||||
|
||||
return sevent->pointer_emulated;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -2373,15 +2365,13 @@ gdk_scroll_event_new_discrete (GdkSurface *surface,
|
||||
GdkDeviceTool *tool,
|
||||
guint32 time,
|
||||
GdkModifierType state,
|
||||
GdkScrollDirection direction,
|
||||
gboolean emulated)
|
||||
GdkScrollDirection direction)
|
||||
{
|
||||
GdkScrollEvent *self = gdk_event_alloc (GDK_SCROLL, surface, device, time);
|
||||
|
||||
self->tool = tool != NULL ? g_object_ref (tool) : NULL;
|
||||
self->state = state;
|
||||
self->direction = direction;
|
||||
self->pointer_emulated = emulated;
|
||||
self->unit = GDK_SCROLL_UNIT_WHEEL;
|
||||
|
||||
return (GdkEvent *) self;
|
||||
|
@ -206,8 +206,6 @@ struct _GdkTouchEvent
|
||||
* %GDK_SCROLL_SMOOTH).
|
||||
* @delta_x: the x coordinate of the scroll delta
|
||||
* @delta_y: the y coordinate of the scroll delta
|
||||
* @pointer_emulated: whether the scroll event was the result of
|
||||
* a pointer emulation
|
||||
* @tool: a `GdkDeviceTool`
|
||||
* @history: (element-type GdkTimeCoord): array of times and deltas
|
||||
* for other scroll events that were compressed before delivering the
|
||||
@ -231,7 +229,6 @@ struct _GdkScrollEvent
|
||||
GdkScrollDirection direction;
|
||||
double delta_x;
|
||||
double delta_y;
|
||||
gboolean pointer_emulated;
|
||||
gboolean is_stop;
|
||||
GdkDeviceTool *tool;
|
||||
GArray *history; /* <GdkTimeCoord> */
|
||||
@ -496,8 +493,7 @@ GdkEvent * gdk_scroll_event_new_discrete (GdkSurface *surface,
|
||||
GdkDeviceTool *tool,
|
||||
guint32 time,
|
||||
GdkModifierType state,
|
||||
GdkScrollDirection direction,
|
||||
gboolean emulated);
|
||||
GdkScrollDirection direction);
|
||||
|
||||
GdkEvent * gdk_touch_event_new (GdkEventType type,
|
||||
GdkEventSequence *sequence,
|
||||
|
@ -700,8 +700,7 @@ fill_scroll_event (GdkMacosDisplay *self,
|
||||
NULL,
|
||||
get_time_from_ns_event (nsevent),
|
||||
state,
|
||||
direction,
|
||||
FALSE);
|
||||
direction);
|
||||
}
|
||||
|
||||
if (phase == NSEventPhaseEnded || phase == NSEventPhaseCancelled)
|
||||
|
@ -1394,8 +1394,7 @@ flush_discrete_scroll_event (GdkWaylandSeat *seat,
|
||||
NULL,
|
||||
seat->pointer_info.time,
|
||||
device_get_modifiers (seat->logical_pointer),
|
||||
direction,
|
||||
TRUE);
|
||||
direction);
|
||||
|
||||
_gdk_wayland_display_deliver_event (seat->display, event);
|
||||
}
|
||||
|
@ -1655,8 +1655,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
|
||||
NULL,
|
||||
xev->time,
|
||||
_gdk_x11_device_xi2_translate_state (&xev->mods, &xev->buttons, &xev->group),
|
||||
direction,
|
||||
FALSE);
|
||||
direction);
|
||||
|
||||
}
|
||||
else
|
||||
@ -1758,8 +1757,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
|
||||
NULL,
|
||||
xev->time,
|
||||
state,
|
||||
direction,
|
||||
FALSE);
|
||||
direction);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user