[mutter] window/wayland: Make .._wayland_move_resize() name more explanatory



commit 4bacb3621bc5bb1c788ff759f2b86b4d42a5271a
Author: Jonas Ådahl <jadahl gmail com>
Date:   Mon Oct 22 16:41:12 2018 +0200

    window/wayland: Make .._wayland_move_resize() name more explanatory
    
    The intention of meta_window_wayland_move_resize() is to finish a
    move-resize requested previously, e.g. by a state change, or a
    interactive resize. Make the function name carry this intention, by
    renaming it to meta_window_wayland_finish_move_resize().
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/907

 src/core/window-private.h                   |  2 +-
 src/core/window.c                           |  6 ++++--
 src/wayland/meta-wayland-legacy-xdg-shell.c | 20 +++++++++++---------
 src/wayland/meta-wayland-wl-shell.c         |  6 +++---
 src/wayland/meta-wayland-xdg-shell.c        | 20 +++++++++++---------
 src/wayland/meta-window-wayland.c           | 18 +++++++++---------
 src/wayland/meta-window-wayland.h           | 12 ++++++------
 7 files changed, 45 insertions(+), 39 deletions(-)
---
diff --git a/src/core/window-private.h b/src/core/window-private.h
index 6e7563f8e..b32f47bc7 100644
--- a/src/core/window-private.h
+++ b/src/core/window-private.h
@@ -78,7 +78,7 @@ typedef enum
   META_MOVE_RESIZE_USER_ACTION = 1 << 1,
   META_MOVE_RESIZE_MOVE_ACTION = 1 << 2,
   META_MOVE_RESIZE_RESIZE_ACTION = 1 << 3,
-  META_MOVE_RESIZE_WAYLAND_RESIZE = 1 << 4,
+  META_MOVE_RESIZE_WAYLAND_FINISH_MOVE_RESIZE = 1 << 4,
   META_MOVE_RESIZE_STATE_CHANGED = 1 << 5,
   META_MOVE_RESIZE_UNMAXIMIZE = 1 << 6,
   META_MOVE_RESIZE_UNFULLSCREEN = 1 << 7,
diff --git a/src/core/window.c b/src/core/window.c
index dc6b5c795..434fb0acf 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -4039,7 +4039,9 @@ meta_window_move_resize_internal (MetaWindow          *window,
   /* The action has to be a move, a resize or the wayland client
    * acking our choice of size.
    */
-  g_assert (flags & (META_MOVE_RESIZE_MOVE_ACTION | META_MOVE_RESIZE_RESIZE_ACTION | 
META_MOVE_RESIZE_WAYLAND_RESIZE));
+  g_assert (flags & (META_MOVE_RESIZE_MOVE_ACTION |
+                     META_MOVE_RESIZE_RESIZE_ACTION |
+                     META_MOVE_RESIZE_WAYLAND_FINISH_MOVE_RESIZE));
 
   did_placement = !window->placed && window->calc_placement;
 
@@ -4071,7 +4073,7 @@ meta_window_move_resize_internal (MetaWindow          *window,
       unconstrained_rect.width = window->rect.width;
       unconstrained_rect.height = window->rect.height;
     }
-  else if ((flags & META_MOVE_RESIZE_WAYLAND_RESIZE))
+  else if ((flags & META_MOVE_RESIZE_WAYLAND_FINISH_MOVE_RESIZE))
     {
       /* This is a Wayland buffer acking our size. The new rect is
        * just the existing one we have. Ignore the passed-in rect
diff --git a/src/wayland/meta-wayland-legacy-xdg-shell.c b/src/wayland/meta-wayland-legacy-xdg-shell.c
index d9f68b3d1..8f7efd168 100644
--- a/src/wayland/meta-wayland-legacy-xdg-shell.c
+++ b/src/wayland/meta-wayland-legacy-xdg-shell.c
@@ -693,16 +693,18 @@ meta_wayland_zxdg_toplevel_v6_commit (MetaWaylandSurfaceRole  *surface_role,
 
   geometry_changed = !meta_rectangle_equal (&old_geometry, &xdg_surface_priv->geometry);
 
-  if (geometry_changed || meta_window_wayland_needs_move_resize (window))
+  if (geometry_changed || meta_window_wayland_has_pending_move_resize (window))
     {
       MetaRectangle window_geometry;
+      MetaWaylandSerial *acked_configure_serial;
 
       window_geometry =
         meta_wayland_zxdg_surface_v6_get_window_geometry (xdg_surface);
-      meta_window_wayland_move_resize (window,
-                                       &xdg_surface_priv->acked_configure_serial,
-                                       window_geometry,
-                                       pending->dx, pending->dy);
+      acked_configure_serial = &xdg_surface_priv->acked_configure_serial;
+      meta_window_wayland_finish_move_resize (window,
+                                              acked_configure_serial,
+                                              window_geometry,
+                                              pending->dx, pending->dy);
     }
   else if (pending->dx != 0 || pending->dy != 0)
     {
@@ -994,10 +996,10 @@ meta_wayland_zxdg_popup_v6_commit (MetaWaylandSurfaceRole  *surface_role,
 
   window_geometry =
     meta_wayland_zxdg_surface_v6_get_window_geometry (xdg_surface);
-  meta_window_wayland_move_resize (surface->window,
-                                   NULL,
-                                   window_geometry,
-                                   pending->dx, pending->dy);
+  meta_window_wayland_finish_move_resize (surface->window,
+                                          NULL,
+                                          window_geometry,
+                                          pending->dx, pending->dy);
 }
 
 static MetaWaylandSurface *
diff --git a/src/wayland/meta-wayland-wl-shell.c b/src/wayland/meta-wayland-wl-shell.c
index 466106232..65ebb9609 100644
--- a/src/wayland/meta-wayland-wl-shell.c
+++ b/src/wayland/meta-wayland-wl-shell.c
@@ -602,9 +602,9 @@ wl_shell_surface_role_commit (MetaWaylandSurfaceRole  *surface_role,
     return;
 
   meta_wayland_shell_surface_calculate_geometry (shell_surface, &geom);
-  meta_window_wayland_move_resize (window,
-                                   NULL,
-                                   geom, pending->dx, pending->dy);
+  meta_window_wayland_finish_move_resize (window,
+                                          NULL,
+                                          geom, pending->dx, pending->dy);
 }
 
 static MetaWaylandSurface *
diff --git a/src/wayland/meta-wayland-xdg-shell.c b/src/wayland/meta-wayland-xdg-shell.c
index 672659f50..bad503a1b 100644
--- a/src/wayland/meta-wayland-xdg-shell.c
+++ b/src/wayland/meta-wayland-xdg-shell.c
@@ -723,15 +723,17 @@ meta_wayland_xdg_toplevel_commit (MetaWaylandSurfaceRole  *surface_role,
 
   geometry_changed = !meta_rectangle_equal (&old_geometry, &xdg_surface_priv->geometry);
 
-  if (geometry_changed || meta_window_wayland_needs_move_resize (window))
+  if (geometry_changed || meta_window_wayland_has_pending_move_resize (window))
     {
       MetaRectangle window_geometry;
+      MetaWaylandSerial *acked_configure_serial;
 
       window_geometry = meta_wayland_xdg_surface_get_window_geometry (xdg_surface);
-      meta_window_wayland_move_resize (window,
-                                       &xdg_surface_priv->acked_configure_serial,
-                                       window_geometry,
-                                       pending->dx, pending->dy);
+      acked_configure_serial = &xdg_surface_priv->acked_configure_serial;
+      meta_window_wayland_finish_move_resize (window,
+                                              acked_configure_serial,
+                                              window_geometry,
+                                              pending->dx, pending->dy);
     }
   else if (pending->dx != 0 || pending->dy != 0)
     {
@@ -1073,10 +1075,10 @@ meta_wayland_xdg_popup_commit (MetaWaylandSurfaceRole  *surface_role,
     return;
 
   window_geometry = meta_wayland_xdg_surface_get_window_geometry (xdg_surface);
-  meta_window_wayland_move_resize (surface->window,
-                                   NULL,
-                                   window_geometry,
-                                   pending->dx, pending->dy);
+  meta_window_wayland_finish_move_resize (surface->window,
+                                          NULL,
+                                          window_geometry,
+                                          pending->dx, pending->dy);
 }
 
 static MetaWaylandSurface *
diff --git a/src/wayland/meta-window-wayland.c b/src/wayland/meta-window-wayland.c
index 5d193c4f5..180703202 100644
--- a/src/wayland/meta-window-wayland.c
+++ b/src/wayland/meta-window-wayland.c
@@ -265,7 +265,7 @@ meta_window_wayland_move_resize_internal (MetaWindow                *window,
     {
       can_move_now = TRUE;
     }
-  else if (flags & META_MOVE_RESIZE_WAYLAND_RESIZE)
+  else if (flags & META_MOVE_RESIZE_WAYLAND_FINISH_MOVE_RESIZE)
     {
       /* This is a call to wl_surface_commit(), ignore the constrained_rect and
        * update the real client size to match the buffer size.
@@ -514,7 +514,7 @@ meta_window_wayland_main_monitor_changed (MetaWindow               *window,
   scale_size (&window->size_hints.max_width, &window->size_hints.max_height, scale_factor);
 
   /* Window geometry offset (XXX: Need a better place, see
-   * meta_window_wayland_move_resize). */
+   * meta_window_wayland_finish_move_resize). */
   window->custom_frame_extents.left =
     (int)(scale_factor * window->custom_frame_extents.left);
   window->custom_frame_extents.top =
@@ -748,11 +748,11 @@ meta_window_wayland_get_geometry_scale (MetaWindow *window)
  * Complete a resize operation from a wayland client.
  */
 void
-meta_window_wayland_move_resize (MetaWindow        *window,
-                                 MetaWaylandSerial *acked_configure_serial,
-                                 MetaRectangle      new_geom,
-                                 int                dx,
-                                 int                dy)
+meta_window_wayland_finish_move_resize (MetaWindow        *window,
+                                        MetaWaylandSerial *acked_configure_serial,
+                                        MetaRectangle      new_geom,
+                                        int                dx,
+                                        int                dy)
 {
   MetaWindowWayland *wl_window = META_WINDOW_WAYLAND (window);
   int geometry_scale;
@@ -781,7 +781,7 @@ meta_window_wayland_move_resize (MetaWindow        *window,
   window->custom_frame_extents.left = new_geom.x;
   window->custom_frame_extents.top = new_geom.y;
 
-  flags = META_MOVE_RESIZE_WAYLAND_RESIZE;
+  flags = META_MOVE_RESIZE_WAYLAND_FINISH_MOVE_RESIZE;
 
   pending_ack_configure = is_pending_ack_configure (wl_window, acked_configure_serial);
 
@@ -995,7 +995,7 @@ meta_window_wayland_get_max_size (MetaWindow *window,
 }
 
 gboolean
-meta_window_wayland_needs_move_resize (MetaWindow *window)
+meta_window_wayland_has_pending_move_resize (MetaWindow *window)
 {
   MetaWindowWayland *wl_window = META_WINDOW_WAYLAND (window);
 
diff --git a/src/wayland/meta-window-wayland.h b/src/wayland/meta-window-wayland.h
index 68e448966..f0f72add3 100644
--- a/src/wayland/meta-window-wayland.h
+++ b/src/wayland/meta-window-wayland.h
@@ -46,11 +46,11 @@ typedef struct _MetaWindowWaylandClass MetaWindowWaylandClass;
 MetaWindow * meta_window_wayland_new       (MetaDisplay        *display,
                                             MetaWaylandSurface *surface);
 
-void meta_window_wayland_move_resize (MetaWindow        *window,
-                                      MetaWaylandSerial *acked_configure_serial,
-                                      MetaRectangle      new_geom,
-                                      int                dx,
-                                      int                dy);
+void meta_window_wayland_finish_move_resize (MetaWindow        *window,
+                                             MetaWaylandSerial *acked_configure_serial,
+                                             MetaRectangle      new_geom,
+                                             int                dx,
+                                             int                dy);
 int meta_window_wayland_get_geometry_scale (MetaWindow *window);
 
 void meta_window_wayland_place_relative_to (MetaWindow *window,
@@ -78,6 +78,6 @@ void meta_window_wayland_get_max_size (MetaWindow *window,
                                        int        *width,
                                        int        *height);
 
-gboolean meta_window_wayland_needs_move_resize (MetaWindow *window);
+gboolean meta_window_wayland_has_pending_move_resize (MetaWindow *window);
 
 #endif


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