main.c
changeset 329 cea0c98495bc
parent 328 083f1f3e1e93
child 333 827f8f6c9e97
equal deleted inserted replaced
328:083f1f3e1e93 329:cea0c98495bc
    90 Window root, barwin;
    90 Window root, barwin;
    91 
    91 
    92 int
    92 int
    93 getproto(Window w)
    93 getproto(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 }
   111 
   110 
   112 void
   111 void