On Fri, Apr 11, 2008 at 12:26:04PM +0200, Anselm R. Garbe wrote:
> 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().
Thanks for the hint, that is a lot better.
> 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.
I have to admit I don't understand what you mean. Anyway, I can always
use xkill to get rid of unresponsive clients, if thats what you mean.
Thanks again
Martin
diff -up dwm-4.9/config.def.h dwm-4.9-nokill/config.def.h
--- dwm-4.9/config.def.h 2008-04-03 22:57:01.000000000 +0200
+++ dwm-4.9-nokill/config.def.h 2008-04-11 16:35:49.000000000 +0200
@@ -14,8 +14,9 @@
const char tags[][MAXTAGLEN] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
Rule rules[] = {
- /* class instance title tags ref isfloating */
- { "Gimp", NULL, NULL, NULL, True },
+ /* class instance title tags ref isfloating isunkillable*/
+ { "Gimp", NULL, NULL, NULL, True , False},
+ { "UXTerm", NULL, NULL, NULL, False, True},
};
/* geometries, s{x,y,w,h} and bh are already initualized here */
diff -up dwm-4.9/dwm.c dwm-4.9-nokill/dwm.c
--- dwm-4.9/dwm.c 2008-04-03 22:57:01.000000000 +0200
+++ dwm-4.9-nokill/dwm.c 2008-04-11 16:44:26.000000000 +0200
@@ -70,7 +70,7 @@ struct Client {
int minax, maxax, minay, maxay;
long flags;
unsigned int bw, oldbw;
- Bool isbanned, isfixed, isfloating, isurgent;
+ Bool isbanned, isfixed, isfloating, isurgent, isunkillable;
Bool *tags;
Client *next;
Client *prev;
@@ -117,6 +117,7 @@ typedef struct {
const char *title;
const char *tag;
Bool isfloating;
+ Bool isunkillable;
} Rule;
/* function declarations */
@@ -266,6 +267,7 @@ applyrules(Client *c) {
|| (ch.res_name && r->instance && strstr(ch.res_name, r->instance)))
{
c->isfloating = r->isfloating;
+ c->isunkillable = r->isunkillable;
if(r->tag) {
c->tags[idxoftag(r->tag)] = True;
matched = True;
@@ -967,7 +969,7 @@ void
killclient(const char *arg) {
XEvent ev;
- if(!sel)
+ if(!sel || sel->isunkillable)
return;
if(isprotodel(sel)) {
ev.type = ClientMessage;