about summary refs log tree commit diff stats
path: root/client.c
diff options
context:
space:
mode:
Diffstat (limited to 'client.c')
-rw-r--r--client.c50
1 files changed, 30 insertions, 20 deletions
diff --git a/client.c b/client.c
index c11d5d5..b1b1417 100644
--- a/client.c
+++ b/client.c
@@ -44,6 +44,24 @@ update_name(Client *c)
 }
 
 void
+update_size(Client *c)
+{
+	XSizeHints size;
+	long msize;
+	if(!XGetWMNormalHints(dpy, c->win, &size, &msize) || !size.flags)
+		size.flags = PSize;
+	c->flags = size.flags;
+	c->basew = size.base_width;
+	c->baseh = size.base_height;
+	c->incw = size.width_inc;
+	c->inch = size.height_inc;
+	c->maxw = size.max_width;
+	c->maxh = size.max_height;
+	c->minw = size.min_width;
+	c->minh = size.min_height;
+}
+
+void
 focus(Client *c)
 {
 	Client **l;
@@ -62,31 +80,24 @@ manage(Window w, XWindowAttributes *wa)
 {
 	Client *c, **l;
 	XSetWindowAttributes twa;
-	long msize;
 
 	c = emallocz(sizeof(Client));
 	c->win = w;
-	c->r[RFloat].x = wa->x;
-	c->r[RFloat].y = wa->y;
-	c->r[RFloat].width = wa->width;
-	c->r[RFloat].height = wa->height;
+	c->x = wa->x;
+	c->y = wa->y;
+	c->w = wa->width;
+	c->h = wa->height;
+	update_size(c);
 	XSetWindowBorderWidth(dpy, c->win, 1);
 	XSelectInput(dpy, c->win, CLIENT_MASK);
 	XGetTransientForHint(dpy, c->win, &c->trans);
-	if(!XGetWMNormalHints(dpy, c->win, &c->size, &msize) || !c->size.flags)
-		c->size.flags = PSize;
-	c->fixedsize =
-		(c->size.flags & PMinSize && c->size.flags & PMaxSize
-		 && c->size.min_width == c->size.max_width
-		 && c->size.min_height == c->size.max_height);
 	update_name(c);
 	twa.override_redirect = 1;
 	twa.background_pixmap = ParentRelative;
 	twa.event_mask = ExposureMask;
 
-	c->title = XCreateWindow(dpy, root, c->r[RFloat].x, c->r[RFloat].y,
-			c->r[RFloat].width, barrect.height, 0,
-			DefaultDepth(dpy, screen), CopyFromParent,
+	c->title = XCreateWindow(dpy, root, c->x, c->y, c->w, barrect.height,
+			0, DefaultDepth(dpy, screen), CopyFromParent,
 			DefaultVisual(dpy, screen),
 			CWOverrideRedirect | CWBackPixmap | CWEventMask, &twa);
 
@@ -110,15 +121,14 @@ resize(Client *c)
 {
 	XConfigureEvent e;
 
-	XMoveResizeWindow(dpy, c->win, c->r[RFloat].x, c->r[RFloat].y,
-			c->r[RFloat].width, c->r[RFloat].height);
+	XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h);
 	e.type = ConfigureNotify;
 	e.event = c->win;
 	e.window = c->win;
-	e.x = c->r[RFloat].x;
-	e.y = c->r[RFloat].y;
-	e.width = c->r[RFloat].width;
-	e.height = c->r[RFloat].height;
+	e.x = c->x;
+	e.y = c->y;
+	e.width = c->w;
+	e.height = c->h;
 	e.border_width = 0;
 	e.above = None;
 	e.override_redirect = False;
458025a5b9f5087168f258933f0ccd9'>17d39ee ^
650a1fb ^
3d48f33 ^

1076f2b

4d55eee ^
db876f9 ^
dbf7e03 ^

4d55eee ^

17d39ee ^
0235a84 ^
4d55eee ^


dbf7e03 ^

4d55eee ^
dbf7e03 ^
4d55eee ^


dbf7e03 ^
ad4962c ^
4d55eee ^
dbf7e03 ^

4d55eee ^



dc5c070 ^

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
47
48
49
50
51
52
53
54
55
56
57
58
59
60