summaryrefslogtreecommitdiff
path: root/src/core/window-private.h
diff options
context:
space:
mode:
authorOmar Zeidan <[email protected]>2017-12-02 20:19:12 +0100
committerraveit65 <[email protected]>2017-12-20 20:42:12 +0100
commitb471b912d68a05711a95a3c0e033c0577262f18e (patch)
treec5af5d07d112d219e7cd7db6ddabcfe12308b4d0 /src/core/window-private.h
parentd094cf0297f28b826ca742379750567750dfee9f (diff)
downloadmarco-b471b912d68a05711a95a3c0e033c0577262f18e.tar.bz2
marco-b471b912d68a05711a95a3c0e033c0577262f18e.tar.xz
Implemented simple corner tiling by mouse drag
Diffstat (limited to 'src/core/window-private.h')
-rw-r--r--src/core/window-private.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/core/window-private.h b/src/core/window-private.h
index e775a59e..8ab35718 100644
--- a/src/core/window-private.h
+++ b/src/core/window-private.h
@@ -145,7 +145,7 @@ struct _MetaWindow
/* 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;
+ guint tile_mode : 3;
guint tile_resized : 1;
/* The last "full" maximized/unmaximized state. We need to keep track of
@@ -401,20 +401,26 @@ 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 && \
+#define META_WINDOW_SIDE_TILED(w) ((w)->maximized_vertically && \
!(w)->maximized_horizontally && \
(w)->tile_mode != META_TILE_NONE)
-#define META_WINDOW_TILED_LEFT(w) (META_WINDOW_TILED(w) && \
+#define META_WINDOW_TILED_LEFT(w) (META_WINDOW_SIDE_TILED(w) && \
(w)->tile_mode == META_TILE_LEFT)
-#define META_WINDOW_TILED_RIGHT(w) (META_WINDOW_TILED(w) && \
+#define META_WINDOW_TILED_RIGHT(w) (META_WINDOW_SIDE_TILED(w) && \
(w)->tile_mode == META_TILE_RIGHT)
+#define META_WINDOW_QUARTER_TILED(w) (!(w)->maximized_vertically && \
+ !(w)->maximized_horizontally && \
+ ((w)->tile_mode == META_TILE_BOTTOM_RIGHT || \
+ (w)->tile_mode == META_TILE_BOTTOM_LEFT || \
+ (w)->tile_mode == META_TILE_TOP_RIGHT || \
+ (w)->tile_mode == META_TILE_TOP_LEFT))
#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(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)))
#define META_WINDOW_ALLOWS_HORIZONTAL_RESIZE(w) (META_WINDOW_ALLOWS_RESIZE_EXCEPT_HINTS (w) && (w)->size_hints.min_width < (w)->size_hints.max_width)
-#define META_WINDOW_ALLOWS_VERTICAL_RESIZE(w) (META_WINDOW_ALLOWS_RESIZE_EXCEPT_HINTS (w) && !META_WINDOW_TILED(w) && (w)->size_hints.min_height < (w)->size_hints.max_height)
+#define META_WINDOW_ALLOWS_VERTICAL_RESIZE(w) (META_WINDOW_ALLOWS_RESIZE_EXCEPT_HINTS (w) && !META_WINDOW_SIDE_TILED(w) && (w)->size_hints.min_height < (w)->size_hints.max_height)
MetaWindow* meta_window_new (MetaDisplay *display,
Window xwindow,