Blob


1 #include <u.h>
2 #include "x11-inc.h"
3 #include <libc.h>
4 #include <draw.h>
5 #include <memdraw.h>
6 #include "x11-memdraw.h"
8 void
9 drawtopwindow(void)
10 {
11 XMapRaised(_x.display, _x.drawable);
12 XFlush(_x.display);
13 /*
14 * Should not be using kbdcon since we're not running
15 * in the kbdproc, but this is necessary to make the keyboard
16 * take focus if the window is hidden when drawtopwindow
17 * is called. Let's hope that XSetInputFocus is only a write
18 * on the fd, and so it's okay to do even though the kbdproc
19 * is reading at the same time.
20 */
21 XSetInputFocus(_x.kbdcon, _x.drawable, RevertToPointerRoot,
22 CurrentTime);
23 XFlush(_x.kbdcon);
24 }
26 void
27 drawresizewindow(Rectangle r)
28 {
29 // XConfigureRequestEvent e;
30 XWindowChanges e;
31 int value_mask;
33 memset(&e, 0, sizeof e);
34 value_mask = CWWidth|CWHeight;
35 // e.x = r.min.x;
36 // e.y = r.min.y;
37 e.width = Dx(r);
38 e.height = Dy(r);
39 XConfigureWindow(_x.display, _x.drawable, value_mask, &e);
40 }