Re: [dwm] Preventing xterm from closing by killclient()

From: Anselm R. Garbe <arg_AT_suckless.org>
Date: Fri, 11 Apr 2008 12:26:04 +0200

On Fri, Apr 11, 2008 at 06:29:14AM +0200, Martin Sander wrote:
> On Wed, Apr 09, 2008 at 07:17:06PM -0400, Jeremy O'Brien wrote:
> > I recommend looking in applyrules() for some example code. You may be able
> > to adapt it in killclient() :)
>
> I had thought of that before, but I was still using 4.7 with regex
> matching and that looked complicated to me.
> Anyway, it wasn't difficult, especially with 4.9.
> Thanks for the hint!
>
> The solution is not very elegant (See attachment), but it works for me.

Just extend struct Client with Bool iskillable and set this
value at the same point as isfloating is set in applyrules, then
you just need to check c->iskillable in killclient().

Though, I would propose to set c->iskillable to True during
killclient() to allow getting rid of unresponsive clients which
cannot be killed straight away.

So you can delete the whole killable() function, which is also
rather slow if it is performed on each killclient() invocation.

Kind regards,

-- 
 Anselm R. Garbe >< http://www.suckless.org/ >< GPG key: 0D73F361
Received on Fri Apr 11 2008 - 12:26:04 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:33:10 UTC