Unset focus from GtkEntry when editing is stopped
authorDavyd Madeley <davyd@madeley.id.au>
Fri, 10 Apr 2009 16:53:57 +0000 (16:53 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Fri, 10 Apr 2009 16:53:57 +0000 (16:53 +0000)
From: Davyd Madeley <davyd@madeley.id.au>

svn path=/trunk/; revision=2781

libempathy-gtk/empathy-presence-chooser.c

index 32f32acb07b95935c8b37f72c761296a414a38db..3cc69dfc84a7402e350bbe01f335c8911cd663c9 100644 (file)
@@ -260,7 +260,13 @@ set_status_editing (EmpathyPresenceChooser *self, gboolean editing)
                                GTK_ENTRY_ICON_PRIMARY,
                                TRUE);
 
-               // FIXME - move the focus somewhere
+               /* attempt to get the toplevel for this widget */
+               GtkWidget *window = gtk_widget_get_toplevel (GTK_WIDGET (self));
+               if (GTK_WIDGET_TOPLEVEL (window) && GTK_IS_WINDOW (window))
+               {
+                       /* unset the focus */
+                       gtk_window_set_focus (GTK_WINDOW (window), NULL);
+               }
 
                priv->editing_status = FALSE;
        }