summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Spilsbury <sam.spilsbury@canonical.com>2010-12-10 17:20:42 +0800
committerSam Spilsbury <sam.spilsbury@canonical.com>2010-12-10 17:20:42 +0800
commit05150cae0e2889a75e899719fcac8f34add16190 (patch)
treebb4fc66615103e04cb60fc5a52731ccd7b1ac176
parent495dee57662059ede2cefc7c6ac24fc0b26533ff (diff)
downloadunity-window-decorator-05150cae0e2889a75e899719fcac8f34add16190.tar.gz
unity-window-decorator-05150cae0e2889a75e899719fcac8f34add16190.tar.bz2
Fix button offset
-rw-r--r--src/metacity.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/metacity.c b/src/metacity.c
index a971a84..4be97c7 100644
--- a/src/metacity.c
+++ b/src/metacity.c
@@ -966,6 +966,8 @@ meta_get_button_position (decor_t *d,
MetaFrameGeometry fgeom;
MetaFrameFlags flags;
MetaTheme *theme;
+ MetaFrameStyle *frame_style;
+ MetaInvisibleGrabAreaProperties *invisible_grab_area_properties;
GdkRectangle clip;
#ifdef HAVE_METACITY_2_15_21
@@ -985,6 +987,14 @@ meta_get_button_position (decor_t *d,
meta_get_decoration_geometry (d, theme, &flags, &fgeom, &button_layout,
&clip);
+ frame_style = meta_theme_get_frame_style (theme, META_FRAME_TYPE_NORMAL, flags);
+
+ if (!frame_style)
+ return;
+
+ invisible_grab_area_properties =
+ meta_frame_style_get_invisible_grab_area_properties (frame_style);
+
switch (i) {
case BUTTON_MENU:
if (!meta_button_present (&button_layout, META_BUTTON_FUNCTION_MENU))
@@ -1079,6 +1089,10 @@ meta_get_button_position (decor_t *d,
*x += _win_extents.left + 4;
*y += _win_extents.top + 2;
}
+ else if (invisible_grab_area_properties)
+ {
+ *x += invisible_grab_area_properties->left;
+ }
return TRUE;
}