summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtk/gtkmain.c4
-rw-r--r--gtk/gtkwindow.c21
2 files changed, 4 insertions, 21 deletions
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index 6dea428409..85bcc3865c 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -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;
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index ffa266b6e8..622477a023 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -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)
{