about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--main.c34
1 files changed, 7 insertions, 27 deletions
diff --git a/main.c b/main.c
index a51ba88..6f60c9b 100644
--- a/main.c
+++ b/main.c
@@ -62,25 +62,6 @@ scan()
 		XFree(wins);
 }
 
-static int
-winprop(Window w, Atom a, Atom t, long l, unsigned char **prop)
-{
-	int status, format;
-	unsigned long res, extra;
-	Atom real;
-
-	status = XGetWindowProperty(dpy, w, a, 0L, l, False, t, &real, &format,
-			&res, &extra, prop);
-
-	if(status != Success || *prop == 0) {
-		return 0;
-	}
-	if(res == 0) {
-		free((void *) *prop);
-	}
-	return res;
-}
-
 /*
  * Startup Error handler to check if another window manager
  * is already running.
@@ -111,21 +92,20 @@ Window root, barwin;
 int
 getproto(Window w)
 {
-	int protos = 0;
+	int status, format, protos = 0;
 	int i;
-	long res;
-	Atom *protocols;
+	unsigned long extra, res;
+	Atom *protocols, real;
 
-	res = winprop(w, wmatom[WMProtocols], XA_ATOM, 20L,
-			((unsigned char **)&protocols));
-	if(res <= 0) {
+	status = XGetWindowProperty(dpy, w, wmatom[WMProtocols], 0L, 20L,
+			False, XA_ATOM, &real, &format, &res, &extra, (unsigned char **)&protocols);
+	if(status != Success || protocols == 0)
 		return protos;
-	}
 	for(i = 0; i < res; i++) {
 		if(protocols[i] == wmatom[WMDelete])
 			protos |= PROTODELWIN;
 	}
-	free((char *) protocols);
+	free(protocols);
 	return protos;
 }
 
me/update_html?h=hlt&id=5ccf2653fb7d31b013f77df4e92e964e45c54f8a'>^
cdf28227 ^
f5465e12 ^
e4ac3c9e ^


2564eb6f ^

f5465e12 ^
08a0eed6 ^

ccae4585 ^





f5465e12 ^


a220427e ^

































08a0eed6 ^







ac07e589 ^


08a0eed6 ^




a220427e ^







c762564b ^
9a7e1a0f ^
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99