summaryrefslogtreecommitdiff
path: root/src/core/window-props.c
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-10-24 12:51:12 +0200
committerinfirit <[email protected]>2014-10-24 15:40:43 +0200
commitbcbc109d2801e2c8898ebb558febe99945358d53 (patch)
tree522610e98ac400a155030ddbda9f7045495dc47e /src/core/window-props.c
parent0ee6f6db3f405c13c88f75760f88296560cf9fd6 (diff)
downloadmarco-bcbc109d2801e2c8898ebb558febe99945358d53.tar.bz2
marco-bcbc109d2801e2c8898ebb558febe99945358d53.tar.xz
add support for _GTK_FRAME_EXTENTS
Support for _GTK_FRAME_EXTENTS are based on mutter. Based on metacity commit: e132e2a700c4b50c93eae064d8fd1769b67baf06 By: Alberts Muktupāvels <[email protected]>
Diffstat (limited to 'src/core/window-props.c')
-rw-r--r--src/core/window-props.c56
1 files changed, 55 insertions, 1 deletions
diff --git a/src/core/window-props.c b/src/core/window-props.c
index 3e870bc6..9aab46ea 100644
--- a/src/core/window-props.c
+++ b/src/core/window-props.c
@@ -215,12 +215,66 @@ reload_kwm_win_icon (MetaWindow *window,
reload_icon (window, window->display->atom__KWM_WIN_ICON);
}
+static gboolean
+gtk_border_equal (GtkBorder *a,
+ GtkBorder *b)
+{
+ return (a->left == b->left &&
+ a->right == b->right &&
+ a->top == b->top &&
+ a->bottom == b->bottom);
+}
+
+static void
+meta_window_set_custom_frame_extents (MetaWindow *window,
+ GtkBorder *extents)
+{
+ if (extents)
+ {
+ if (window->has_custom_frame_extents && gtk_border_equal (&window->custom_frame_extents, extents))
+ return;
+
+ window->has_custom_frame_extents = TRUE;
+ window->custom_frame_extents = *extents;
+ }
+ else
+ {
+ if (!window->has_custom_frame_extents)
+ return;
+
+ window->has_custom_frame_extents = FALSE;
+ memset (&window->custom_frame_extents, 0, sizeof (window->custom_frame_extents));
+ }
+
+ meta_window_queue (window, META_QUEUE_MOVE_RESIZE);
+}
+
static void
reload_gtk_frame_extents (MetaWindow *window,
MetaPropValue *value,
gboolean initial)
{
- return;
+ if (value->type != META_PROP_VALUE_INVALID)
+ {
+ if (value->v.cardinal_list.n_cardinals != 4)
+ {
+ meta_verbose ("_GTK_FRAME_EXTENTS on %s has %d values instead of 4\n",
+ window->desc, value->v.cardinal_list.n_cardinals);
+ }
+ else
+ {
+ GtkBorder extents;
+ extents.left = (int)value->v.cardinal_list.cardinals[0];
+ extents.right = (int)value->v.cardinal_list.cardinals[1];
+ extents.top = (int)value->v.cardinal_list.cardinals[2];
+ extents.bottom = (int)value->v.cardinal_list.cardinals[3];
+ meta_window_set_custom_frame_extents (window, &extents);
+ }
+ }
+ else
+ {
+ meta_window_set_custom_frame_extents (window, NULL);
+ }
}
static void