13
0

Fix touch event propagation (custom grab)

See also 79dae5f2b4
This commit is contained in:
Robin Gareus 2024-10-30 19:12:21 +01:00
parent b45e3ecc0c
commit 23d5dcd080
2 changed files with 15 additions and 3 deletions

View File

@ -10861,6 +10861,10 @@ proxy_button_event (GdkEvent *source_event,
else if (type == GDK_TOUCH_END && display->touch_grabs)
{
GdkEventTouch* tev = (GdkEventTouch*) source_event;
void* w = g_hash_table_lookup (display->touch_grabs, GUINT_TO_POINTER (tev->sequence));
if (w) {
event_win = GDK_WINDOW (w);
}
g_hash_table_remove (display->touch_grabs, GUINT_TO_POINTER (tev->sequence));
}
else if (type == GDK_TOUCH_UPDATE && display->touch_grabs)

View File

@ -1427,6 +1427,11 @@ rewrite_event_for_grabs (GdkEvent *event)
return NULL;
break;
case GDK_TOUCH_BEGIN:
case GDK_TOUCH_END:
case GDK_TOUCH_UPDATE:
return NULL;
default:
return NULL;
}
@ -1599,7 +1604,6 @@ gtk_main_do_event (GdkEvent *event)
case GDK_BUTTON_PRESS:
case GDK_2BUTTON_PRESS:
case GDK_3BUTTON_PRESS:
case GDK_TOUCH_BEGIN:
gtk_propagate_event (grab_widget, event);
break;
@ -1637,13 +1641,17 @@ gtk_main_do_event (GdkEvent *event)
/* else fall through */
case GDK_MOTION_NOTIFY:
case GDK_BUTTON_RELEASE:
case GDK_TOUCH_UPDATE:
case GDK_TOUCH_END:
case GDK_PROXIMITY_IN:
case GDK_PROXIMITY_OUT:
gtk_propagate_event (grab_widget, event);
break;
case GDK_TOUCH_BEGIN:
case GDK_TOUCH_UPDATE:
case GDK_TOUCH_END:
gtk_propagate_event (event_widget, event);
break;
case GDK_ENTER_NOTIFY:
GTK_PRIVATE_SET_FLAG (event_widget, GTK_HAS_POINTER);
_gtk_widget_set_pointer_window (event_widget, event->any.window);