summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnselm R. Garbe <arg@10kloc.org>2006-08-22 17:38:59 +0200
committerAnselm R. Garbe <arg@10kloc.org>2006-08-22 17:38:59 +0200
commit352e1b4c81d141cf60f98b38c93dd1fcd342c4a4 (patch)
tree7da017e77686fb9a093ce98ec4d5d11d46afb964
parentseparated several functions into view.c (diff)
downloaddwm-352e1b4c81d141cf60f98b38c93dd1fcd342c4a4.tar.gz
dwm-352e1b4c81d141cf60f98b38c93dd1fcd342c4a4.zip
removed winprop (merged into getproto)
-rw-r--r--main.c34
1 files changed, 7 insertions, 27 deletions
diff --git a/main.c b/main.c
index a51ba88..6f60c9b 100644
--- a/main.c
+++ b/main.c
@@ -62,25 +62,6 @@ scan()
62 XFree(wins); 62 XFree(wins);
63} 63}
64 64
65static int
66winprop(Window w, Atom a, Atom t, long l, unsigned char **prop)
67{
68 int status, format;
69 unsigned long res, extra;
70 Atom real;
71
72 status = XGetWindowProperty(dpy, w, a, 0L, l, False, t, &real, &format,
73 &res, &extra, prop);
74
75 if(status != Success || *prop == 0) {
76 return 0;
77 }
78 if(res == 0) {
79 free((void *) *prop);
80 }
81 return res;
82}
83
84/* 65/*
85 * Startup Error handler to check if another window manager 66 * Startup Error handler to check if another window manager
86 * is already running. 67 * is already running.
@@ -111,21 +92,20 @@ Window root, barwin;
111int 92int
112getproto(Window w) 93getproto(Window w)
113{ 94{
114 int protos = 0; 95 int status, format, protos = 0;
115 int i; 96 int i;
116 long res; 97 unsigned long extra, res;
117 Atom *protocols; 98 Atom *protocols, real;
118 99
119 res = winprop(w, wmatom[WMProtocols], XA_ATOM, 20L, 100 status = XGetWindowProperty(dpy, w, wmatom[WMProtocols], 0L, 20L,
120 ((unsigned char **)&protocols)); 101 False, XA_ATOM, &real, &format, &res, &extra, (unsigned char **)&protocols);
121 if(res <= 0) { 102 if(status != Success || protocols == 0)
122 return protos; 103 return protos;
123 }
124 for(i = 0; i < res; i++) { 104 for(i = 0; i < res; i++) {
125 if(protocols[i] == wmatom[WMDelete]) 105 if(protocols[i] == wmatom[WMDelete])
126 protos |= PROTODELWIN; 106 protos |= PROTODELWIN;
127 } 107 }
128 free((char *) protocols); 108 free(protocols);
129 return protos; 109 return protos;
130} 110}
131 111