From c155dcfeb74766db97c08d7a09cca4b42ba45f0f Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 30 Jan 2008 12:03:11 -0500 Subject: devdraw: full-screen cleanup --- src/cmd/devdraw/x11-memdraw.h | 1 + src/cmd/devdraw/x11-srv.c | 2 +- src/cmd/devdraw/x11-wsys.c | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) (limited to 'src') 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 @@ -20,6 +20,20 @@ _xresizewindow(Rectangle r) XWindowChanges e; int value_mask; + 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; -- cgit v1.2.3