[mutter/wip/carlosg/frames-client: 5/12] x11: Add intermediate helper function to update X11 window after sync




commit 98adcc1e7d2d2951ca3ece1dc0098b108187d955
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Sep 9 13:10:30 2022 +0200

    x11: Add intermediate helper function to update X11 window after sync
    
    This function will be added some more logic in future commits.

 src/x11/meta-sync-counter.c  | 15 +++------------
 src/x11/window-x11-private.h |  2 ++
 src/x11/window-x11.c         | 10 ++++++++++
 3 files changed, 15 insertions(+), 12 deletions(-)
---
diff --git a/src/x11/meta-sync-counter.c b/src/x11/meta-sync-counter.c
index 2c7ae76246..57575b57b6 100644
--- a/src/x11/meta-sync-counter.c
+++ b/src/x11/meta-sync-counter.c
@@ -25,6 +25,7 @@
 #include "core/window-private.h"
 #include "meta/meta-x11-errors.h"
 #include "x11/meta-x11-display-private.h"
+#include "x11/window-x11-private.h"
 
 /* Each time the application updates the sync request counter to a new even value
  * value, we queue a frame into the windows list of frames. Once we're painting
@@ -206,13 +207,7 @@ sync_request_timeout (gpointer data)
 
   if (window == window->display->grab_window &&
       meta_grab_op_is_resizing (window->display->grab_op))
-    {
-      meta_window_update_resize (window,
-                                 window->display->grab_last_edge_resistance_flags,
-                                 window->display->grab_latest_motion_x,
-                                 window->display->grab_latest_motion_y,
-                                 TRUE);
-    }
+    meta_window_x11_check_update_resize (window);
 
   return G_SOURCE_REMOVE;
 }
@@ -317,11 +312,7 @@ meta_sync_counter_update (MetaSyncCounter *sync_counter,
 
           /* This means we are ready for another configure;
            * no pointer round trip here, to keep in sync */
-          meta_window_update_resize (window,
-                                     window->display->grab_last_edge_resistance_flags,
-                                     window->display->grab_latest_motion_x,
-                                     window->display->grab_latest_motion_y,
-                                     TRUE);
+          meta_window_x11_check_update_resize (window);
         }
     }
 
diff --git a/src/x11/window-x11-private.h b/src/x11/window-x11-private.h
index 973fc083b8..2c8af9f08c 100644
--- a/src/x11/window-x11-private.h
+++ b/src/x11/window-x11-private.h
@@ -95,6 +95,8 @@ void meta_window_x11_queue_update_icon (MetaWindowX11 *window_x11);
 
 void meta_window_x11_initialize_state (MetaWindow *window);
 
+void meta_window_x11_check_update_resize (MetaWindow *window);
+
 G_END_DECLS
 
 #endif
diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c
index 30c8688e96..045775302e 100644
--- a/src/x11/window-x11.c
+++ b/src/x11/window-x11.c
@@ -4155,3 +4155,13 @@ meta_window_x11_is_awaiting_sync_response (MetaWindow *window)
 
   return meta_sync_counter_is_waiting_response (&priv->sync_counter);
 }
+
+void
+meta_window_x11_check_update_resize (MetaWindow *window)
+{
+  meta_window_update_resize (window,
+                             window->display->grab_last_edge_resistance_flags,
+                             window->display->grab_latest_motion_x,
+                             window->display->grab_latest_motion_y,
+                             TRUE);
+}


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