From 3bfcb6d1b9d2c2717176e3a6e3be19d315810d42 Mon Sep 17 00:00:00 2001 From: Uzair Ahmad Date: Sun, 20 Aug 2023 01:32:16 -0400 Subject: [PATCH] window: Fix portrait orientation check for tiling Use work area from the monitor that the window is currently on to determine if tiling should be allowed. Window tiling is disabled for monitors with portrait orientation, but the work area we use to detect portrait orientation is taken from the monitor that currently has the mouse pointer. This works fine for edge tiling using the mouse, but this is broken when using keybindings for window tiling because your mouse pointer could be on a different monitor that has horizontal orientation. Part-of: --- src/core/window.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/window.c b/src/core/window.c index 8a5dd4222..87bb0a6fa 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -3045,15 +3045,15 @@ meta_window_can_tile_maximized (MetaWindow *window) gboolean meta_window_can_tile_side_by_side (MetaWindow *window) { - int monitor; MtkRectangle tile_area; MtkRectangle client_rect; if (!meta_window_can_tile_maximized (window)) return FALSE; - monitor = meta_display_get_current_monitor (window->display); - meta_window_get_work_area_for_monitor (window, monitor, &tile_area); + meta_window_get_work_area_for_monitor (window, + window->monitor->number, + &tile_area); /* Do not allow tiling in portrait orientation */ if (tile_area.height > tile_area.width)