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
This commit is contained in:
Rui Matos 2011-08-27 21:15:19 +01:00
parent bf175e72ad
commit c39129b6e8
2 changed files with 10 additions and 2 deletions

View File

@ -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

View File

@ -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) && \