summaryrefslogtreecommitdiff
path: root/gtk/gtkwindow.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2018-03-09 06:14:59 +0100
committerCarlos Garnacho <carlosg@gnome.org>2018-04-26 17:59:42 +0200
commit4ddc94b293504b56c0106b0177c36c8efd2d3a57 (patch)
treeb620c608c025e287685a04afa8429d5541e12274 /gtk/gtkwindow.c
parent71991270b047c66e7c14a65aaa70703527c978cf (diff)
downloadgtk+-4ddc94b293504b56c0106b0177c36c8efd2d3a57.tar.gz
multipressgesture: Port to new API model
Diffstat (limited to 'gtk/gtkwindow.c')
-rw-r--r--gtk/gtkwindow.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 0b090e323c..2e39cb0e2b 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -1963,12 +1963,13 @@ gtk_window_constructed (GObject *object)
if (priv->type == GTK_WINDOW_TOPLEVEL)
{
- priv->multipress_gesture = gtk_gesture_multi_press_new (GTK_WIDGET (object));
+ priv->multipress_gesture = gtk_gesture_multi_press_new ();
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (priv->multipress_gesture), 0);
gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (priv->multipress_gesture),
GTK_PHASE_NONE);
g_signal_connect (priv->multipress_gesture, "pressed",
G_CALLBACK (multipress_gesture_pressed_cb), object);
+ gtk_widget_add_controller (GTK_WIDGET (object), GTK_EVENT_CONTROLLER (priv->multipress_gesture));
priv->drag_gesture = gtk_gesture_drag_new (GTK_WIDGET (object));
gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (priv->drag_gesture),
@@ -5952,9 +5953,6 @@ gtk_window_finalize (GObject *object)
priv->mnemonics_display_timeout_id = 0;
}
- if (priv->multipress_gesture)
- g_object_unref (priv->multipress_gesture);
-
if (priv->drag_gesture)
g_object_unref (priv->drag_gesture);