summaryrefslogtreecommitdiff
path: root/src/winwidget.c
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-05-03 11:00:28 +0200
committerDaniel Friesel <derf@finalrewind.org>2011-05-03 11:00:28 +0200
commitbce956523f56b88ec04c074cd55041c5b9a81c90 (patch)
treee2e07db8b67cb398880e25f7af7cc3a1a713a90e /src/winwidget.c
parent031e00a6c97caf5df4fe5c18752a1e1ee3461364 (diff)
winwidget_resize: Only use netwm-fullscreen patch for fullscreen windows
Diffstat (limited to 'src/winwidget.c')
-rw-r--r--src/winwidget.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/winwidget.c b/src/winwidget.c
index ab5478d..b82b375 100644
--- a/src/winwidget.c
+++ b/src/winwidget.c
@@ -758,6 +758,10 @@ void winwidget_move(winwidget winwid, int x, int y)
void winwidget_resize(winwidget winwid, int w, int h)
{
+ Window ignored_window;
+ XWindowAttributes attributes;
+ int tc_x, tc_y;
+
if (opt.geom_flags) {
winwid->had_resize = 1;
return;
@@ -769,7 +773,18 @@ void winwidget_resize(winwidget winwid, int w, int h)
winwid->w = (w > scr->width) ? scr->width : w;
winwid->h = (h > scr->height) ? scr->height : h;
}
- XResizeWindow(disp, winwid->win, winwid->w, winwid->h);
+ if (winwid->fullscreen) {
+ XGetWindowAttributes(disp, winwid->win, &attributes);
+ XTranslateCoordinates(disp, winwid->win, attributes.root,
+ -attributes.border_width -
+ attributes.x,
+ -attributes.border_width - attributes.y, &tc_x, &tc_y, &ignored_window);
+ winwid->x = tc_x;
+ winwid->y = tc_y;
+ XMoveResizeWindow(disp, winwid->win, tc_x, tc_y, winwid->w, winwid->h);
+ } else
+ XResizeWindow(disp, winwid->win, winwid->w, winwid->h);
+
winwid->had_resize = 1;
XFlush(disp);