From c39129b6e88fbc3bc61196ad3cd91c2a8baca615 Mon Sep 17 00:00:00 2001 From: Rui Matos Date: Sat, 27 Aug 2011 21:15:19 +0100 Subject: [PATCH] tiling: for tiled maximization use the tile area as target size/position When using more than one monitor, tiled maximization can be triggered with the pointer in one monitor while most of the window area remains in another. This means that the maximization constraint would maximize the window into the wrong monitor as it uses the work area size/position as target. Fix this by using the current tile area as target size/position. https://bugzilla.gnome.org/show_bug.cgi?id=657519 --- src/core/constraints.c | 10 ++++++++-- src/core/window-private.h | 2 ++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/core/constraints.c b/src/core/constraints.c index 557a13f6b..6ceb336ac 100644 --- a/src/core/constraints.c +++ b/src/core/constraints.c @@ -805,8 +805,14 @@ constrain_maximization (MetaWindow *window, return TRUE; /* Calculate target_size = maximized size of (window + frame) */ - if (window->maximized_horizontally && window->maximized_vertically) - target_size = info->work_area_monitor; + if (META_WINDOW_TILED_MAXIMIZED (window)) + { + meta_window_get_current_tile_area (window, &target_size); + } + else if (META_WINDOW_MAXIMIZED (window)) + { + target_size = info->work_area_monitor; + } else { /* Amount of maximization possible in a single direction depends diff --git a/src/core/window-private.h b/src/core/window-private.h index 1d1ae91f7..8a5fd6258 100644 --- a/src/core/window-private.h +++ b/src/core/window-private.h @@ -425,6 +425,8 @@ struct _MetaWindowClass (w)->tile_mode == META_TILE_LEFT) #define META_WINDOW_TILED_RIGHT(w) (META_WINDOW_TILED_SIDE_BY_SIDE(w) && \ (w)->tile_mode == META_TILE_RIGHT) +#define META_WINDOW_TILED_MAXIMIZED(w)(META_WINDOW_MAXIMIZED(w) && \ + (w)->tile_mode == META_TILE_MAXIMIZED) #define META_WINDOW_ALLOWS_MOVE(w) ((w)->has_move_func && !(w)->fullscreen) #define META_WINDOW_ALLOWS_RESIZE_EXCEPT_HINTS(w) ((w)->has_resize_func && !META_WINDOW_MAXIMIZED (w) && !META_WINDOW_TILED_SIDE_BY_SIDE(w) && !(w)->fullscreen && !(w)->shaded) #define META_WINDOW_ALLOWS_RESIZE(w) (META_WINDOW_ALLOWS_RESIZE_EXCEPT_HINTS (w) && \