diff options
| author | Anselm R. Garbe <arg@10kloc.org> | 2006-08-22 17:40:21 +0200 |
|---|---|---|
| committer | Anselm R. Garbe <arg@10kloc.org> | 2006-08-22 17:40:21 +0200 |
| commit | 0ff80653d3c85715966de3c1fe76a8927ed8133d (patch) | |
| tree | db5707844942e185f32446d48f4e0c4c090d31f9 /main.c | |
| parent | removed winprop (merged into getproto) (diff) | |
| download | dwm-0ff80653d3c85715966de3c1fe76a8927ed8133d.tar.gz dwm-0ff80653d3c85715966de3c1fe76a8927ed8133d.zip | |
rearranged getproto
Diffstat (limited to '')
| -rw-r--r-- | main.c | 11 |
1 files changed, 5 insertions, 6 deletions
| @@ -92,19 +92,18 @@ Window root, barwin; | |||
| 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 | } |
