From: Christian Dywan Date: Fri, 10 Jul 2009 16:00:12 +0000 (+0100) Subject: Restore the (search) entry focus after changing the icon X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1662a036770444f13b389bef93e8c8abc4b5d590;p=midori Restore the (search) entry focus after changing the icon --- diff --git a/midori/gtkiconentry.c b/midori/gtkiconentry.c index 6bb7e869..bfbf5fd5 100644 --- a/midori/gtkiconentry.c +++ b/midori/gtkiconentry.c @@ -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