diff options
| author | Anselm R. Garbe <arg@suckless.org> | 2007-02-07 12:37:06 +0100 |
|---|---|---|
| committer | Anselm R. Garbe <arg@suckless.org> | 2007-02-07 12:37:06 +0100 |
| commit | 28ffff801bb0137ec3fe4093afc4fb29784b17ec (patch) | |
| tree | 2072e2465fb0b3cbf4f3241a096de99752e79be1 /client.c | |
| parent | yet another fix (diff) | |
| download | dwm-28ffff801bb0137ec3fe4093afc4fb29784b17ec.tar.gz dwm-28ffff801bb0137ec3fe4093afc4fb29784b17ec.zip | |
replaced getproto with a saner function, now old-school artifacts of WM times in the early 90s completely disappeared, no punned pointer warning anymore ;)
Diffstat (limited to '')
| -rw-r--r-- | client.c | 18 |
1 files changed, 16 insertions, 2 deletions
| @@ -120,11 +120,26 @@ getclient(Window w) { | |||
| 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); |
| @@ -159,7 +174,6 @@ manage(Window w, XWindowAttributes *wa) { | |||
| 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); |
