Reset event controllers on GdkEventGrabBroken

This event means that the widget being listened won't receive
further input events as something else grabbed devices, reset
event controllers in this case.

This helps with SL #4128 where we did reset the long press
controller manually.

Signed-off-by: Carlos Garnacho <carlos@lanedo.com>
Acked-by: Simon Schampijer <simon@laptop.org>
This commit is contained in:
Carlos Garnacho 2012-11-07 12:08:23 +01:00 committed by Simon Schampijer
parent dcfc92dbd0
commit b2df135844

View File

@ -203,16 +203,21 @@ _sugar_event_controller_widget_event (GtkWidget *widget,
data->current_exclusive != item->controller) data->current_exclusive != item->controller)
continue; continue;
if (!sugar_event_controller_handle_event (item->controller, event)) if (event->type == GDK_GRAB_BROKEN && !event->grab_broken.keyboard)
continue; sugar_event_controller_reset (item->controller);
else
{
if (!sugar_event_controller_handle_event (item->controller, event))
continue;
state = sugar_event_controller_get_state (item->controller); state = sugar_event_controller_get_state (item->controller);
/* Consider events handled once the /* Consider events handled once the
* controller recognizes the action * controller recognizes the action
*/ */
if (state == SUGAR_EVENT_CONTROLLER_STATE_RECOGNIZED) if (state == SUGAR_EVENT_CONTROLLER_STATE_RECOGNIZED)
handled = TRUE; handled = TRUE;
}
} }
return handled; return handled;