window: Really fix portrait orientation check for tiling
Commit3bfcb6d1
fixed the check for tiling via keybindings, but ignored a subtle edge case when tiling with the pointer: The monitor used for tiling is the monitor with the pointer, which is not necessarily the one that contains the largest part of the window. That is, the correct monitor to check against depends on the context where the function is called. We can either figure it out automatically via the current window drag, or make it a parameter. The latter is clearer, because the callers already decide which monitor to use for tiling anyway. Fixes:3bfcb6d1b9
("window: Fix portrait orientation check for tiling") Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3248>
This commit is contained in:

committed by
Marge Bot

parent
493e799398
commit
bc74d166dd
@ -3043,7 +3043,8 @@ meta_window_can_tile_maximized (MetaWindow *window)
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_window_can_tile_side_by_side (MetaWindow *window)
|
||||
meta_window_can_tile_side_by_side (MetaWindow *window,
|
||||
int monitor_number)
|
||||
{
|
||||
MtkRectangle tile_area;
|
||||
MtkRectangle client_rect;
|
||||
@ -3051,9 +3052,7 @@ meta_window_can_tile_side_by_side (MetaWindow *window)
|
||||
if (!meta_window_can_tile_maximized (window))
|
||||
return FALSE;
|
||||
|
||||
meta_window_get_work_area_for_monitor (window,
|
||||
window->monitor->number,
|
||||
&tile_area);
|
||||
meta_window_get_work_area_for_monitor (window, monitor_number, &tile_area);
|
||||
|
||||
/* Do not allow tiling in portrait orientation */
|
||||
if (tile_area.height > tile_area.width)
|
||||
|
Reference in New Issue
Block a user