summaryrefslogtreecommitdiff
path: root/src/core/window-private.h
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-10-24 21:59:58 +0200
committerinfirit <[email protected]>2014-10-27 12:29:24 +0100
commitbec068ef5ddc73f23ffd6298122bf818fd4d2084 (patch)
treed7db4682b85c601d069de72cf76dda77b8a5e8dc /src/core/window-private.h
parentf814451acc48aec6d2fa1c217468f74e57a84340 (diff)
downloadmarco-bec068ef5ddc73f23ffd6298122bf818fd4d2084.tar.bz2
marco-bec068ef5ddc73f23ffd6298122bf818fd4d2084.tar.xz
Rework tiling code based off Consortium
Taken from https://github.com/SolusOS-discontinued/consortium/commit/b463e03f5bdeab307ceee6b969c681f29537c76d
Diffstat (limited to 'src/core/window-private.h')
-rw-r--r--src/core/window-private.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/core/window-private.h b/src/core/window-private.h
index 882c8901..20e619cb 100644
--- a/src/core/window-private.h
+++ b/src/core/window-private.h
@@ -84,13 +84,6 @@ typedef enum {
#define NUMBER_OF_QUEUES 3
-typedef enum {
- META_TILE_NONE,
- META_TILE_LEFT,
- META_TILE_RIGHT,
- META_TILE_MAXIMIZE
-} MetaTileMode;
-
struct _MetaWindow
{
MetaDisplay *display;
@@ -151,6 +144,11 @@ struct _MetaWindow
* requested after the window grab is released */
guint tile_mode : 2;
+ /* The last "full" maximized/unmaximized state. We need to keep track of
+ * that to toggle between normal/tiled or maximized/tiled states. */
+ guint saved_maximize : 1;
+ int tile_monitor_number;
+
/* Whether we're shaded */
guint shaded : 1;
@@ -405,6 +403,10 @@ struct _MetaWindow
#define META_WINDOW_TILED(w) ((w)->maximized_vertically && \
!(w)->maximized_horizontally && \
(w)->tile_mode != META_TILE_NONE)
+#define META_WINDOW_TILED_LEFT(w) (META_WINDOW_TILED(w) && \
+ (w)->tile_mode == META_TILE_LEFT)
+#define META_WINDOW_TILED_RIGHT(w) (META_WINDOW_TILED(w) && \
+ (w)->tile_mode == META_TILE_RIGHT)
#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(w) && !(w)->fullscreen && !(w)->shaded)
#define META_WINDOW_ALLOWS_RESIZE(w) (META_WINDOW_ALLOWS_RESIZE_EXCEPT_HINTS (w) && \
@@ -425,6 +427,7 @@ void meta_window_free (MetaWindow *window,
void meta_window_calc_showing (MetaWindow *window);
void meta_window_queue (MetaWindow *window,
guint queuebits);
+void meta_window_tile (MetaWindow *window);
void meta_window_minimize (MetaWindow *window);
void meta_window_unminimize (MetaWindow *window);
void meta_window_maximize (MetaWindow *window,
@@ -663,4 +666,6 @@ gboolean meta_window_is_client_decorated (MetaWindow *window);
void meta_window_update_role (MetaWindow *window);
void meta_window_update_net_wm_type (MetaWindow *window);
+gboolean meta_window_can_tile (MetaWindow *window);
+
#endif