diff options
-rw-r--r-- | src/cmd/devdraw/x11-memdraw.h | 1 | ||||
-rw-r--r-- | src/cmd/devdraw/x11-srv.c | 2 | ||||
-rw-r--r-- | src/cmd/devdraw/x11-wsys.c | 14 |
3 files changed, 16 insertions, 1 deletions
diff --git a/src/cmd/devdraw/x11-memdraw.h b/src/cmd/devdraw/x11-memdraw.h index a5b40671..d2cab13b 100644 --- a/src/cmd/devdraw/x11-memdraw.h +++ b/src/cmd/devdraw/x11-memdraw.h @@ -101,6 +101,7 @@ extern char* _xgetsnarf(void); extern void _xputsnarf(char *data); extern void _xtopwindow(void); extern void _xresizewindow(Rectangle); +extern void _xmovewindow(Rectangle); extern int _xreplacescreenimage(void); #define MouseMask (\ diff --git a/src/cmd/devdraw/x11-srv.c b/src/cmd/devdraw/x11-srv.c index 071cbc76..2035a068 100644 --- a/src/cmd/devdraw/x11-srv.c +++ b/src/cmd/devdraw/x11-srv.c @@ -536,7 +536,7 @@ runxevent(XEvent *xev) XLookupString((XKeyEvent*)xev, NULL, 0, &k, NULL); if(k == XK_F11){ fullscreen = !fullscreen; - _xresizewindow(fullscreen ? screenrect : windowrect); + _xmovewindow(fullscreen ? screenrect : windowrect); return; } if((c = _xtoplan9kbd(xev)) < 0) diff --git a/src/cmd/devdraw/x11-wsys.c b/src/cmd/devdraw/x11-wsys.c index bba7c350..9095c950 100644 --- a/src/cmd/devdraw/x11-wsys.c +++ b/src/cmd/devdraw/x11-wsys.c @@ -22,6 +22,20 @@ _xresizewindow(Rectangle r) memset(&e, 0, sizeof e); value_mask = CWX|CWY|CWWidth|CWHeight; + e.width = Dx(r); + e.height = Dy(r); + XConfigureWindow(_x.display, _x.drawable, value_mask, &e); + XFlush(_x.display); +} + +void +_xmovewindow(Rectangle r) +{ + XWindowChanges e; + int value_mask; + + memset(&e, 0, sizeof e); + value_mask = CWX|CWY|CWWidth|CWHeight; e.x = r.min.x; e.y = r.min.y; e.width = Dx(r); |