all repos — dwm @ 352e1b4c81d141cf60f98b38c93dd1fcd342c4a4

my dwm build

removed winprop (merged into getproto)
Anselm R. Garbe arg@10kloc.org
Tue, 22 Aug 2006 17:38:59 +0200
commit

352e1b4c81d141cf60f98b38c93dd1fcd342c4a4

parent

aa13727067af829b94461eb36aa029297ed8e6b9

1 files changed, 7 insertions(+), 27 deletions(-)

jump to
M main.cmain.c

@@ -62,25 +62,6 @@ if(wins)

XFree(wins); } -static int -winprop(Window w, Atom a, Atom t, long l, unsigned char **prop) -{ - int status, format; - unsigned long res, extra; - Atom real; - - status = XGetWindowProperty(dpy, w, a, 0L, l, False, t, &real, &format, - &res, &extra, prop); - - if(status != Success || *prop == 0) { - return 0; - } - if(res == 0) { - free((void *) *prop); - } - return res; -} - /* * Startup Error handler to check if another window manager * is already running.

@@ -111,21 +92,20 @@

int getproto(Window w) { - int protos = 0; + int status, format, protos = 0; int i; - long res; - Atom *protocols; + unsigned long extra, res; + Atom *protocols, real; - res = winprop(w, wmatom[WMProtocols], XA_ATOM, 20L, - ((unsigned char **)&protocols)); - if(res <= 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((char *) protocols); + free(protocols); return protos; }