dwm-meillo

diff main.c @ 329:cea0c98495bc

rearranged getproto
author Anselm R. Garbe <arg@10kloc.org>
date Tue, 22 Aug 2006 17:40:21 +0200
parents 083f1f3e1e93
children 827f8f6c9e97
line diff
     1.1 --- a/main.c	Tue Aug 22 17:38:59 2006 +0200
     1.2 +++ b/main.c	Tue Aug 22 17:40:21 2006 +0200
     1.3 @@ -92,19 +92,18 @@
     1.4  int
     1.5  getproto(Window w)
     1.6  {
     1.7 -	int status, format, protos = 0;
     1.8 -	int i;
     1.9 +	int i, format, protos, status;
    1.10  	unsigned long extra, res;
    1.11  	Atom *protocols, real;
    1.12  
    1.13 -	status = XGetWindowProperty(dpy, w, wmatom[WMProtocols], 0L, 20L,
    1.14 -			False, XA_ATOM, &real, &format, &res, &extra, (unsigned char **)&protocols);
    1.15 +	protos = 0;
    1.16 +	status = XGetWindowProperty(dpy, w, wmatom[WMProtocols], 0L, 20L, False,
    1.17 +			XA_ATOM, &real, &format, &res, &extra, (unsigned char **)&protocols);
    1.18  	if(status != Success || protocols == 0)
    1.19  		return protos;
    1.20 -	for(i = 0; i < res; i++) {
    1.21 +	for(i = 0; i < res; i++)
    1.22  		if(protocols[i] == wmatom[WMDelete])
    1.23  			protos |= PROTODELWIN;
    1.24 -	}
    1.25  	free(protocols);
    1.26  	return protos;
    1.27  }