diff options
| author | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2012-01-19 21:14:21 +0200 |
|---|---|---|
| committer | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2012-01-19 21:20:12 +0200 |
| commit | b08395a881c10d7e418edba31acda09c53ee1a00 (patch) | |
| tree | 1cd8f883759074d6a01b3a27fd5f7bd53d240c16 | |
| parent | bd36ff5a01becf4ed572563e47da1c7c35f92e93 (diff) | |
rule to spawn specified clients as floating
| -rw-r--r-- | config.def.h | 6 | ||||
| -rw-r--r-- | monsterwm.c | 5 |
2 files changed, 7 insertions, 4 deletions
diff --git a/config.def.h b/config.def.h index 44b23bc..2e4d113 100644 --- a/config.def.h +++ b/config.def.h @@ -28,9 +28,9 @@ /** open applications to specified desktop **/ static const AppRule rules[] = { \ - /* class desktop follow */ /* desktop index starts from 0 */ - { "MPlayer", 3, True }, /* if there are 4 desktops, 3 is the */ - { "Chromium", 0, False }, /* last desktop, 0 is always the fist */ + /* class desktop follow float */ /* desktop index starts from 0 */ + { "MPlayer", 3, True, False }, /* if there are 4 desktops, 3 is the */ + { "Gimp", 0, False, True }, /* last desktop, 0 is always the fist */ }; /* helper for spawning shell commands */ diff --git a/monsterwm.c b/monsterwm.c index 61844d3..7fed326 100644 --- a/monsterwm.c +++ b/monsterwm.c @@ -104,6 +104,7 @@ typedef struct { const char *class; const int desktop; const Bool follow; + const Bool floating; } AppRule; /* Functions */ @@ -467,7 +468,7 @@ void maprequest(XEvent *e) { if (XGetWindowAttributes(dis, e->xmaprequest.window, &wa) && wa.override_redirect) return; if (wintoclient(e->xmaprequest.window)) return; - Bool follow = False; + Bool follow = False, floating = False; int cd = current_desktop, newdsk = current_desktop; XClassHint ch = {0, 0}; if (XGetClassHint(dis, e->xmaprequest.window, &ch)) @@ -475,6 +476,7 @@ void maprequest(XEvent *e) { if (!strcmp(ch.res_class, rules[i].class) || !strcmp(ch.res_name, rules[i].class)) { follow = rules[i].follow; newdsk = rules[i].desktop; + floating = rules[i].floating; break; } if (ch.res_class) XFree(ch.res_class); @@ -486,6 +488,7 @@ void maprequest(XEvent *e) { Window w; current->istransient = XGetTransientForHint(dis, current->win, &w); + current->isfloating = floating; int di; unsigned long dl; unsigned char *state = NULL; Atom da; if (XGetWindowProperty(dis, current->win, netatoms[NET_WM_STATE], 0L, sizeof da, |
