From e889dc6f7354afb585658028e7d90e07981632af Mon Sep 17 00:00:00 2001 From: Ivan Kanakarakis Date: Mon, 6 Feb 2012 18:18:23 +0200 Subject: killclient(): fix searching for WM_DELETE_WINDOW atom in client --- monsterwm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/monsterwm.c b/monsterwm.c index ef77140..d8c982d 100644 --- a/monsterwm.c +++ b/monsterwm.c @@ -454,10 +454,10 @@ void keypress(XEvent *e) { */ void killclient() { if (!current) return; - Atom *protocols; int n = 0; - if (XGetWMProtocols(dis, current->win, &protocols, &n)) while(n-- && protocols[n] != wmatoms[WM_DELETE_WINDOW]); - if (n) deletewindow(current->win); - else XKillClient(dis, current->win); + Atom *prot; int n = -1; + if (XGetWMProtocols(dis, current->win, &prot, &n)) while(!--n<0 && prot[n] != wmatoms[WM_DELETE_WINDOW]); + if (n < 0) XKillClient(dis, current->win); + else deletewindow(current->win); removeclient(current); } -- cgit v1.3.1