devdraw: full-screen cleanup
This commit is contained in:
parent
e601e525de
commit
c155dcfeb7
3 changed files with 16 additions and 1 deletions
|
|
@ -101,6 +101,7 @@ extern char* _xgetsnarf(void);
|
||||||
extern void _xputsnarf(char *data);
|
extern void _xputsnarf(char *data);
|
||||||
extern void _xtopwindow(void);
|
extern void _xtopwindow(void);
|
||||||
extern void _xresizewindow(Rectangle);
|
extern void _xresizewindow(Rectangle);
|
||||||
|
extern void _xmovewindow(Rectangle);
|
||||||
extern int _xreplacescreenimage(void);
|
extern int _xreplacescreenimage(void);
|
||||||
|
|
||||||
#define MouseMask (\
|
#define MouseMask (\
|
||||||
|
|
|
||||||
|
|
@ -536,7 +536,7 @@ runxevent(XEvent *xev)
|
||||||
XLookupString((XKeyEvent*)xev, NULL, 0, &k, NULL);
|
XLookupString((XKeyEvent*)xev, NULL, 0, &k, NULL);
|
||||||
if(k == XK_F11){
|
if(k == XK_F11){
|
||||||
fullscreen = !fullscreen;
|
fullscreen = !fullscreen;
|
||||||
_xresizewindow(fullscreen ? screenrect : windowrect);
|
_xmovewindow(fullscreen ? screenrect : windowrect);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if((c = _xtoplan9kbd(xev)) < 0)
|
if((c = _xtoplan9kbd(xev)) < 0)
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,20 @@ _xresizewindow(Rectangle r)
|
||||||
XWindowChanges e;
|
XWindowChanges e;
|
||||||
int value_mask;
|
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);
|
memset(&e, 0, sizeof e);
|
||||||
value_mask = CWX|CWY|CWWidth|CWHeight;
|
value_mask = CWX|CWY|CWWidth|CWHeight;
|
||||||
e.x = r.min.x;
|
e.x = r.min.x;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue