diff options
author | Stefano Karapetsas <[email protected]> | 2013-05-31 16:22:39 +0200 |
---|---|---|
committer | Stefano Karapetsas <[email protected]> | 2013-05-31 16:22:39 +0200 |
commit | a87157176ca6e01c8c4047999ee584f00b63c11e (patch) | |
tree | 80e928a800b4b54f6831a6b38a952014c7f5ae5c /src/core/window-private.h | |
parent | cc760e2586cd0f98f8c60382ab8ff1f7373d9c1d (diff) | |
download | marco-a87157176ca6e01c8c4047999ee584f00b63c11e.tar.bz2 marco-a87157176ca6e01c8c4047999ee584f00b63c11e.tar.xz |
Implement side-by-side tiling
Patch by Florian Müllner for Metacity
https://bugzilla.gnome.org/show_bug.cgi?id=607694
When dragging a window over a screen edge and dropping it there,
maximize it vertically and scale it horizontally to cover the
corresponding half of the current monitor.
Whenever a "hot area" which triggers this behavior is entered, an
indication of window's target size is displayed after a short delay
to avoid distraction when moving a window between monitors.
Diffstat (limited to 'src/core/window-private.h')
-rw-r--r-- | src/core/window-private.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/core/window-private.h b/src/core/window-private.h index 447a2c4b..02c518e0 100644 --- a/src/core/window-private.h +++ b/src/core/window-private.h @@ -83,6 +83,12 @@ typedef enum { #define NUMBER_OF_QUEUES 3 +typedef enum { + META_TILE_NONE, + META_TILE_LEFT, + META_TILE_RIGHT +} MetaTileMode; + struct _MetaWindow { MetaDisplay *display; @@ -138,6 +144,11 @@ struct _MetaWindow guint maximize_vertically_after_placement : 1; guint minimize_after_placement : 1; + /* The current or requested tile mode. If maximized_vertically is true, + * this is the current mode. If not, it is the mode which will be + * requested after the window grab is released */ + guint tile_mode : 2; + /* Whether we're shaded */ guint shaded : 1; @@ -383,8 +394,11 @@ struct _MetaWindow (w)->maximized_vertically) #define META_WINDOW_MAXIMIZED_VERTICALLY(w) ((w)->maximized_vertically) #define META_WINDOW_MAXIMIZED_HORIZONTALLY(w) ((w)->maximized_horizontally) +#define META_WINDOW_TILED(w) ((w)->maximized_vertically && \ + !(w)->maximized_horizontally && \ + (w)->tile_mode != META_TILE_NONE) #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) && !(w)->fullscreen && !(w)->shaded) +#define META_WINDOW_ALLOWS_RESIZE_EXCEPT_HINTS(w) ((w)->has_resize_func && !META_WINDOW_MAXIMIZED (w) && !META_WINDOW_TILED(w) && !(w)->fullscreen && !(w)->shaded) #define META_WINDOW_ALLOWS_RESIZE(w) (META_WINDOW_ALLOWS_RESIZE_EXCEPT_HINTS (w) && \ (((w)->size_hints.min_width < (w)->size_hints.max_width) || \ ((w)->size_hints.min_height < (w)->size_hints.max_height))) @@ -575,6 +589,8 @@ void meta_window_get_work_area_for_xinerama (MetaWindow *window, void meta_window_get_work_area_all_xineramas (MetaWindow *window, MetaRectangle *area); +void meta_window_get_current_tile_area (MetaWindow *window, + MetaRectangle *tile_area); gboolean meta_window_same_application (MetaWindow *window, MetaWindow *other_window); |