gtkwidget: Break early if non-gesture controllers handle the event

Non gesture controllers have no means to collaborate with other
controllers, thus should be considered standalone entities. It makes
no sense to propagate any further if scroll/key controllers handled
the event.
This commit is contained in:
Carlos Garnacho 2018-03-11 13:41:10 +01:00
parent 695549d5a7
commit d74ecfb02e

View File

@ -5229,6 +5229,13 @@ _gtk_widget_run_controllers (GtkWidget *widget,
if (controller_phase == phase)
handled |= gtk_event_controller_handle_event (data->controller, event);
/* Non-gesture controllers are basically unique entities not meant
* to collaborate with anything else. Break early if any such event
* controller handled the event.
*/
if (handled && !GTK_IS_GESTURE (data->controller))
break;
}
l = next;