[epiphany] Mark windows with modified chrome as popups and only allow resizing for them



commit d436a108f1c30a5f937df2b05a5e5cbdf12b4d0a
Author: Gustavo Noronha Silva <gns gnome org>
Date:   Sat Apr 16 16:11:08 2011 -0300

    Mark windows with modified chrome as popups and only allow resizing for them
    
    A window with non-modified chrome will potentially be used as a normal
    window for browsing - there's no reason why it should be different
    from existing windows when it comes to resize policy. With this change
    we consider windows with modified chrome as popups and only set a
    default size on creation for popup windows.
    
    Bug #612155

 src/ephy-window.c |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 75ee24a..2d10dbe 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -2424,18 +2424,23 @@ web_view_ready_cb (WebKitWebView *web_view,
 			      "menubar-visible", &menubar_visible,
 			      NULL);
 
-		gtk_window_set_default_size (GTK_WINDOW (window), width, height);
-
 		if (!toolbar_visible)
 			chrome_mask &= ~EPHY_WEB_VIEW_CHROME_TOOLBAR;
 
 		if (!menubar_visible)
 			chrome_mask &= ~EPHY_WEB_VIEW_CHROME_MENUBAR;
 
-		window->priv->chrome = chrome_mask;
 
-		update_chromes_actions (window);
-		sync_chromes_visibility (window);
+		/* We will consider windows with different chrome settings popups. */
+		if (chrome_mask != window->priv->chrome) {
+			gtk_window_set_default_size (GTK_WINDOW (window), width, height);
+
+			window->priv->is_popup = TRUE;
+			window->priv->chrome = chrome_mask;
+
+			update_chromes_actions (window);
+			sync_chromes_visibility (window);
+		}
 
 		g_signal_emit_by_name (parent_web_view, "new-window", web_view);
 	}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]