mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-17 23:50:16 +00:00
gtkwidget: Activate key bindings through run_controllers()
Deferring a bit further making those a standalone controller, make binding activation happen on run_controllers(), so it happens by default on widgets (unless the key event was consumed earlier) without the need of a legacy event controller.
This commit is contained in:
parent
d74ecfb02e
commit
6892b5c5ba
@ -5138,14 +5138,14 @@ static gboolean
|
|||||||
gtk_widget_real_key_press_event (GtkWidget *widget,
|
gtk_widget_real_key_press_event (GtkWidget *widget,
|
||||||
GdkEventKey *event)
|
GdkEventKey *event)
|
||||||
{
|
{
|
||||||
return gtk_bindings_activate_event (G_OBJECT (widget), event);
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gtk_widget_real_key_release_event (GtkWidget *widget,
|
gtk_widget_real_key_release_event (GtkWidget *widget,
|
||||||
GdkEventKey *event)
|
GdkEventKey *event)
|
||||||
{
|
{
|
||||||
return gtk_bindings_activate_event (G_OBJECT (widget), event);
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define WIDGET_REALIZED_FOR_EVENT(widget, event) \
|
#define WIDGET_REALIZED_FOR_EVENT(widget, event) \
|
||||||
@ -5424,6 +5424,11 @@ gtk_widget_event_internal (GtkWidget *widget,
|
|||||||
return_val |= _gtk_widget_run_controllers (widget, event_copy, GTK_PHASE_BUBBLE);
|
return_val |= _gtk_widget_run_controllers (widget, event_copy, GTK_PHASE_BUBBLE);
|
||||||
g_object_unref (event_copy);
|
g_object_unref (event_copy);
|
||||||
|
|
||||||
|
if (return_val == FALSE &&
|
||||||
|
(event->any.type == GDK_KEY_PRESS ||
|
||||||
|
event->any.type == GDK_KEY_RELEASE))
|
||||||
|
return_val |= gtk_bindings_activate_event (G_OBJECT (widget), (GdkEventKey *) event);
|
||||||
|
|
||||||
return return_val;
|
return return_val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user