about summary refs log tree commit diff stats
path: root/event.c
diff options
context:
space:
mode:
Diffstat (limited to 'event.c')
-rw-r--r--event.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/event.c b/event.c
index e20a60a..fbce631 100644
--- a/event.c
+++ b/event.c
@@ -165,6 +165,7 @@ buttonpress(XEvent *e) {
 
 static void
 configurerequest(XEvent *e) {
+	int x, y, w, h;
 	Client *c;
 	XConfigureRequestEvent *ev = &e->xconfigurerequest;
 	XWindowChanges wc;
@@ -174,20 +175,24 @@ configurerequest(XEvent *e) {
 		if(ev->value_mask & CWBorderWidth)
 			c->border = ev->border_width;
 		if(c->isfixed || c->isfloat || (arrange == dofloat)) {
-			if(ev->value_mask & CWX)
-				c->x = ev->x;
-			if(ev->value_mask & CWY)
-				c->y = ev->y;
-			if(ev->value_mask & CWWidth)
-				c->w = ev->width;
-			if(ev->value_mask & CWHeight)
-				c->h = ev->height;
+			x = (ev->value_mask & CWX) ? ev->x : c->x;
+			y = (ev->value_mask & CWY) ? ev->y : c->y;
+			w = (ev->value_mask & CWWidth) ? ev->width : c->w;
+			h = (ev->value_mask & CWHeight) ? ev->height : c->h;
 			if((ev->value_mask & (CWX | CWY))
 			&& !(ev->value_mask & (CWWidth | CWHeight)))
+			{
+				c->x = x;
+				c->y = y;
 				configure(c);
-			resize(c, c->x, c->y, c->w, c->h, False);
-			if(!isvisible(c))
-				ban(c);
+				if(isvisible(c))
+					XMoveWindow(dpy, c->win, c->x, c->y);
+			}
+			else {
+				resize(c, x, y, w, h, False);
+				if(!isvisible(c))
+					ban(c);
+			}
 		}
 		else
 			configure(c);
9:06 +0000 Added priority properties to ProfAccount' href='/danisanti/profani-tty/commit/src/accounts.h?id=40bcaffa0cf1d819ffd1219df604c4d7b433e55e'>40bcaffa ^
df14a46d ^

ce6f2276 ^
4d9148e7 ^
ce6f2276 ^

6826a66f ^


5013cce8 ^



5cca57f6 ^
324a85a2 ^
ce6f2276 ^

c80383e2 ^



8415f57b ^


f6176b32 ^
be653667 ^
df14a46d ^

a9c629dd ^

e9225687 ^

8a69fffd ^




b397a8c5 ^

e9225687 ^
1c2661f1 ^
6826a66f ^

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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85