[mutter] window: Force state changes on maximized / fullscreen



commit b24cd5ae08960be90f19927f7d09514a43606194
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon Dec 15 13:44:22 2014 -0800

    window: Force state changes on maximized / fullscreen

 src/core/window-private.h    |    1 +
 src/core/window.c            |   25 ++++++++++++++-----------
 src/wayland/window-wayland.c |    5 ++++-
 3 files changed, 19 insertions(+), 12 deletions(-)
---
diff --git a/src/core/window-private.h b/src/core/window-private.h
index 4e623f7..623c53e 100644
--- a/src/core/window-private.h
+++ b/src/core/window-private.h
@@ -77,6 +77,7 @@ typedef enum
   META_MOVE_RESIZE_MOVE_ACTION       = 1 << 2,
   META_MOVE_RESIZE_RESIZE_ACTION     = 1 << 3,
   META_MOVE_RESIZE_WAYLAND_RESIZE    = 1 << 4,
+  META_MOVE_RESIZE_STATE_CHANGED     = 1 << 5,
 } MetaMoveResizeFlags;
 
 typedef enum
diff --git a/src/core/window.c b/src/core/window.c
index 83dd516..5c1c347 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -2690,7 +2690,10 @@ meta_window_maximize (MetaWindow        *window,
 
       meta_window_get_frame_rect (window, &old_rect);
 
-      meta_window_move_resize_now (window);
+      meta_window_move_resize_internal (window,
+                                        META_MOVE_RESIZE_MOVE_ACTION | META_MOVE_RESIZE_RESIZE_ACTION | 
META_MOVE_RESIZE_STATE_CHANGED,
+                                        NorthWestGravity,
+                                        window->unconstrained_rect);
 
       meta_window_get_frame_rect (window, &new_rect);
       meta_compositor_maximize_window (window->display->compositor,
@@ -3044,7 +3047,7 @@ meta_window_unmaximize_internal (MetaWindow        *window,
       meta_window_client_rect_to_frame_rect (window, &target_rect, &target_rect);
 
       meta_window_move_resize_internal (window,
-                                        META_MOVE_RESIZE_MOVE_ACTION | META_MOVE_RESIZE_RESIZE_ACTION,
+                                        META_MOVE_RESIZE_MOVE_ACTION | META_MOVE_RESIZE_RESIZE_ACTION | 
META_MOVE_RESIZE_STATE_CHANGED,
                                         gravity,
                                         target_rect);
 
@@ -3189,9 +3192,11 @@ meta_window_make_fullscreen (MetaWindow  *window)
   if (!window->fullscreen)
     {
       meta_window_make_fullscreen_internal (window);
-      /* move_resize with new constraints
-       */
-      meta_window_queue(window, META_QUEUE_MOVE_RESIZE);
+
+      meta_window_move_resize_internal (window,
+                                        META_MOVE_RESIZE_MOVE_ACTION | META_MOVE_RESIZE_RESIZE_ACTION | 
META_MOVE_RESIZE_STATE_CHANGED,
+                                        NorthWestGravity,
+                                        window->unconstrained_rect);
     }
 }
 
@@ -3222,12 +3227,10 @@ meta_window_unmake_fullscreen (MetaWindow  *window)
       meta_window_recalc_features (window);
       set_net_wm_state (window);
 
-      meta_window_move_resize_frame (window,
-                                     FALSE,
-                                     target_rect.x,
-                                     target_rect.y,
-                                     target_rect.width,
-                                     target_rect.height);
+      meta_window_move_resize_internal (window,
+                                        META_MOVE_RESIZE_MOVE_ACTION | META_MOVE_RESIZE_RESIZE_ACTION | 
META_MOVE_RESIZE_STATE_CHANGED,
+                                        NorthWestGravity,
+                                        target_rect);
 
       meta_window_update_layer (window);
 
diff --git a/src/wayland/window-wayland.c b/src/wayland/window-wayland.c
index d37ff85..55c24c5 100644
--- a/src/wayland/window-wayland.c
+++ b/src/wayland/window-wayland.c
@@ -188,8 +188,11 @@ meta_window_wayland_move_resize_internal (MetaWindow                *window,
     }
   else
     {
+      /* If the size changed, or the state changed, then we have to wait until
+       * the client acks our configure before moving the window. */
       if (constrained_rect.width != window->rect.width ||
-          constrained_rect.height != window->rect.height)
+          constrained_rect.height != window->rect.height ||
+          (flags & META_MOVE_RESIZE_STATE_CHANGED))
         {
           /* If we get a 0x0 size, this means that we're trying to resize
            * a surface that doesn't have any buffer attached. This can happen


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