summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2021-05-27 07:16:39 -0400
committerraveit65 <[email protected]>2021-05-28 23:11:35 +0200
commit4ccf24665bfb3501e727f133a5f7c59ade2154d2 (patch)
tree4c4c4a449d5bd916a9b1242735ae261106fcc553 /src
parentfa2afbfd60443051e377193b52df54c080df7202 (diff)
downloadmarco-4ccf24665bfb3501e727f133a5f7c59ade2154d2.tar.bz2
marco-4ccf24665bfb3501e727f133a5f7c59ade2154d2.tar.xz
window: Track window rectangle before corner tiling
When corner-tiling a maximized window, we should keep track of the saved rectangle so that tiling does not reset our window size. Otherwise, untiling the previously maximized window will end up with an unmaximized full-size window, rather than the original window size.
Diffstat (limited to 'src')
-rw-r--r--src/core/window.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/core/window.c b/src/core/window.c
index c7bad1af..68ac89ab 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -2497,8 +2497,10 @@ ensure_size_hints_satisfied (MetaRectangle *rect,
static void
meta_window_save_rect (MetaWindow *window)
{
- if (!(META_WINDOW_MAXIMIZED (window) || META_WINDOW_SIDE_TILED (window) ||
- META_WINDOW_CORNER_TILED(window) || window->fullscreen))
+ if (!(META_WINDOW_MAXIMIZED (window) ||
+ META_WINDOW_SIDE_TILED (window) ||
+ META_WINDOW_CORNER_TILED(window) ||
+ window->fullscreen))
{
/* save size/pos as appropriate args for move_resize */
if (!window->maximized_horizontally)
@@ -2698,14 +2700,24 @@ meta_window_tile (MetaWindow *window)
if (window->tile_mode == META_TILE_NONE)
return;
- if(window->tile_mode == META_TILE_LEFT || window->tile_mode == META_TILE_RIGHT)
+ if (window->tile_mode == META_TILE_LEFT ||
+ window->tile_mode == META_TILE_RIGHT)
{
MetaRectangle *saved_rect = NULL;
saved_rect = &window->saved_rect;
meta_window_maximize_internal (window, META_MAXIMIZE_VERTICAL, saved_rect);
}
+ else if (window->tile_mode == META_TILE_BOTTOM_RIGHT ||
+ window->tile_mode == META_TILE_BOTTOM_LEFT ||
+ window->tile_mode == META_TILE_TOP_RIGHT ||
+ window->tile_mode == META_TILE_TOP_LEFT)
+ {
+ MetaRectangle *saved_rect = NULL;
+ saved_rect = &window->saved_rect;
+ meta_window_maximize_internal (window, META_MAXIMIZE_HORIZONTAL, saved_rect);
+ }
else
- meta_window_save_rect(window);
+ meta_window_save_rect (window);
window->tiled = TRUE;
/* move_resize with new tiling constraints