diff options
author | Benjamin Otte <otte@redhat.com> | 2018-03-09 06:36:22 +0100 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2018-04-26 17:59:42 +0200 |
commit | bf82149271b4f6bf6379b22eeea191dffe6823dd (patch) | |
tree | c72d4f5b5ed8a26efc7a0ea5f27e439f09ab8917 /gtk/gtkemojicompletion.c | |
parent | 4ddc94b293504b56c0106b0177c36c8efd2d3a57 (diff) | |
download | gtk+-bf82149271b4f6bf6379b22eeea191dffe6823dd.tar.gz |
longpressgesture: Port to new API model
Diffstat (limited to 'gtk/gtkemojicompletion.c')
-rw-r--r-- | gtk/gtkemojicompletion.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/gtk/gtkemojicompletion.c b/gtk/gtkemojicompletion.c index f1868c7e2a..c8a1be12c4 100644 --- a/gtk/gtkemojicompletion.c +++ b/gtk/gtkemojicompletion.c @@ -47,8 +47,6 @@ struct _GtkEmojiCompletion GtkWidget *active_variation; GVariant *data; - - GtkGesture *long_press; }; struct _GtkEmojiCompletionClass { @@ -76,8 +74,6 @@ gtk_emoji_completion_finalize (GObject *object) g_free (completion->text); g_variant_unref (completion->data); - g_clear_object (&completion->long_press); - G_OBJECT_CLASS (gtk_emoji_completion_parent_class)->finalize (object); } @@ -625,14 +621,16 @@ static void gtk_emoji_completion_init (GtkEmojiCompletion *completion) { g_autoptr(GBytes) bytes = NULL; + GtkGesture *long_press; gtk_widget_init_template (GTK_WIDGET (completion)); bytes = g_resources_lookup_data ("/org/gtk/libgtk/emoji/emoji.data", 0, NULL); completion->data = g_variant_ref_sink (g_variant_new_from_bytes (G_VARIANT_TYPE ("a(auss)"), bytes, TRUE)); - completion->long_press = gtk_gesture_long_press_new (completion->list); - g_signal_connect (completion->long_press, "pressed", G_CALLBACK (long_pressed_cb), completion); + long_press = gtk_gesture_long_press_new (); + g_signal_connect (long_press, "pressed", G_CALLBACK (long_pressed_cb), completion); + gtk_widget_add_controller (completion->list, GTK_EVENT_CONTROLLER (long_press)); } static void |