2003-10-11 02:59:10 +00:00
|
|
|
#include <u.h>
|
2004-03-26 01:59:35 +00:00
|
|
|
#include "x11-inc.h"
|
2003-10-11 02:59:10 +00:00
|
|
|
#include <libc.h>
|
|
|
|
#include <draw.h>
|
|
|
|
#include <memdraw.h>
|
|
|
|
#include "x11-memdraw.h"
|
|
|
|
|
|
|
|
void
|
|
|
|
drawtopwindow(void)
|
|
|
|
{
|
2004-03-02 23:11:58 +00:00
|
|
|
XMapRaised(_x.display, _x.drawable);
|
|
|
|
XFlush(_x.display);
|
2005-01-07 18:44:21 +00:00
|
|
|
/*
|
|
|
|
* Should not be using kbdcon since we're not running
|
|
|
|
* in the kbdproc, but this is necessary to make the keyboard
|
|
|
|
* take focus if the window is hidden when drawtopwindow
|
|
|
|
* is called. Let's hope that XSetInputFocus is only a write
|
|
|
|
* on the fd, and so it's okay to do even though the kbdproc
|
|
|
|
* is reading at the same time.
|
|
|
|
*/
|
|
|
|
XSetInputFocus(_x.kbdcon, _x.drawable, RevertToPointerRoot,
|
2004-03-02 23:11:58 +00:00
|
|
|
CurrentTime);
|
2005-01-07 18:44:21 +00:00
|
|
|
XFlush(_x.kbdcon);
|
2003-10-11 02:59:10 +00:00
|
|
|
}
|
|
|
|
|
2004-04-29 17:13:24 +00:00
|
|
|
void
|
|
|
|
drawresizewindow(Rectangle r)
|
|
|
|
{
|
|
|
|
// XConfigureRequestEvent e;
|
|
|
|
XWindowChanges e;
|
|
|
|
int value_mask;
|
|
|
|
|
|
|
|
memset(&e, 0, sizeof e);
|
|
|
|
value_mask = CWWidth|CWHeight;
|
|
|
|
// e.x = r.min.x;
|
|
|
|
// e.y = r.min.y;
|
|
|
|
e.width = Dx(r);
|
|
|
|
e.height = Dy(r);
|
|
|
|
XConfigureWindow(_x.display, _x.drawable, value_mask, &e);
|
|
|
|
}
|