[metacity/gnome-3-18] Revert "window: send synthetic ConfigureNotify events"



commit 5a6a85802985e85805d825f3ae35c8a3e110ec4a
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Thu Mar 23 22:09:04 2017 +0200

    Revert "window: send synthetic ConfigureNotify events"
    
    This reverts commit 15940e701cef107666df63c7318367c564e5f37e.

 src/core/window-private.h |    8 +++
 src/core/window.c         |  141 ++++++++++++++++++---------------------------
 2 files changed, 64 insertions(+), 85 deletions(-)
---
diff --git a/src/core/window-private.h b/src/core/window-private.h
index e37e92c..972a7e2 100644
--- a/src/core/window-private.h
+++ b/src/core/window-private.h
@@ -551,6 +551,14 @@ void meta_window_send_icccm_message (MetaWindow *window,
                                      Atom        atom,
                                      guint32     timestamp);
 
+
+void     meta_window_move_resize_request(MetaWindow *window,
+                                         guint       value_mask,
+                                         int         gravity,
+                                         int         x,
+                                         int         y,
+                                         int         width,
+                                         int         height);
 gboolean meta_window_configure_request (MetaWindow *window,
                                         XEvent     *event);
 gboolean meta_window_property_notify   (MetaWindow *window,
diff --git a/src/core/window.c b/src/core/window.c
index 1fb7eff..f490ba8 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -78,16 +78,13 @@ static void     meta_window_save_rect         (MetaWindow    *window);
 static void     save_user_window_placement    (MetaWindow    *window);
 static void     force_save_user_window_placement (MetaWindow    *window);
 
-static void meta_window_move_resize_internal (MetaWindow          *window,
-                                              MetaMoveResizeFlags  flags,
-                                              int                  resize_gravity,
-                                              int                  root_x_nw,
-                                              int                  root_y_nw,
-                                              int                  w,
-                                              int                  h,
-                                              gboolean             configure_notify,
-                                              gboolean            *moved,
-                                              gboolean            *resized);
+static void meta_window_move_resize_internal (MetaWindow         *window,
+                                              MetaMoveResizeFlags flags,
+                                              int                 resize_gravity,
+                                              int                 root_x_nw,
+                                              int                 root_y_nw,
+                                              int                 w,
+                                              int                 h);
 
 static void     ensure_mru_position_after (MetaWindow *window,
                                            MetaWindow *after_this_one);
@@ -749,13 +746,13 @@ meta_window_new_with_attrs (MetaDisplay       *display,
    */
   flags =
     META_IS_CONFIGURE_REQUEST | META_IS_MOVE_ACTION | META_IS_RESIZE_ACTION;
-  meta_window_move_resize_internal (window, flags,
+  meta_window_move_resize_internal (window,
+                                    flags,
                                     window->size_hints.win_gravity,
                                     window->size_hints.x,
                                     window->size_hints.y,
                                     window->size_hints.width,
-                                    window->size_hints.height,
-                                    TRUE, NULL, NULL);
+                                    window->size_hints.height);
 
   /* Now try applying saved stuff from the session */
   {
@@ -942,10 +939,10 @@ meta_window_apply_session_info (MetaWindow *window,
                   x, y, w, h, window->desc);
 
       flags = META_DO_GRAVITY_ADJUST | META_IS_MOVE_ACTION | META_IS_RESIZE_ACTION;
-      meta_window_move_resize_internal (window, flags,
+      meta_window_move_resize_internal (window,
+                                        flags,
                                         window->size_hints.win_gravity,
-                                        x, y, w, h,
-                                        TRUE, NULL, NULL);
+                                        x, y, w, h);
     }
 }
 
@@ -3331,10 +3328,7 @@ meta_window_move_resize_internal (MetaWindow          *window,
                                   int                  root_x_nw,
                                   int                  root_y_nw,
                                   int                  w,
-                                  int                  h,
-                                  gboolean             configure_notify,
-                                  gboolean            *moved,
-                                  gboolean            *resized)
+                                  int                  h)
 {
   /* meta_window_move_resize_internal gets called with very different
    * meanings for root_x_nw and root_y_nw.  w & h are always the area
@@ -3667,12 +3661,6 @@ meta_window_move_resize_internal (MetaWindow          *window,
        (window->size_hints.flags & USPosition)))
     need_configure_notify = TRUE;
 
-  if (moved != NULL)
-    *moved = need_move_client || need_move_frame;
-
-  if (resized != NULL)
-    *resized = need_resize_client || need_resize_frame;
-
   /* The rest of this function syncs our new size/pos with X as
    * efficiently as possible
    */
@@ -3753,7 +3741,7 @@ meta_window_move_resize_internal (MetaWindow          *window,
   if (use_static_gravity)
     meta_window_set_gravity (window, NorthWestGravity);
 
-  if (need_configure_notify && configure_notify)
+  if (need_configure_notify)
     send_configure_notify (window);
 
   if (!window->placed && window->force_save_user_rect && !window->fullscreen)
@@ -3810,8 +3798,10 @@ meta_window_resize (MetaWindow  *window,
   meta_window_get_position (window, &x, &y);
 
   flags = (user_op ? META_IS_USER_ACTION : 0) | META_IS_RESIZE_ACTION;
-  meta_window_move_resize_internal (window, flags, NorthWestGravity,
-                                    x, y, w, h, TRUE, NULL, NULL);
+  meta_window_move_resize_internal (window,
+                                    flags,
+                                    NorthWestGravity,
+                                    x, y, w, h);
 }
 
 void
@@ -3822,11 +3812,12 @@ meta_window_move (MetaWindow  *window,
 {
   MetaMoveResizeFlags flags =
     (user_op ? META_IS_USER_ACTION : 0) | META_IS_MOVE_ACTION;
-  meta_window_move_resize_internal (window, flags, NorthWestGravity,
+  meta_window_move_resize_internal (window,
+                                    flags,
+                                    NorthWestGravity,
                                     root_x_nw, root_y_nw,
                                     window->rect.width,
-                                    window->rect.height,
-                                    TRUE, NULL, NULL);
+                                    window->rect.height);
 }
 
 void
@@ -3840,9 +3831,11 @@ meta_window_move_resize (MetaWindow  *window,
   MetaMoveResizeFlags flags =
     (user_op ? META_IS_USER_ACTION : 0) |
     META_IS_MOVE_ACTION | META_IS_RESIZE_ACTION;
-  meta_window_move_resize_internal (window, flags, NorthWestGravity,
-                                    root_x_nw, root_y_nw, w, h,
-                                    TRUE, NULL, NULL);
+  meta_window_move_resize_internal (window,
+                                    flags,
+                                    NorthWestGravity,
+                                    root_x_nw, root_y_nw,
+                                    w, h);
 }
 
 void
@@ -3858,8 +3851,10 @@ meta_window_resize_with_gravity (MetaWindow *window,
   meta_window_get_position (window, &x, &y);
 
   flags = (user_op ? META_IS_USER_ACTION : 0) | META_IS_RESIZE_ACTION;
-  meta_window_move_resize_internal (window, flags, gravity, x, y, w, h,
-                                    TRUE, NULL, NULL);
+  meta_window_move_resize_internal (window,
+                                    flags,
+                                    gravity,
+                                    x, y, w, h);
 }
 
 static void
@@ -4722,17 +4717,14 @@ meta_window_send_icccm_message (MetaWindow *window,
     meta_error_trap_pop (window->display, FALSE);
 }
 
-static void
+void
 meta_window_move_resize_request (MetaWindow *window,
                                  guint       value_mask,
                                  int         gravity,
                                  int         new_x,
                                  int         new_y,
                                  int         new_width,
-                                 int         new_height,
-                                 gboolean    configure_notify,
-                                 gboolean   *moved,
-                                 gboolean   *resized)
+                                 int         new_height)
 {
   int x, y, width, height;
   gboolean allow_position_change;
@@ -4900,10 +4892,13 @@ meta_window_move_resize_request (MetaWindow *window,
     flags |= META_IS_RESIZE_ACTION;
 
   if (flags & (META_IS_MOVE_ACTION | META_IS_RESIZE_ACTION))
-    meta_window_move_resize_internal (window, flags, gravity,
-                                      x, y, width, height,
-                                      configure_notify,
-                                      moved, resized);
+    meta_window_move_resize_internal (window,
+                                      flags,
+                                      gravity,
+                                      x,
+                                      y,
+                                      width,
+                                      height);
 
   /* window->user_rect exists to allow "snapping-back" the window if a
    * new strut is set (causing the window to move) and then the strut
@@ -4922,16 +4917,6 @@ gboolean
 meta_window_configure_request (MetaWindow *window,
                                XEvent     *event)
 {
-  gboolean moved;
-  gboolean resized;
-  gboolean restacked;
-  gboolean need_configure_notify;
-
-  moved = FALSE;
-  resized = FALSE;
-  restacked = FALSE;
-  need_configure_notify = FALSE;
-
   /* Note that x, y is the corner of the window border,
    * and width, height is the size of the window inside
    * its border, but that we always deny border requests
@@ -4941,14 +4926,14 @@ meta_window_configure_request (MetaWindow *window,
   if (event->xconfigurerequest.value_mask & CWBorderWidth)
     window->border_width = event->xconfigurerequest.border_width;
 
-  meta_window_move_resize_request (window,
-                                   event->xconfigurerequest.value_mask,
-                                   window->size_hints.win_gravity,
-                                   event->xconfigurerequest.x,
-                                   event->xconfigurerequest.y,
-                                   event->xconfigurerequest.width,
-                                   event->xconfigurerequest.height,
-                                   FALSE, &moved, &resized);
+  meta_window_move_resize_request(window,
+                                  event->xconfigurerequest.value_mask,
+                                  window->size_hints.win_gravity,
+                                  event->xconfigurerequest.x,
+                                  event->xconfigurerequest.y,
+                                  event->xconfigurerequest.width,
+                                  event->xconfigurerequest.height);
+
 
   /* Handle stacking. We only handle raises/lowers (both absolute and
    * relative to siblings), mostly because stack.c really can't deal with
@@ -4996,24 +4981,9 @@ meta_window_configure_request (MetaWindow *window,
             }
 
           restack_window(window, sibling, event->xconfigurerequest.detail);
-
-          restacked = TRUE;
         }
     }
 
-  /* If we change nothing, then we must send configure notify. */
-  if (!(moved || resized || window->border_width != 0 || restacked))
-    need_configure_notify = TRUE;
-
-  /* We must send configure notify if we move or restack without
-   * resizing or changing border width.
-   */
-  if ((moved || restacked) && !(resized || window->border_width != 0))
-    need_configure_notify = TRUE;
-
-  if (need_configure_notify)
-    send_configure_notify (window);
-
   return TRUE;
 }
 
@@ -5503,12 +5473,13 @@ meta_window_client_message (MetaWindow *window,
       if (gravity == 0)
         gravity = window->size_hints.win_gravity;
 
-      meta_window_move_resize_request (window, value_mask, gravity,
-                                       event->xclient.data.l[1], /* x */
-                                       event->xclient.data.l[2], /* y */
-                                       event->xclient.data.l[3], /* width */
-                                       event->xclient.data.l[4], /* height */
-                                       TRUE, NULL, NULL);
+      meta_window_move_resize_request(window,
+                                      value_mask,
+                                      gravity,
+                                      event->xclient.data.l[1],  /* x */
+                                      event->xclient.data.l[2],  /* y */
+                                      event->xclient.data.l[3],  /* width */
+                                      event->xclient.data.l[4]); /* height */
     }
   else if (event->xclient.message_type ==
            display->atom__NET_ACTIVE_WINDOW)


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