aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/devdraw/x11-wsys.c
blob: 9095c950d09f42ca5ebdc774b2c9b64f7a03f09b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include <u.h>
#include "x11-inc.h"
#include <libc.h>
#include <draw.h>
#include <memdraw.h>
#include "x11-memdraw.h"

void
_xtopwindow(void)
{
	XMapRaised(_x.display, _x.drawable);
	XSetInputFocus(_x.display, _x.drawable, RevertToPointerRoot,
		CurrentTime);
	XFlush(_x.display);
}

void
_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;
	e.y = r.min.y;
	e.width = Dx(r);
	e.height = Dy(r);
	XConfigureWindow(_x.display, _x.drawable, value_mask, &e);
	XFlush(_x.display);
}