summaryrefslogtreecommitdiff
path: root/gtk/gtkmenushell.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/gtkmenushell.c
parentba7849960e5e3447884f92b58e899aa5db0f0565 (diff)
downloadgtk+-15e00759c74a6bb72bffe2a6d7f75c83914c11c5.tar.gz
eventcontrollerkey: Port to new API model
Diffstat (limited to 'gtk/gtkmenushell.c')
-rw-r--r--gtk/gtkmenushell.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gtk/gtkmenushell.c b/gtk/gtkmenushell.c
index 69f1568d97..8873345ffa 100644
--- a/gtk/gtkmenushell.c
+++ b/gtk/gtkmenushell.c
@@ -411,13 +411,15 @@ static void
gtk_menu_shell_init (GtkMenuShell *menu_shell)
{
GtkWidget *widget = GTK_WIDGET (menu_shell);
+ GtkEventController *controller;
menu_shell->priv = gtk_menu_shell_get_instance_private (menu_shell);
menu_shell->priv->take_focus = TRUE;
- menu_shell->priv->key_controller = gtk_event_controller_key_new (widget);
- g_signal_connect (menu_shell->priv->key_controller, "key-pressed",
+ controller = gtk_event_controller_key_new ();
+ g_signal_connect (controller, "key-pressed",
G_CALLBACK (gtk_menu_shell_key_press), widget);
+ gtk_widget_add_controller (widget, controller);
gtk_widget_set_has_surface (widget, FALSE);
}
@@ -471,8 +473,6 @@ gtk_menu_shell_finalize (GObject *object)
if (priv->key_hash)
_gtk_key_hash_free (priv->key_hash);
- g_object_unref (priv->key_controller);
-
G_OBJECT_CLASS (gtk_menu_shell_parent_class)->finalize (object);
}