From 996bf1df4981e87d507e3fc8940d0c84b7d8ba9f Mon Sep 17 00:00:00 2001 From: Claudio Saavedra Date: Thu, 1 Sep 2011 18:16:37 +0300 Subject: EphyWindow: Fix location entry's load progress The caching of the GtkEntry was broken, since the toolbar items are destroyed on switching to/from fullscreen. Update the cache right after toolbar is rebuilt. https://bugzilla.gnome.org/show_bug.cgi?id=657936 --- src/ephy-window.c | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) (limited to 'src/ephy-window.c') diff --git a/src/ephy-window.c b/src/ephy-window.c index 3a0df31e1..ab6fb4e67 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -848,6 +848,26 @@ sync_chromes_visibility (EphyWindow *window) } } +static void +ensure_location_entry (EphyWindow *window) +{ + GtkActionGroup *toolbar_action_group; + GtkAction *action; + GSList *proxies; + GtkWidget *proxy; + EphyWindowPrivate *priv = window->priv; + + toolbar_action_group = ephy_toolbar_get_action_group (priv->toolbar); + action = gtk_action_group_get_action (toolbar_action_group, + "Location"); + proxies = gtk_action_get_proxies (action); + if (proxies) + { + proxy = GTK_WIDGET (proxies->data); + priv->entry = ephy_location_entry_get_entry (EPHY_LOCATION_ENTRY (proxy)); + } +} + static void ephy_window_fullscreen (EphyWindow *window) { @@ -883,6 +903,7 @@ ephy_window_fullscreen (EphyWindow *window) (EGG_EDITABLE_TOOLBAR (priv->toolbar), EGG_TOOLBARS_MODEL ( ephy_shell_get_toolbars_model (ephy_shell, TRUE))); + ensure_location_entry (window); ephy_toolbar_set_show_leave_fullscreen (priv->toolbar, !lockdown_fs); @@ -901,6 +922,7 @@ ephy_window_unfullscreen (EphyWindow *window) (EGG_EDITABLE_TOOLBAR (window->priv->toolbar), EGG_TOOLBARS_MODEL ( ephy_shell_get_toolbars_model (ephy_shell, FALSE))); + ensure_location_entry (window); ephy_toolbar_set_show_leave_fullscreen (window->priv->toolbar, FALSE); @@ -3732,8 +3754,6 @@ ephy_window_constructor (GType type, GtkActionGroup *toolbar_action_group; GError *error = NULL; guint settings_connection; - GSList *proxies; - GtkWidget *proxy; GtkCssProvider *css_provider; GFile *css_file; @@ -3917,16 +3937,8 @@ ephy_window_constructor (GType type, sync_chromes_visibility (window); - /* Cache GtkEntry inside EphyLocationEntry */ - action = gtk_action_group_get_action (toolbar_action_group, - "Location"); - proxies = gtk_action_get_proxies (action); - if (proxies) - { - proxy = GTK_WIDGET (proxies->data); - priv->entry = ephy_location_entry_get_entry (EPHY_LOCATION_ENTRY (proxy)); - } - + ensure_location_entry (window); + return object; } -- cgit v1.2.3