[mutter/wayland] window: Remove code for static gravity resizes



commit 63350c52ccaddf08659fe6f8ea580ea3eba4b623
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Mar 19 09:21:14 2014 -0400

    window: Remove code for static gravity resizes
    
    It was never turned on for all the years it's been there.

 src/core/display-private.h |    2 -
 src/core/display.c         |    3 --
 src/core/window.c          |   84 +++-----------------------------------------
 3 files changed, 5 insertions(+), 84 deletions(-)
---
diff --git a/src/core/display-private.h b/src/core/display-private.h
index 281cc92..096304f 100644
--- a/src/core/display-private.h
+++ b/src/core/display-private.h
@@ -145,8 +145,6 @@ struct _MetaDisplay
    * multiple events with the same serial.
    */
   guint focused_by_us : 1;
-
-  guint static_gravity_works : 1;
   
   /*< private-ish >*/
   guint error_trap_synced_at_last_pop : 1;
diff --git a/src/core/display.c b/src/core/display.c
index e43cd27..489ca9f 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -527,9 +527,6 @@ meta_display_open (void)
   the_display->mouse_mode = TRUE; /* Only relevant for mouse or sloppy focus */
   the_display->allow_terminal_deactivation = TRUE; /* Only relevant for when a
                                                   terminal has the focus */
-
-  /* FIXME copy the checks from GDK probably */
-  the_display->static_gravity_works = g_getenv ("MUTTER_USE_STATIC_GRAVITY") != NULL;
   
   meta_bell_init (the_display);
 
diff --git a/src/core/window.c b/src/core/window.c
index e906f69..0941dca 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -4078,12 +4078,6 @@ adjust_for_gravity (MetaWindow        *window,
     }
 }
 
-static gboolean
-static_gravity_works (MetaDisplay *display)
-{
-  return display->static_gravity_works;
-}
-
 void
 meta_window_create_sync_request_alarm (MetaWindow *window)
 {
@@ -4398,26 +4392,6 @@ meta_window_update_monitor (MetaWindow *window)
 }
 
 static void
-meta_window_set_gravity (MetaWindow *window,
-                         int         gravity)
-{
-  XSetWindowAttributes attrs;
-
-  meta_verbose ("Setting gravity of %s to %d\n", window->desc, gravity);
-
-  attrs.win_gravity = gravity;
-
-  meta_error_trap_push (window->display);
-
-  XChangeWindowAttributes (window->display->xdisplay,
-                           window->xwindow,
-                           CWWinGravity,
-                           &attrs);
-
-  meta_error_trap_pop (window->display);
-}
-
-static void
 meta_window_move_resize_internal (MetaWindow          *window,
                                   MetaMoveResizeFlags  flags,
                                   int                  gravity,
@@ -4481,7 +4455,6 @@ meta_window_move_resize_internal (MetaWindow          *window,
   gboolean is_wayland_resize;
   gboolean did_placement;
   gboolean configure_frame_first;
-  gboolean use_static_gravity;
   /* used for the configure request, but may not be final
    * destination due to StaticGravity etc.
    */
@@ -4745,50 +4718,12 @@ meta_window_move_resize_internal (MetaWindow          *window,
 
           new_x = borders.total.left;
           new_y = borders.total.top;
+          client_move_x = new_x;
+          client_move_y = new_y;
 
-          if (need_resize_frame && need_move_frame &&
-              static_gravity_works (window->display))
-            {
-              /* static gravity kicks in because frame
-               * is both moved and resized
-               */
-              /* when we move the frame by frame_pos_dx, frame_pos_dy the
-               * client will implicitly move relative to frame by the
-               * inverse delta.
-               *
-               * When moving client then frame, we move the client by the
-               * frame delta, to be canceled out by the implicit move by
-               * the inverse frame delta, resulting in a client at new_x,
-               * new_y.
-               *
-               * When moving frame then client, we move the client
-               * by the same delta as the frame, because the client
-               * was "left behind" by the frame - resulting in a client
-               * at new_x, new_y.
-               *
-               * In both cases we need to move the client window
-               * in all cases where we had to move the frame window.
-               */
-
-              client_move_x = new_x + frame_pos_dx;
-              client_move_y = new_y + frame_pos_dy;
-
-              if (need_move_frame)
-                need_move_client = TRUE;
-
-              use_static_gravity = TRUE;
-            }
-          else
-            {
-              client_move_x = new_x;
-              client_move_y = new_y;
-
-              if (client_move_x != window->rect.x ||
-                  client_move_y != window->rect.y)
-                need_move_client = TRUE;
-
-              use_static_gravity = FALSE;
-            }
+          if (client_move_x != window->rect.x ||
+              client_move_y != window->rect.y)
+            need_move_client = TRUE;
 
           /* This is the final target position, but not necessarily what
            * we pass to XConfigureWindow, due to StaticGravity implicit
@@ -4808,8 +4743,6 @@ meta_window_move_resize_internal (MetaWindow          *window,
 
           client_move_x = window->rect.x;
           client_move_y = window->rect.y;
-
-          use_static_gravity = FALSE;
         }
 
       /* If frame extents have changed, fill in other frame fields and
@@ -4887,9 +4820,6 @@ meta_window_move_resize_internal (MetaWindow          *window,
           configure_frame_first = size_dx + size_dy >= 0;
         }
 
-      if (use_static_gravity)
-        meta_window_set_gravity (window, StaticGravity);
-
       if (configure_frame_first && window->frame)
         frame_shape_changed = meta_frame_sync_to_window (window->frame,
                                                          gravity,
@@ -4950,10 +4880,6 @@ meta_window_move_resize_internal (MetaWindow          *window,
                                                          gravity,
                                                          need_move_frame, need_resize_frame);
 
-      /* Put gravity back to be nice to lesser window managers */
-      if (use_static_gravity)
-        meta_window_set_gravity (window, NorthWestGravity);
-
       if (need_configure_notify)
         send_configure_notify (window);
     }


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