# HG changeset patch # User Anselm R. Garbe # Date 1156261221 -7200 # Node ID cea0c98495bc5f52ab3d6d3a3b5de86c7b5972e7 # Parent 083f1f3e1e935c8994715d38cc0abd40df1d280d rearranged getproto diff -r 083f1f3e1e93 -r cea0c98495bc main.c --- a/main.c Tue Aug 22 17:38:59 2006 +0200 +++ b/main.c Tue Aug 22 17:40:21 2006 +0200 @@ -92,19 +92,18 @@ 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; }