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>
This commit is contained in:
Jonas Ådahl 2022-08-03 22:55:56 +02:00 committed by Marge Bot
parent a25081ffb5
commit 24965a78da
5 changed files with 6 additions and 6 deletions

View File

@ -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,

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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