diff options
Diffstat (limited to 'gtk/gtkcalendar.c')
-rw-r--r-- | gtk/gtkcalendar.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c index 219be68481..704ce1808d 100644 --- a/gtk/gtkcalendar.c +++ b/gtk/gtkcalendar.c @@ -249,7 +249,6 @@ struct _GtkCalendarPrivate gint detail_width_chars; gint detail_overflow[6]; - GtkGesture *press_gesture; GtkGesture *drag_gesture; GtkEventController *scroll_controller; GtkEventController *key_controller; @@ -643,6 +642,7 @@ static void gtk_calendar_init (GtkCalendar *calendar) { GtkWidget *widget = GTK_WIDGET (calendar); + GtkGesture *gesture; time_t secs; struct tm *tm; gint i; @@ -672,9 +672,10 @@ gtk_calendar_init (GtkCalendar *calendar) gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (calendar)), GTK_STYLE_CLASS_VIEW); - priv->press_gesture = gtk_gesture_multi_press_new (GTK_WIDGET (calendar)); - g_signal_connect (priv->press_gesture, "pressed", G_CALLBACK (gtk_calendar_button_press), calendar); - g_signal_connect (priv->press_gesture, "released", G_CALLBACK (gtk_calendar_button_release), calendar); + gesture = gtk_gesture_multi_press_new (); + g_signal_connect (gesture, "pressed", G_CALLBACK (gtk_calendar_button_press), calendar); + g_signal_connect (gesture, "released", G_CALLBACK (gtk_calendar_button_release), calendar); + gtk_widget_add_controller (GTK_WIDGET (calendar), GTK_EVENT_CONTROLLER (gesture)); priv->drag_gesture = gtk_gesture_drag_new (GTK_WIDGET (calendar)); g_signal_connect (priv->drag_gesture, "drag-begin", G_CALLBACK (gtk_calendar_drag_begin), calendar); @@ -1332,7 +1333,6 @@ gtk_calendar_finalize (GObject *object) { GtkCalendarPrivate *priv = GTK_CALENDAR (object)->priv; - g_object_unref (priv->press_gesture); g_object_unref (priv->drag_gesture); g_object_unref (priv->scroll_controller); g_object_unref (priv->key_controller); |