rearranged getproto
0ff80653
1 file(s) · +5 −6
| 92 | 92 | int |
|
| 93 | 93 | getproto(Window w) |
|
| 94 | 94 | { |
|
| 95 | - | int status, format, protos = 0; |
|
| 96 | - | int i; |
|
| 95 | + | int i, format, protos, status; |
|
| 97 | 96 | unsigned long extra, res; |
|
| 98 | 97 | Atom *protocols, real; |
|
| 99 | 98 | ||
| 100 | - | status = XGetWindowProperty(dpy, w, wmatom[WMProtocols], 0L, 20L, |
|
| 101 | - | False, XA_ATOM, &real, &format, &res, &extra, (unsigned char **)&protocols); |
|
| 99 | + | protos = 0; |
|
| 100 | + | status = XGetWindowProperty(dpy, w, wmatom[WMProtocols], 0L, 20L, False, |
|
| 101 | + | XA_ATOM, &real, &format, &res, &extra, (unsigned char **)&protocols); |
|
| 102 | 102 | if(status != Success || protocols == 0) |
|
| 103 | 103 | return protos; |
|
| 104 | - | for(i = 0; i < res; i++) { |
|
| 104 | + | for(i = 0; i < res; i++) |
|
| 105 | 105 | if(protocols[i] == wmatom[WMDelete]) |
|
| 106 | 106 | protos |= PROTODELWIN; |
|
| 107 | - | } |
|
| 108 | 107 | free(protocols); |
|
| 109 | 108 | return protos; |
|
| 110 | 109 | } |