[totem] main: Focus the search entry when the popover disappears



commit c854704d5b7951f0ebd59b1dfc69ae9144392d71
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Feb 6 16:15:02 2014 +0100

    main: Focus the search entry when the popover disappears

 src/totem-search-entry.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/totem-search-entry.c b/src/totem-search-entry.c
index 71346e6..1fe82b8 100644
--- a/src/totem-search-entry.c
+++ b/src/totem-search-entry.c
@@ -131,6 +131,13 @@ sort_sources (GtkListBoxRow *row_a,
 }
 
 static void
+popover_closed_cb (GtkPopover       *popover,
+                  TotemSearchEntry *self)
+{
+       gtk_widget_grab_focus (self->priv->entry);
+}
+
+static void
 totem_search_entry_init (TotemSearchEntry *self)
 {
        GtkWidget *entry;
@@ -151,6 +158,8 @@ totem_search_entry_init (TotemSearchEntry *self)
        self->priv->popover = gtk_popover_new (GTK_WIDGET (self));
        gtk_popover_set_modal (GTK_POPOVER (self->priv->popover), TRUE);
        gtk_popover_set_position (GTK_POPOVER (self->priv->popover), GTK_POS_BOTTOM);
+       g_signal_connect (G_OBJECT (self->priv->popover), "closed",
+                         G_CALLBACK (popover_closed_cb), self);
 
        self->priv->listbox = gtk_list_box_new ();
        gtk_list_box_set_activate_on_single_click (GTK_LIST_BOX (self->priv->listbox), TRUE);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]