summaryrefslogtreecommitdiff
path: root/gtk/gtkappchooserdialog.c
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2018-03-11 13:55:45 +0100
committerCarlos Garnacho <carlosg@gnome.org>2018-04-05 19:26:54 +0200
commit1fa62395094e4c7d20307fac03540190a4aa42a1 (patch)
tree739c790870596b0c9b584c2edc1c32153ddb5360 /gtk/gtkappchooserdialog.c
parent0b3b81a8bf326639e8f9ef90ae4b9823d472e5ad (diff)
downloadgtk+-1fa62395094e4c7d20307fac03540190a4aa42a1.tar.gz
appchoooserdialog: use search bar key capture API
Diffstat (limited to 'gtk/gtkappchooserdialog.c')
-rw-r--r--gtk/gtkappchooserdialog.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/gtk/gtkappchooserdialog.c b/gtk/gtkappchooserdialog.c
index 6f78a3162e..352f735486 100644
--- a/gtk/gtkappchooserdialog.c
+++ b/gtk/gtkappchooserdialog.c
@@ -330,17 +330,6 @@ widget_populate_popup_cb (GtkAppChooserWidget *widget,
}
}
-static gboolean
-event_cb (GtkWidget *widget,
- GdkEvent *event,
- GtkSearchBar *bar)
-{
- if (gdk_event_get_event_type (event) == GDK_KEY_PRESS)
- return gtk_search_bar_handle_event (bar, event);
-
- return GDK_EVENT_PROPAGATE;
-}
-
static void
construct_appchooser_widget (GtkAppChooserDialog *self)
{
@@ -375,8 +364,9 @@ construct_appchooser_widget (GtkAppChooserDialog *self)
_gtk_app_chooser_widget_set_search_entry (GTK_APP_CHOOSER_WIDGET (self->priv->app_chooser_widget),
GTK_ENTRY (self->priv->search_entry));
- g_signal_connect (self, "event",
- G_CALLBACK (event_cb), self->priv->search_bar);
+
+ gtk_search_bar_set_key_capture_widget (GTK_SEARCH_BAR (self->priv->search_bar),
+ GTK_WIDGET (self));
}
static void