Xinqi Bao's Git
projects
/
dwm.git
/ commitdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
patch
|
inline
| side by side (parent:
352e1b4
)
rearranged getproto
author
Anselm R. Garbe <
[email protected]
>
Tue, 22 Aug 2006 15:40:21 +0000
(17:40 +0200)
committer
Anselm R. Garbe <
[email protected]
>
Tue, 22 Aug 2006 15:40:21 +0000
(17:40 +0200)
main.c
patch
|
blob
|
history
diff --git
a/main.c
b/main.c
index
6f60c9b
..
6da3ccd
100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-92,19
+92,18
@@
Window root, barwin;
int
getproto(Window w)
{
int
getproto(Window w)
{
- int status, format, protos = 0;
- int i;
+ int i, format, protos, status;
unsigned long extra, res;
Atom *protocols, real;
unsigned long extra, res;
Atom *protocols, real;
- status = XGetWindowProperty(dpy, w, wmatom[WMProtocols], 0L, 20L,
- False, XA_ATOM, &real, &format, &res, &extra, (unsigned char **)&protocols);
+ 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;
if(status != Success || protocols == 0)
return protos;
- for(i = 0; i < res; i++)
{
+ for(i = 0; i < res; i++)
if(protocols[i] == wmatom[WMDelete])
protos |= PROTODELWIN;
if(protocols[i] == wmatom[WMDelete])
protos |= PROTODELWIN;
- }
free(protocols);
return protos;
}
free(protocols);
return protos;
}