edge-resistance: Add snapping for tiled windows

When windows are tiled, it improves the interaction with
them when they have a set of snapping edges relative to
the monitor. For example, when there's a document editor
and a PDF file opened, I might want to rescale the former
to 2/3 of the screen and the latter to 1/3.

These snapping sections are not really tied to any other
window, and only depend on the current work area of the
window. Thus, it is not necessary to adapt the current
snapping edge detection algorithm.

This patch adds the necessary code in edge-resistance.c
to special-case tiled windows and allow them to cover
1/4, 1/3 and 1/2 (horizontally) of the screen. These
values are hardcoded.

https://bugzilla.gnome.org/show_bug.cgi?id=645153
This commit is contained in:
Georges Basile Stavracas Neto
2017-06-13 18:30:10 -03:00
parent 6fe71ecc01
commit 1dbf6b096b
2 changed files with 47 additions and 3 deletions

View File

@@ -6256,7 +6256,7 @@ end_grab_op (MetaWindow *window,
else if (meta_grab_op_is_resizing (window->display->grab_op))
{
update_resize (window,
modifiers & CLUTTER_SHIFT_MASK,
modifiers & CLUTTER_SHIFT_MASK || window->tile_match != NULL,
x, y,
TRUE);
maybe_maximize_tiled_window (window);
@@ -6333,7 +6333,7 @@ meta_window_handle_mouse_grab_op_event (MetaWindow *window,
else if (meta_grab_op_is_resizing (window->display->grab_op))
{
update_resize (window,
modifier_state & CLUTTER_SHIFT_MASK,
modifier_state & CLUTTER_SHIFT_MASK || window->tile_match != NULL,
x, y,
FALSE);
}