summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorAnselm R. Garbe <arg@10kloc.org>2006-08-22 17:40:21 +0200
committerAnselm R. Garbe <arg@10kloc.org>2006-08-22 17:40:21 +0200
commit0ff80653d3c85715966de3c1fe76a8927ed8133d (patch)
treedb5707844942e185f32446d48f4e0c4c090d31f9 /main.c
parentremoved winprop (merged into getproto) (diff)
downloaddwm-0ff80653d3c85715966de3c1fe76a8927ed8133d.tar.gz
dwm-0ff80653d3c85715966de3c1fe76a8927ed8133d.zip
rearranged getproto
Diffstat (limited to 'main.c')
-rw-r--r--main.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/main.c b/main.c
index 6f60c9b..6da3ccd 100644
--- a/main.c
+++ b/main.c
@@ -92,19 +92,18 @@ Window root, barwin;
92int 92int
93getproto(Window w) 93getproto(Window w)
94{ 94{
95 int status, format, protos = 0; 95 int i, format, protos, status;
96 int i;
97 unsigned long extra, res; 96 unsigned long extra, res;
98 Atom *protocols, real; 97 Atom *protocols, real;
99 98
100 status = XGetWindowProperty(dpy, w, wmatom[WMProtocols], 0L, 20L, 99 protos = 0;
101 False, XA_ATOM, &real, &format, &res, &extra, (unsigned char **)&protocols); 100 status = XGetWindowProperty(dpy, w, wmatom[WMProtocols], 0L, 20L, False,
101 XA_ATOM, &real, &format, &res, &extra, (unsigned char **)&protocols);
102 if(status != Success || protocols == 0) 102 if(status != Success || protocols == 0)
103 return protos; 103 return protos;
104 for(i = 0; i < res; i++) { 104 for(i = 0; i < res; i++)
105 if(protocols[i] == wmatom[WMDelete]) 105 if(protocols[i] == wmatom[WMDelete])
106 protos |= PROTODELWIN; 106 protos |= PROTODELWIN;
107 }
108 free(protocols); 107 free(protocols);
109 return protos; 108 return protos;
110} 109}