diff options
author | Marco Pesenti Gritti <marco@it.gnome.org> | 2003-06-22 17:32:07 +0800 |
---|---|---|
committer | Marco Pesenti Gritti <mpeseng@src.gnome.org> | 2003-06-22 17:32:07 +0800 |
commit | 393c76d574626ca402bc86057bea66a0130e2a72 (patch) | |
tree | acbb863a2324ea9f03877dfc57e73d75a10d27ca /src | |
parent | 1b0ed8d6983398861ecef0971f0131661d0ccef1 (diff) | |
download | gsoc2013-epiphany-393c76d574626ca402bc86057bea66a0130e2a72.tar gsoc2013-epiphany-393c76d574626ca402bc86057bea66a0130e2a72.tar.gz gsoc2013-epiphany-393c76d574626ca402bc86057bea66a0130e2a72.tar.bz2 gsoc2013-epiphany-393c76d574626ca402bc86057bea66a0130e2a72.tar.lz gsoc2013-epiphany-393c76d574626ca402bc86057bea66a0130e2a72.tar.xz gsoc2013-epiphany-393c76d574626ca402bc86057bea66a0130e2a72.tar.zst gsoc2013-epiphany-393c76d574626ca402bc86057bea66a0130e2a72.zip |
When following SAVE_POSITION/SAVE_SIZE flags actually not save them
2003-06-22 Marco Pesenti Gritti <marco@it.gnome.org>
* lib/ephy-state.c: (ephy_state_window_set_size),
(ephy_state_window_set_position), (ephy_state_window_save_size),
(ephy_state_window_save_position), (ephy_state_window_save),
(window_configure_event_cb), (window_state_event_cb),
(ephy_state_add_window):
When following SAVE_POSITION/SAVE_SIZE flags actually not save
them instead of just not restore.
Do not use coords value to determine unset state but a boolean
flag. (this will restore all saved states to NULL now)
* lib/ephy-state.h:
Add a NONE flag, it will restore but not save.
* src/ephy-tab.c: (ephy_tab_set_title):
Fix a warning when the url is NULL (popups)
* src/ephy-window.c: (ephy_window_init), (ephy_window_show):
Use normal size for not sized popups.
Diffstat (limited to 'src')
-rw-r--r-- | src/ephy-tab.c | 8 | ||||
-rw-r--r-- | src/ephy-window.c | 40 |
2 files changed, 29 insertions, 19 deletions
diff --git a/src/ephy-tab.c b/src/ephy-tab.c index 52bdebebb..978074394 100644 --- a/src/ephy-tab.c +++ b/src/ephy-tab.c @@ -1113,7 +1113,6 @@ ephy_tab_get_status_message (EphyTab *tab) static void ephy_tab_set_title (EphyTab *tab, const char *new_title) { - GnomeVFSURI *uri; char *title_short = NULL; char *title = NULL; @@ -1123,10 +1122,15 @@ ephy_tab_set_title (EphyTab *tab, const char *new_title) if (new_title == NULL || new_title[0] == '\0') { + GnomeVFSURI *uri = NULL; char *address; ephy_embed_get_location (tab->priv->embed, TRUE, &address); - uri = gnome_vfs_uri_new (address); + + if (address) + { + uri = gnome_vfs_uri_new (address); + } if (uri) { 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); |