Commit d9e6395e authored by Carlos Garnacho's avatar Carlos Garnacho

gesture: Protect against odd window hierarchies

If no match is found with the gesture widget when poking the event
window parents, bail out safely instead of falling in an infinite
loop. This was seen on Mutter.
parent cbe47c02
......@@ -318,7 +318,7 @@ _update_widget_coordinates (GtkGesture *gesture,
gdk_event_get_coords (data->event, &event_x, &event_y);
window = data->event->any.window;
while (window != event_widget_window)
while (window && window != event_widget_window)
{
gdk_window_get_position (window, &wx, &wy);
event_x += wx;
......@@ -326,6 +326,9 @@ _update_widget_coordinates (GtkGesture *gesture,
window = gdk_window_get_effective_parent (window);
}
if (!window)
return;
if (!gtk_widget_get_has_window (event_widget))
{
gtk_widget_get_allocation (event_widget, &allocation);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment