summaryrefslogtreecommitdiff
path: root/gtk/gtkshortcutswindow.c
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2018-04-20 19:58:06 +0200
committerCarlos Garnacho <carlosg@gnome.org>2018-04-26 17:59:42 +0200
commit15e00759c74a6bb72bffe2a6d7f75c83914c11c5 (patch)
tree793c4a97120e19a9c540aa282fd530ae3ef0c9f2 /gtk/gtkshortcutswindow.c
parentba7849960e5e3447884f92b58e899aa5db0f0565 (diff)
downloadgtk+-15e00759c74a6bb72bffe2a6d7f75c83914c11c5.tar.gz
eventcontrollerkey: Port to new API model
Diffstat (limited to 'gtk/gtkshortcutswindow.c')
-rw-r--r--gtk/gtkshortcutswindow.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gtk/gtkshortcutswindow.c b/gtk/gtkshortcutswindow.c
index 91551946b9..c9b55ef523 100644
--- a/gtk/gtkshortcutswindow.c
+++ b/gtk/gtkshortcutswindow.c
@@ -115,7 +115,6 @@ typedef struct
GtkListBox *list_box;
GtkBox *search_gestures;
GtkBox *search_shortcuts;
- GtkEventController *controller;
GtkWindow *window;
gulong keys_changed_id;
@@ -651,7 +650,6 @@ gtk_shortcuts_window_finalize (GObject *object)
g_clear_object (&priv->search_image_group);
g_clear_object (&priv->search_text_group);
- g_clear_object (&priv->controller);
G_OBJECT_CLASS (gtk_shortcuts_window_parent_class)->finalize (object);
}
@@ -882,13 +880,15 @@ gtk_shortcuts_window_init (GtkShortcutsWindow *self)
GtkWidget *label;
GtkWidget *empty;
PangoAttrList *attributes;
+ GtkEventController *controller;
gtk_window_set_resizable (GTK_WINDOW (self), FALSE);
gtk_window_set_type_hint (GTK_WINDOW (self), GDK_SURFACE_TYPE_HINT_DIALOG);
- priv->controller = gtk_event_controller_key_new (GTK_WIDGET (self));
- g_signal_connect (priv->controller, "key-pressed",
+ controller = gtk_event_controller_key_new ();
+ g_signal_connect (controller, "key-pressed",
G_CALLBACK (window_key_pressed), NULL);
+ gtk_widget_add_controller (GTK_WIDGET (self), controller);
priv->keywords = g_hash_table_new_full (NULL, NULL, NULL, g_free);
priv->search_items_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);