From 1662a036770444f13b389bef93e8c8abc4b5d590 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Fri, 10 Jul 2009 17:00:12 +0100 Subject: [PATCH] Restore the (search) entry focus after changing the icon --- midori/gtkiconentry.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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 -- 2.39.5