devdraw: full-screen cleanup
This commit is contained in:
parent
e601e525de
commit
c155dcfeb7
@ -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 (\
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user