Merge branch 'wip/carlosg/touchpad-gesture-fixes' into 'main'

Touchpad gesture fixes

See merge request GNOME/gtk!4417
This commit is contained in:
Matthias Clasen 2022-01-26 19:32:33 +00:00
commit 6f5210afea
4 changed files with 18 additions and 18 deletions

View File

@ -719,14 +719,6 @@ gdk_event_queue_handle_scroll_compression (GdkDisplay *display)
gdk_event_unref (old_event);
}
if (g_queue_get_length (&display->queued_events) == 1 &&
g_queue_peek_head_link (&display->queued_events) == scrolls)
{
GdkFrameClock *clock = gdk_surface_get_frame_clock (surface);
if (clock) /* might be NULL if surface was destroyed */
gdk_frame_clock_request_phase (clock, GDK_FRAME_CLOCK_PHASE_FLUSH_EVENTS);
}
}
static void
@ -832,14 +824,6 @@ _gdk_event_queue_handle_motion_compression (GdkDisplay *display)
g_queue_delete_link (&display->queued_events, pending_motions);
pending_motions = next;
}
if (g_queue_get_length (&display->queued_events) == 1 &&
g_queue_peek_head_link (&display->queued_events) == pending_motions)
{
GdkFrameClock *clock = gdk_surface_get_frame_clock (pending_motion_surface);
if (clock) /* might be NULL if surface was destroyed */
gdk_frame_clock_request_phase (clock, GDK_FRAME_CLOCK_PHASE_FLUSH_EVENTS);
}
}
void

View File

@ -2244,7 +2244,7 @@ _gdk_windowing_got_event (GdkDisplay *display,
GdkEvent *event,
gulong serial)
{
GdkSurface *event_surface;
GdkSurface *event_surface = NULL;
gboolean unlink_event = FALSE;
GdkDeviceGrabInfo *button_release_grab;
GdkPointerSurfaceInfo *pointer_info = NULL;
@ -2336,6 +2336,14 @@ _gdk_windowing_got_event (GdkDisplay *display,
*/
_gdk_event_queue_handle_motion_compression (display);
gdk_event_queue_handle_scroll_compression (display);
if (event_surface)
{
GdkFrameClock *clock = gdk_surface_get_frame_clock (event_surface);
if (clock) /* might be NULL if surface was destroyed */
gdk_frame_clock_request_phase (clock, GDK_FRAME_CLOCK_PHASE_FLUSH_EVENTS);
}
}
/**

View File

@ -242,7 +242,7 @@ _gtk_gesture_get_n_touchpad_points (GtkGesture *gesture,
if (!priv->touchpad)
return 0;
data = g_hash_table_lookup (priv->points, NULL);
data = g_hash_table_lookup (priv->points, priv->last_sequence);
if (!data)
return 0;

View File

@ -1352,6 +1352,14 @@ handle_pointing_event (GdkEvent *event)
*/
device = gdk_seat_get_pointer (gdk_event_get_seat (event));
}
else if (type == GDK_TOUCHPAD_PINCH ||
type == GDK_TOUCHPAD_SWIPE)
{
/* Another bit of a kludge, touchpad gesture sequences do not
* reflect on the pointer focus lookup.
*/
sequence = NULL;
}
switch ((guint) type)
{