client.c
changeset 734 6283adb1fcf2
parent 733 1950833a5614
child 752 9fe042b02e18
--- a/client.c	Tue Feb 06 15:29:19 2007 +0100
+++ b/client.c	Wed Feb 07 12:37:06 2007 +0100
@@ -120,11 +120,26 @@
 	return NULL;
 }
 
+Bool
+isprotodel(Client *c) {
+	int i, n;
+	Atom *protocols;
+	Bool ret = False;
+
+	if(XGetWMProtocols(dpy, c->win, &protocols, &n)) {
+		for(i = 0; !ret && i < n; i++)
+			if(protocols[i] == wmatom[WMDelete])
+				ret = True;
+		XFree(protocols);
+	}
+	return ret;
+}
+
 void
 killclient(Arg *arg) {
 	if(!sel)
 		return;
-	if(sel->proto & PROTODELWIN)
+	if(isprotodel(sel))
 		sendevent(sel->win, wmatom[WMProtocols], wmatom[WMDelete]);
 	else
 		XKillClient(dpy, sel->win);
@@ -159,7 +174,6 @@
 			c->y = way;
 	}
 	updatesizehints(c);
-	c->proto = getproto(c->win);
 	XSelectInput(dpy, c->win,
 		StructureNotifyMask | PropertyChangeMask | EnterWindowMask);
 	XGetTransientForHint(dpy, c->win, &trans);