[mutter/wip/tiling: 6/6] frame: Don't allow resizing of edges that are constrained
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/tiling: 6/6] frame: Don't allow resizing of edges that are constrained
- Date: Wed, 1 Jul 2015 23:26:27 +0000 (UTC)
commit 60fd84f1f28bba539d299d0474562661ddd6576a
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Tue Jun 30 22:14:03 2015 -0700
frame: Don't allow resizing of edges that are constrained
src/core/frame.c | 12 ++++++++++++
src/meta/common.h | 6 +++++-
src/ui/theme.c | 13 ++++++++-----
3 files changed, 25 insertions(+), 6 deletions(-)
---
diff --git a/src/core/frame.c b/src/core/frame.c
index c4be91a..81e0e68 100644
--- a/src/core/frame.c
+++ b/src/core/frame.c
@@ -283,6 +283,18 @@ meta_frame_get_flags (MetaFrame *frame)
if (frame->window->wm_state_above)
flags |= META_FRAME_ABOVE;
+ if (frame->window->constrained_edges & META_DIRECTION_LEFT)
+ flags |= META_FRAME_CONSTRAINED_LEFT_EDGE;
+
+ if (frame->window->constrained_edges & META_DIRECTION_RIGHT)
+ flags |= META_FRAME_CONSTRAINED_RIGHT_EDGE;
+
+ if (frame->window->constrained_edges & META_DIRECTION_TOP)
+ flags |= META_FRAME_CONSTRAINED_TOP_EDGE;
+
+ if (frame->window->constrained_edges & META_DIRECTION_BOTTOM)
+ flags |= META_FRAME_CONSTRAINED_BOTTOM_EDGE;
+
return flags;
}
diff --git a/src/meta/common.h b/src/meta/common.h
index bf87b35..74f7386 100644
--- a/src/meta/common.h
+++ b/src/meta/common.h
@@ -83,7 +83,11 @@ typedef enum
META_FRAME_IS_FLASHING = 1 << 14,
META_FRAME_ABOVE = 1 << 15,
META_FRAME_TILED_LEFT = 1 << 16,
- META_FRAME_TILED_RIGHT = 1 << 17
+ META_FRAME_TILED_RIGHT = 1 << 17,
+ META_FRAME_CONSTRAINED_LEFT_EDGE = 1 << 18,
+ META_FRAME_CONSTRAINED_RIGHT_EDGE = 1 << 19,
+ META_FRAME_CONSTRAINED_TOP_EDGE = 1 << 20,
+ META_FRAME_CONSTRAINED_BOTTOM_EDGE = 1 << 21,
} MetaFrameFlags;
/**
diff --git a/src/ui/theme.c b/src/ui/theme.c
index be2460c..8711352 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -94,19 +94,22 @@ meta_frame_layout_get_borders (const MetaFrameLayout *layout,
if (flags & META_FRAME_ALLOWS_HORIZONTAL_RESIZE)
{
- borders->invisible.left = MAX (0, draggable_borders - borders->visible.left);
- borders->invisible.right = MAX (0, draggable_borders - borders->visible.right);
+ if (!(flags & META_FRAME_CONSTRAINED_LEFT_EDGE))
+ borders->invisible.left = MAX (0, draggable_borders - borders->visible.left);
+ if (!(flags & META_FRAME_CONSTRAINED_RIGHT_EDGE))
+ borders->invisible.right = MAX (0, draggable_borders - borders->visible.right);
}
if (flags & META_FRAME_ALLOWS_VERTICAL_RESIZE)
{
- borders->invisible.bottom = MAX (0, draggable_borders - borders->visible.bottom);
-
/* borders.visible.top is the height of the *title bar*. We can't do the same
* algorithm here, titlebars are expectedly much bigger. Just subtract a couple
* pixels to get a proper feel. */
- if (type != META_FRAME_TYPE_ATTACHED)
+ if (!(flags & META_FRAME_CONSTRAINED_TOP_EDGE) && type != META_FRAME_TYPE_ATTACHED)
borders->invisible.top = MAX (0, draggable_borders - 2);
+
+ if (!(flags & META_FRAME_CONSTRAINED_BOTTOM_EDGE))
+ borders->invisible.bottom = MAX (0, draggable_borders - borders->visible.bottom);
}
borders->total.left = borders->invisible.left + borders->visible.left;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]