about summary refs log tree commit diff stats
path: root/main.c
diff options
context:
space:
mode:
authorAnselm R. Garbe <garbeam@gmail.com>2007-08-19 18:39:54 +0200
committerAnselm R. Garbe <garbeam@gmail.com>2007-08-19 18:39:54 +0200
commitfc109ea8f72e662ed58ef45329b6ca9e91d61d3b (patch)
treeb9151a8d6abf70dd33b232d265304c5ec1c9e666 /main.c
parentb975c4728046052a32626378df193217a96fbefc (diff)
downloaddwm-fc109ea8f72e662ed58ef45329b6ca9e91d61d3b.tar.gz
fixed misappearance of iconified windows on SIGKILL
Diffstat (limited to 'main.c')
-rw-r--r--main.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/main.c b/main.c
index b56e333..79b301d 100644
--- a/main.c
+++ b/main.c
@@ -111,6 +111,24 @@ initfont(const char *fontstr) {
 	dc.font.height = dc.font.ascent + dc.font.descent;
 }
 
+static long
+getstate(Window w) {
+	int format, status;
+	long result = -1;
+	unsigned char *p = NULL;
+	unsigned long n, extra;
+	Atom real;
+
+	status = XGetWindowProperty(dpy, w, wmatom[WMState], 0L, 2L, False, wmatom[WMState],
+			&real, &format, &n, &extra, (unsigned char **)&p);
+	if(status != Success)
+		return -1;
+	if(n != 0)
+		result = *p;
+	XFree(p);
+	return result;
+}
+
 static void
 scan(void) {
 	unsigned int i, num;
@@ -123,7 +141,14 @@ scan(void) {
 			if(!XGetWindowAttributes(dpy, wins[i], &wa)
 			|| wa.override_redirect || XGetTransientForHint(dpy, wins[i], &d1))
 				continue;
-			if(wa.map_state == IsViewable)
+			if(wa.map_state == IsViewable || getstate(wins[i]) == IconicState)
+				manage(wins[i], &wa);
+		}
+		for(i = 0; i < num; i++) { /* now the transients */
+			if(!XGetWindowAttributes(dpy, wins[i], &wa))
+				continue;
+			if(XGetTransientForHint(dpy, wins[i], &d1)
+			&& (wa.map_state == IsViewable || getstate(wins[i]) == IconicState))
 				manage(wins[i], &wa);
 		}
 	}
ranger.py?h=v1.5.0&id=cba63cf3683d4ca532efd179005e2ac1f6c60e38'>cba63cf3 ^
ce9e6572 ^
8fa87054 ^


a66c4a26 ^

f027adc0 ^
08f08fb9 ^


fe7f8ca0 ^
08f08fb9 ^





cba63cf3 ^
3de15ddd ^

cba63cf3 ^
b4250dbc ^

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