comparison client.c @ 734:6283adb1fcf2

replaced getproto with a saner function, now old-school artifacts of WM times in the early 90s completely disappeared, no punned pointer warning anymore ;)
author Anselm R. Garbe <arg@suckless.org>
date Wed, 07 Feb 2007 12:37:06 +0100
parents 1950833a5614
children
comparison
equal deleted inserted replaced
733:1950833a5614 734:6283adb1fcf2
118 if(c->win == w) 118 if(c->win == w)
119 return c; 119 return c;
120 return NULL; 120 return NULL;
121 } 121 }
122 122
123 Bool
124 isprotodel(Client *c) {
125 int i, n;
126 Atom *protocols;
127 Bool ret = False;
128
129 if(XGetWMProtocols(dpy, c->win, &protocols, &n)) {
130 for(i = 0; !ret && i < n; i++)
131 if(protocols[i] == wmatom[WMDelete])
132 ret = True;
133 XFree(protocols);
134 }
135 return ret;
136 }
137
123 void 138 void
124 killclient(Arg *arg) { 139 killclient(Arg *arg) {
125 if(!sel) 140 if(!sel)
126 return; 141 return;
127 if(sel->proto & PROTODELWIN) 142 if(isprotodel(sel))
128 sendevent(sel->win, wmatom[WMProtocols], wmatom[WMDelete]); 143 sendevent(sel->win, wmatom[WMProtocols], wmatom[WMDelete]);
129 else 144 else
130 XKillClient(dpy, sel->win); 145 XKillClient(dpy, sel->win);
131 } 146 }
132 147
157 c->x = wax; 172 c->x = wax;
158 if(c->y < way) 173 if(c->y < way)
159 c->y = way; 174 c->y = way;
160 } 175 }
161 updatesizehints(c); 176 updatesizehints(c);
162 c->proto = getproto(c->win);
163 XSelectInput(dpy, c->win, 177 XSelectInput(dpy, c->win,
164 StructureNotifyMask | PropertyChangeMask | EnterWindowMask); 178 StructureNotifyMask | PropertyChangeMask | EnterWindowMask);
165 XGetTransientForHint(dpy, c->win, &trans); 179 XGetTransientForHint(dpy, c->win, &trans);
166 grabbuttons(c, False); 180 grabbuttons(c, False);
167 XSetWindowBorder(dpy, c->win, dc.norm[ColBorder]); 181 XSetWindowBorder(dpy, c->win, dc.norm[ColBorder]);