[mutter/gnome-3-16] window: Remove fullscreen_after_placement special case



commit 0765963adfacaa0db4bb480aeb85ba68c68658d4
Author: Rui Matos <tiagomatos gmail com>
Date:   Wed Jul 29 19:02:48 2015 +0200

    window: Remove fullscreen_after_placement special case
    
    This was introduced in commit c6793d477a324f857d31d0704f84ed9de0f1d680
    to prevent window self-maximisation. It turns out that that bug seems
    to have been fixed meanwhile in a different way since the reproducer
    in https://bugzilla.gnome.org/show_bug.cgi?id=461927#c37 now works
    fine with this special handling removed.
    
    In fact, failing to set window->fullscreen immediately when loading
    the initial set of X properties causes us to create a UI frame for a
    window that sets _NET_WM_STATE_FULLSCREEN.
    
    This, in turn, might cause the fullscreen constrain code to fail if
    the window also sets min_width/min_height size hints to be the monitor
    size since the UI frame size added to those makes the rectangle too
    big to fit the monitor. If the window doesn't set these hints, we
    fullscreen it but the window will get sized such that the UI frame is
    taken into account while it really shouldn't (see the reproducer
    above).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=753020

 src/core/constraints.c    |   16 +++-------------
 src/core/window-private.h |    3 ---
 src/core/window.c         |    1 -
 src/x11/window-props.c    |    5 ++++-
 4 files changed, 7 insertions(+), 18 deletions(-)
---
diff --git a/src/core/constraints.c b/src/core/constraints.c
index 2b1f074..7b23797 100644
--- a/src/core/constraints.c
+++ b/src/core/constraints.c
@@ -493,11 +493,10 @@ place_window_if_needed(MetaWindow     *window,
   if (window->placed || did_placement)
     {
       if (window->maximize_horizontally_after_placement ||
-          window->maximize_vertically_after_placement   ||
-          window->fullscreen_after_placement)
+          window->maximize_vertically_after_placement)
         {
-          /* define a sane saved_rect so that the user can unmaximize or
-           * make unfullscreen to something reasonable.
+          /* define a sane saved_rect so that the user can unmaximize to
+           * something reasonable.
            */
           if (info->current.width >= info->work_area_monitor.width)
             {
@@ -525,15 +524,6 @@ place_window_if_needed(MetaWindow     *window,
                 (window->maximize_vertically_after_placement ?
                  META_MAXIMIZE_VERTICAL : 0), &info->current);
 
-          if (window->fullscreen_after_placement)
-            {
-              window->saved_rect = info->current;
-              window->fullscreen = TRUE;
-              window->fullscreen_after_placement = FALSE;
-
-              g_object_notify (G_OBJECT (window), "fullscreen");
-            }
-
           window->maximize_horizontally_after_placement = FALSE;
           window->maximize_vertically_after_placement = FALSE;
         }
diff --git a/src/core/window-private.h b/src/core/window-private.h
index 9487dbf..01d170c 100644
--- a/src/core/window-private.h
+++ b/src/core/window-private.h
@@ -175,9 +175,6 @@ struct _MetaWindow
   /* Whether the window is marked as urgent */
   guint urgent : 1;
 
-  /* Whether we have to fullscreen after placement */
-  guint fullscreen_after_placement : 1;
-
   /* Area to cover when in fullscreen mode.  If _NET_WM_FULLSCREEN_MONITORS has
    * been overridden (via a client message), the window will cover the union of
    * these monitors.  If not, this is the single monitor which the window's
diff --git a/src/core/window.c b/src/core/window.c
index ec155f8..b69d296 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -873,7 +873,6 @@ _meta_window_shared_new (MetaDisplay         *display,
   window->maximize_vertically_after_placement = FALSE;
   window->minimize_after_placement = FALSE;
   window->fullscreen = FALSE;
-  window->fullscreen_after_placement = FALSE;
   window->fullscreen_monitors[0] = -1;
   window->require_fully_onscreen = TRUE;
   window->require_on_single_monitor = TRUE;
diff --git a/src/x11/window-props.c b/src/x11/window-props.c
index 8836a1d..5f03845 100644
--- a/src/x11/window-props.c
+++ b/src/x11/window-props.c
@@ -810,7 +810,10 @@ reload_net_wm_state (MetaWindow    *window,
       else if (value->v.atom_list.atoms[i] == window->display->atom__NET_WM_STATE_SKIP_PAGER)
         priv->wm_state_skip_pager = TRUE;
       else if (value->v.atom_list.atoms[i] == window->display->atom__NET_WM_STATE_FULLSCREEN)
-        window->fullscreen_after_placement = TRUE;
+        {
+          window->fullscreen = TRUE;
+          g_object_notify (G_OBJECT (window), "fullscreen");
+        }
       else if (value->v.atom_list.atoms[i] == window->display->atom__NET_WM_STATE_ABOVE)
         window->wm_state_above = TRUE;
       else if (value->v.atom_list.atoms[i] == window->display->atom__NET_WM_STATE_BELOW)


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