summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorSam Spilsbury <smspillaz@smspillaz-desktop.(none)>2010-04-02 20:54:57 +0800
committerSam Spilsbury <smspillaz@smspillaz-desktop.(none)>2010-04-02 20:54:57 +0800
commit2f545ec8a940695bc5d635ab9813d43bc3addf42 (patch)
tree0a54282e65eb615139ee1aa51c7783ab15b9b1b3 /gtk
parent6305cc8919345fa4fd1e70d9a9bacae40bd6b0a1 (diff)
downloadzcomp-2f545ec8a940695bc5d635ab9813d43bc3addf42.tar.gz
zcomp-2f545ec8a940695bc5d635ab9813d43bc3addf42.tar.bz2
Fix offset window buttons in 2D mode for both gtk and cairo
Diffstat (limited to 'gtk')
-rw-r--r--gtk/window-decorator/gtk-window-decorator.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/gtk/window-decorator/gtk-window-decorator.c b/gtk/window-decorator/gtk-window-decorator.c
index 3e597be..d66a76f 100644
--- a/gtk/window-decorator/gtk-window-decorator.c
+++ b/gtk/window-decorator/gtk-window-decorator.c
@@ -2998,9 +2998,19 @@ get_button_position (decor_t *d,
if (i > BUTTON_MENU)
return FALSE;
- *x = bpos[i].x + bpos[i].xw * width;
- *y = bpos[i].y + bpos[i].yh * height + bpos[i].yth *
- (titlebar_height - 17);
+ if (d->frame_window)
+ {
+ *x = bpos[i].x + bpos[i].xw * width + _win_extents.left + 4;
+ *y = bpos[i].y + bpos[i].yh * height + bpos[i].yth *
+ (titlebar_height - 17) + _win_extents.top + 2;
+ }
+ else
+ {
+ *x = bpos[i].x + bpos[i].xw * width;
+ *y = bpos[i].y + bpos[i].yh * height + bpos[i].yth *
+ (titlebar_height - 17);
+ }
+
*w = bpos[i].w + bpos[i].ww * width;
*h = bpos[i].h + bpos[i].hh * height + bpos[i].hth +
(titlebar_height - 17);
@@ -3316,6 +3326,12 @@ meta_get_button_position (decor_t *d,
*h = space->height;
#endif
+ if (d->frame_window)
+ {
+ *x += _win_extents.left + 4;
+ *y += _win_extents.top + 2;
+ }
+
return TRUE;
}