main.c
changeset 734 6283adb1fcf2
parent 725 d99be681d502
child 737 f05da68014bd
equal deleted inserted replaced
733:1950833a5614 734:6283adb1fcf2
   170 	return -1;
   170 	return -1;
   171 }
   171 }
   172 
   172 
   173 /* extern */
   173 /* extern */
   174 
   174 
   175 int
       
   176 getproto(Window w) {
       
   177 	int i, format, protos, status;
       
   178 	unsigned long extra, res;
       
   179 	Atom *protocols, real;
       
   180 
       
   181 	protos = 0;
       
   182 	status = XGetWindowProperty(dpy, w, wmatom[WMProtocols], 0L, 20L, False,
       
   183 			XA_ATOM, &real, &format, &res, &extra, (unsigned char **)&protocols);
       
   184 	if(status != Success || protocols == 0)
       
   185 		return protos;
       
   186 	for(i = 0; i < res; i++)
       
   187 		if(protocols[i] == wmatom[WMDelete])
       
   188 			protos |= PROTODELWIN;
       
   189 	free(protocols);
       
   190 	return protos;
       
   191 }
       
   192 
       
   193 void
   175 void
   194 sendevent(Window w, Atom a, long value) {
   176 sendevent(Window w, Atom a, long value) {
   195 	XEvent e;
   177 	XEvent e;
   196 
   178 
   197 	e.type = ClientMessage;
   179 	e.type = ClientMessage;