mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-28 22:41:43 +00:00
gtkwindow: Perform key activation in gtk_main_do_event()
In a similar spirit to the previous commit, make window shortcut activation happen by default on toplevels, without relying on legacy controllers.
This commit is contained in:
parent
6892b5c5ba
commit
ad5f0a63a3
@ -1688,6 +1688,10 @@ gtk_main_do_event (GdkEvent *event)
|
||||
{
|
||||
GtkWidget *focus_widget;
|
||||
|
||||
if (event->any.type == GDK_KEY_PRESS &&
|
||||
gtk_window_activate_key (GTK_WINDOW (event_widget), (GdkEventKey *) event))
|
||||
goto cleanup;
|
||||
|
||||
focus_widget = gtk_window_get_focus (GTK_WINDOW (event_widget));
|
||||
if (focus_widget)
|
||||
event_widget = focus_widget;
|
||||
|
@ -431,8 +431,6 @@ static gboolean gtk_window_configure_event (GtkWidget *widget,
|
||||
GdkEvent *event);
|
||||
static gboolean gtk_window_event (GtkWidget *widget,
|
||||
GdkEvent *event);
|
||||
static gint gtk_window_key_press_event (GtkWidget *widget,
|
||||
GdkEventKey *event);
|
||||
static void gtk_window_focus_in (GtkWidget *widget);
|
||||
static void gtk_window_focus_out (GtkWidget *widget);
|
||||
static void surface_state_changed (GtkWidget *widget);
|
||||
@ -804,7 +802,6 @@ gtk_window_class_init (GtkWindowClass *klass)
|
||||
widget_class->unrealize = gtk_window_unrealize;
|
||||
widget_class->size_allocate = gtk_window_size_allocate;
|
||||
widget_class->event = gtk_window_event;
|
||||
widget_class->key_press_event = gtk_window_key_press_event;
|
||||
widget_class->focus = gtk_window_focus;
|
||||
widget_class->move_focus = gtk_window_move_focus;
|
||||
widget_class->measure = gtk_window_measure;
|
||||
@ -7413,24 +7410,6 @@ gtk_window_propagate_key_event (GtkWindow *window,
|
||||
return handled;
|
||||
}
|
||||
|
||||
static gint
|
||||
gtk_window_key_press_event (GtkWidget *widget,
|
||||
GdkEventKey *event)
|
||||
{
|
||||
GtkWindow *window = GTK_WINDOW (widget);
|
||||
gboolean handled = FALSE;
|
||||
|
||||
/* handle mnemonics and accelerators */
|
||||
if (!handled)
|
||||
handled = gtk_window_activate_key (window, event);
|
||||
|
||||
/* Chain up, invokes binding set */
|
||||
if (!handled)
|
||||
handled = GTK_WIDGET_CLASS (gtk_window_parent_class)->key_press_event (widget, event);
|
||||
|
||||
return handled;
|
||||
}
|
||||
|
||||
static GtkWindowRegion
|
||||
get_active_region_type (GtkWindow *window, gint x, gint y)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user