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:
parent
a25081ffb5
commit
24965a78da
@ -849,7 +849,7 @@ void meta_window_activate_full (MetaWindow *window,
|
|||||||
MetaWorkspace *workspace);
|
MetaWorkspace *workspace);
|
||||||
|
|
||||||
META_EXPORT_TEST
|
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);
|
MetaLogicalMonitor * meta_window_get_main_logical_monitor (MetaWindow *window);
|
||||||
void meta_window_update_monitor (MetaWindow *window,
|
void meta_window_update_monitor (MetaWindow *window,
|
||||||
|
@ -934,7 +934,7 @@ meta_window_main_monitor_changed (MetaWindow *window,
|
|||||||
}
|
}
|
||||||
|
|
||||||
MetaLogicalMonitor *
|
MetaLogicalMonitor *
|
||||||
meta_window_calculate_main_logical_monitor (MetaWindow *window)
|
meta_window_find_monitor_from_frame_rect (MetaWindow *window)
|
||||||
{
|
{
|
||||||
MetaBackend *backend = meta_get_backend ();
|
MetaBackend *backend = meta_get_backend ();
|
||||||
MetaMonitorManager *monitor_manager =
|
MetaMonitorManager *monitor_manager =
|
||||||
@ -1160,7 +1160,7 @@ _meta_window_shared_new (MetaDisplay *display,
|
|||||||
window->compositor_private = NULL;
|
window->compositor_private = NULL;
|
||||||
|
|
||||||
if (window->rect.width > 0 && window->rect.height > 0)
|
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
|
else
|
||||||
window->monitor = meta_backend_get_current_logical_monitor (backend);
|
window->monitor = meta_backend_get_current_logical_monitor (backend);
|
||||||
|
|
||||||
|
@ -443,7 +443,7 @@ parse_window_size (MetaWindow *window,
|
|||||||
MetaRectangle logical_monitor_layout;
|
MetaRectangle logical_monitor_layout;
|
||||||
int value;
|
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);
|
g_assert_nonnull (logical_monitor);
|
||||||
|
|
||||||
logical_monitor_layout = meta_logical_monitor_get_layout (logical_monitor);
|
logical_monitor_layout = meta_logical_monitor_get_layout (logical_monitor);
|
||||||
|
@ -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
|
* 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
|
* changing main monitor may cause the window to be resized so that it no
|
||||||
* longer have that same new main monitor. */
|
* 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)
|
if (from == to)
|
||||||
return;
|
return;
|
||||||
|
@ -1860,7 +1860,7 @@ static void
|
|||||||
meta_window_x11_update_main_monitor (MetaWindow *window,
|
meta_window_x11_update_main_monitor (MetaWindow *window,
|
||||||
MetaWindowUpdateMonitorFlags flags)
|
MetaWindowUpdateMonitorFlags flags)
|
||||||
{
|
{
|
||||||
window->monitor = meta_window_calculate_main_logical_monitor (window);
|
window->monitor = meta_window_find_monitor_from_frame_rect (window);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user