Skip to content

Commit d30b0b0

Browse files
committed
tiling: Treat a maximized window as tiled for the purposes of
determining whether or not to save the window's original position and size. Windows that are maximized via tiling shortcuts are META_TILE_MAXIMIZED, but those maximized using other methods were getting missed and their original save position was being overwritten when moving from maximized to tiled via shortcut. ref: linuxmint/mint21-beta#75
1 parent c3d2ef2 commit d30b0b0

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/core/keybindings.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3510,14 +3510,6 @@ handle_tile_action (MetaDisplay *display,
35103510
else if (can_tile (window, new_mode))
35113511
{
35123512
window->tile_monitor_number = window->monitor->number;
3513-
/* Maximization constraints beat tiling constraints, so if the window
3514-
* is maximized, tiling won't have any effect unless we unmaximize it
3515-
* horizontally first; rather than calling meta_window_unmaximize(),
3516-
* we just set the flag and rely on meta_window_tile() syncing it to
3517-
* save an additional roundtrip.
3518-
*/
3519-
window->maximized_horizontally = FALSE;
3520-
window->maximized_vertically = FALSE;
35213513
meta_window_tile (window, new_mode);
35223514
}
35233515
}

src/core/window.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3403,7 +3403,15 @@ meta_window_tile (MetaWindow *window,
34033403
{
34043404
MetaMaximizeFlags directions;
34053405
MetaRectangle old_frame_rect, old_buffer_rect;
3406-
gboolean was_already_tiled = window->tile_mode != META_TILE_NONE;
3406+
gboolean was_already_tiled = window->tile_mode != META_TILE_NONE || META_WINDOW_MAXIMIZED (window);
3407+
/* Maximization constraints beat tiling constraints, so if the window
3408+
* is maximized, tiling won't have any effect unless we unmaximize it
3409+
* horizontally first; rather than calling meta_window_unmaximize(),
3410+
* we just set the flag and rely on meta_window_tile() syncing it to
3411+
* save an additional roundtrip.
3412+
*/
3413+
window->maximized_horizontally = FALSE;
3414+
window->maximized_vertically = FALSE;
34073415

34083416
meta_window_get_tile_fractions (window, tile_mode, &window->tile_hfraction, &window->tile_vfraction);
34093417
window->tile_mode = tile_mode;

0 commit comments

Comments
 (0)