[mutter] window: Make monitor from rect finder helper more clearly named



commit 24965a78dad106037a94dddaa8d1828f7040257c
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Wed Aug 3 22:55:56 2022 +0200

    window: Make monitor from rect finder helper more clearly named
    
    The function finds a suitable logical monitor given the window
    rectangle; this wasn't all that clear from the name
    "calculate_main_logical_monitor".
    
    This is in preparation for finding a new logical monitor using things
    other than the geometry of the window.
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2554>

 src/core/window-private.h         | 2 +-
 src/core/window.c                 | 4 ++--
 src/tests/test-runner.c           | 2 +-
 src/wayland/meta-window-wayland.c | 2 +-
 src/x11/window-x11.c              | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/core/window-private.h b/src/core/window-private.h
index 8d2d4a0203..fce2a4727e 100644
--- a/src/core/window-private.h
+++ b/src/core/window-private.h
@@ -849,7 +849,7 @@ void meta_window_activate_full (MetaWindow     *window,
                                 MetaWorkspace  *workspace);
 
 META_EXPORT_TEST
-MetaLogicalMonitor * meta_window_calculate_main_logical_monitor (MetaWindow *window);
+MetaLogicalMonitor * meta_window_find_monitor_from_frame_rect (MetaWindow *window);
 
 MetaLogicalMonitor * meta_window_get_main_logical_monitor (MetaWindow *window);
 void meta_window_update_monitor (MetaWindow                   *window,
diff --git a/src/core/window.c b/src/core/window.c
index 98306291c9..ee5ba67de2 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -934,7 +934,7 @@ meta_window_main_monitor_changed (MetaWindow               *window,
 }
 
 MetaLogicalMonitor *
-meta_window_calculate_main_logical_monitor (MetaWindow *window)
+meta_window_find_monitor_from_frame_rect (MetaWindow *window)
 {
   MetaBackend *backend = meta_get_backend ();
   MetaMonitorManager *monitor_manager =
@@ -1160,7 +1160,7 @@ _meta_window_shared_new (MetaDisplay         *display,
   window->compositor_private = NULL;
 
   if (window->rect.width > 0 && window->rect.height > 0)
-    window->monitor = meta_window_calculate_main_logical_monitor (window);
+    window->monitor = meta_window_find_monitor_from_frame_rect (window);
   else
     window->monitor = meta_backend_get_current_logical_monitor (backend);
 
diff --git a/src/tests/test-runner.c b/src/tests/test-runner.c
index e3c5d1636b..9a9fb96310 100644
--- a/src/tests/test-runner.c
+++ b/src/tests/test-runner.c
@@ -443,7 +443,7 @@ parse_window_size (MetaWindow *window,
   MetaRectangle logical_monitor_layout;
   int value;
 
-  logical_monitor = meta_window_calculate_main_logical_monitor (window);
+  logical_monitor = meta_window_find_monitor_from_frame_rect (window);
   g_assert_nonnull (logical_monitor);
 
   logical_monitor_layout = meta_logical_monitor_get_layout (logical_monitor);
diff --git a/src/wayland/meta-window-wayland.c b/src/wayland/meta-window-wayland.c
index 2b389bfbf8..53a0078034 100644
--- a/src/wayland/meta-window-wayland.c
+++ b/src/wayland/meta-window-wayland.c
@@ -497,7 +497,7 @@ meta_window_wayland_update_main_monitor (MetaWindow                   *window,
    * needed to avoid jumping back and forth between the new and the old, since
    * changing main monitor may cause the window to be resized so that it no
    * longer have that same new main monitor. */
-  to = meta_window_calculate_main_logical_monitor (window);
+  to = meta_window_find_monitor_from_frame_rect (window);
 
   if (from == to)
     return;
diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c
index 617a1dfaa0..0c528c17a5 100644
--- a/src/x11/window-x11.c
+++ b/src/x11/window-x11.c
@@ -1860,7 +1860,7 @@ static void
 meta_window_x11_update_main_monitor (MetaWindow                   *window,
                                      MetaWindowUpdateMonitorFlags  flags)
 {
-  window->monitor = meta_window_calculate_main_logical_monitor (window);
+  window->monitor = meta_window_find_monitor_from_frame_rect (window);
 }
 
 static void


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