aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-window.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ephy-window.c')
-rw-r--r--src/ephy-window.c40
1 files changed, 23 insertions, 17 deletions
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 803f3f8a1..cf876af8b 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -280,6 +280,7 @@ struct EphyWindowPrivate
EmbedChromeMask chrome_mask;
gboolean closing;
gboolean is_fullscreen;
+ gboolean has_size;
guint num_tabs;
};
@@ -1403,6 +1404,7 @@ ephy_window_init (EphyWindow *window)
window->priv->exit_fullscreen_popup = NULL;
window->priv->num_tabs = 0;
window->priv->is_fullscreen = FALSE;
+ window->priv->has_size = FALSE;
/* Setup the window and connect verbs */
setup_window (window);
@@ -1692,29 +1694,33 @@ ephy_window_show (GtkWidget *widget)
ephy_window_set_chrome (window, EMBED_CHROME_DEFAULT);
}
- if (!(window->priv->chrome_mask & EMBED_CHROME_OPENASPOPUP) &&
- !GTK_WIDGET_VISIBLE (widget))
+ if (!window->priv->has_size)
{
- ephy_state_add_window (widget,
- "main_window",
- 600, 500,
- EPHY_STATE_WINDOW_SAVE_SIZE);
- }
+ gboolean keep_state = TRUE;
- if ((window->priv->chrome_mask & EMBED_CHROME_OPENASPOPUP) &&
- !GTK_WIDGET_VISIBLE (widget))
- {
- EphyTab *tab;
- int width, height;
+ /* Do not keep state of sized popups */
+ if (window->priv->chrome_mask & EMBED_CHROME_OPENASPOPUP)
+ {
+ EphyTab *tab;
+ int width, height;
- tab = ephy_window_get_active_tab (EPHY_WINDOW (window));
- g_return_if_fail (tab != NULL);
+ tab = ephy_window_get_active_tab (EPHY_WINDOW (window));
+ g_return_if_fail (tab != NULL);
- ephy_tab_get_size (tab, &width, &height);
- if (width == -1 && height == -1)
+ ephy_tab_get_size (tab, &width, &height);
+ if (width != -1 || height != -1)
+ {
+ keep_state = FALSE;
+ }
+ }
+
+ if (keep_state)
{
- gtk_window_resize (GTK_WINDOW (window), 600, 500);
+ ephy_state_add_window (widget, "main_window", 600, 500,
+ EPHY_STATE_WINDOW_SAVE_SIZE);
}
+
+ window->priv->has_size = TRUE;
}
GTK_WIDGET_CLASS (parent_class)->show (widget);