summaryrefslogtreecommitdiff
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
parent352e1b4c81d141cf60f98b38c93dd1fcd342c4a4 (diff)
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;
int
getproto(Window w)
{
- int status, format, protos = 0;
- int i;
+ int i, format, protos, status;
unsigned long extra, res;
Atom *protocols, real;
- status = XGetWindowProperty(dpy, w, wmatom[WMProtocols], 0L, 20L,
- False, XA_ATOM, &real, &format, &res, &extra, (unsigned char **)&protocols);
+ protos = 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++) {
+ for(i = 0; i < res; i++)
if(protocols[i] == wmatom[WMDelete])
protos |= PROTODELWIN;
- }
free(protocols);
return protos;
}