]> spindle.queued.net Git - midori/commitdiff
Restore the (search) entry focus after changing the icon
authorChristian Dywan <christian@twotoasts.de>
Fri, 10 Jul 2009 16:00:12 +0000 (17:00 +0100)
committerChristian Dywan <christian@twotoasts.de>
Fri, 10 Jul 2009 16:00:12 +0000 (17:00 +0100)
midori/gtkiconentry.c

index 6bb7e86987b9a5be5f6cd0d4edf5804a61612a3e..bfbf5fd5a47f71b1379bfb3c62cd3aa15614440d 100644 (file)
@@ -27,10 +27,16 @@ gtk_icon_entry_set_icon_from_pixbuf (GtkEntry*            entry,
                                      GtkEntryIconPosition position,
                                      GdkPixbuf*           pixbuf)
 {
+    GtkWidget* widget = GTK_WIDGET (entry);
+    GtkWidget* window;
+
     /* Without this ugly hack pixbuf icons don't work */
-    gtk_widget_hide (GTK_WIDGET (entry));
+    gtk_widget_hide (widget);
     gtk_entry_set_icon_from_pixbuf (entry, position, pixbuf);
-    gtk_widget_show (GTK_WIDGET (entry));
+    gtk_widget_show (widget);
+
+    if ((window = gtk_widget_get_toplevel (widget)))
+        gtk_window_set_focus (GTK_WINDOW (window), widget);
 }
 
 #else