summaryrefslogtreecommitdiff
path: root/gtk/gtkappchooserwidget.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/gtkappchooserwidget.c
parent71991270b047c66e7c14a65aaa70703527c978cf (diff)
downloadgtk+-4ddc94b293504b56c0106b0177c36c8efd2d3a57.tar.gz
multipressgesture: Port to new API model
Diffstat (limited to 'gtk/gtkappchooserwidget.c')
-rw-r--r--gtk/gtkappchooserwidget.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gtk/gtkappchooserwidget.c b/gtk/gtkappchooserwidget.c
index 19c0969047..bf5acc36f9 100644
--- a/gtk/gtkappchooserwidget.c
+++ b/gtk/gtkappchooserwidget.c
@@ -97,7 +97,6 @@ struct _GtkAppChooserWidgetPrivate {
GAppInfoMonitor *monitor;
GtkWidget *popup_menu;
- GtkGesture *multipress_gesture;
};
enum {
@@ -886,7 +885,6 @@ gtk_app_chooser_widget_finalize (GObject *object)
g_free (self->priv->default_text);
g_signal_handlers_disconnect_by_func (self->priv->monitor, app_info_changed, self);
g_object_unref (self->priv->monitor);
- g_object_unref (self->priv->multipress_gesture);
G_OBJECT_CLASS (gtk_app_chooser_widget_parent_class)->finalize (object);
}
@@ -1139,6 +1137,7 @@ gtk_app_chooser_widget_init (GtkAppChooserWidget *self)
{
GtkTreeSelection *selection;
GtkTreeModel *sort;
+ GtkGesture *gesture;
self->priv = gtk_app_chooser_widget_get_instance_private (self);
@@ -1176,10 +1175,11 @@ gtk_app_chooser_widget_init (GtkAppChooserWidget *self)
g_signal_connect (self->priv->monitor, "changed",
G_CALLBACK (app_info_changed), self);
- self->priv->multipress_gesture = gtk_gesture_multi_press_new (self->priv->program_list);
- gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (self->priv->multipress_gesture), GDK_BUTTON_SECONDARY);
- g_signal_connect (self->priv->multipress_gesture, "pressed",
+ gesture = gtk_gesture_multi_press_new ();
+ gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), GDK_BUTTON_SECONDARY);
+ g_signal_connect (gesture, "pressed",
G_CALLBACK (gtk_app_chooser_row_pressed_cb), self);
+ gtk_widget_add_controller (self->priv->program_list, GTK_EVENT_CONTROLLER (gesture));
}
static GAppInfo *