replaced getproto with a saner function, now old-school artifacts of WM times in the early 90s completely disappeared, no punned pointer warning anymore ;)
This commit is contained in:
parent
44ef3f5a07
commit
28ffff801b
5 changed files with 20 additions and 31 deletions
18
main.c
18
main.c
|
@ -172,24 +172,6 @@ xerrorstart(Display *dsply, XErrorEvent *ee) {
|
|||
|
||||
/* extern */
|
||||
|
||||
int
|
||||
getproto(Window w) {
|
||||
int i, format, protos, status;
|
||||
unsigned long extra, res;
|
||||
Atom *protocols, real;
|
||||
|
||||
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++)
|
||||
if(protocols[i] == wmatom[WMDelete])
|
||||
protos |= PROTODELWIN;
|
||||
free(protocols);
|
||||
return protos;
|
||||
}
|
||||
|
||||
void
|
||||
sendevent(Window w, Atom a, long value) {
|
||||
XEvent e;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue