From 0ee46b69ff6d1b9750da111c4ce32a5b789b6e79 Mon Sep 17 00:00:00 2001 From: Ivan Kanakarakis Date: Thu, 21 Jun 2012 14:18:56 +0300 Subject: bigfix focus behavior on FLOAT mode clients spawned when mode was FLOAT would not be marked as floating clients, and thus floating clients would appear on top of them. now clients spawned when mode is FLOAT, are marked as floating clients. additionally, there is no 'reset floating clients' capability, when mode is FLOAT. this was achieved by retiling the windows (reselecting the current mode). it would mark floating clients as non-floating and thus tile/reset them to the layout. this must not happen when the mode is FLOAT, as if a client on FLOAT mode is marked non-floating and moved to another desktop, it will be tiled, and this is inconsistent behavior (unexpected result). clients on FLOAT mode are floating clients always, and switching to FLOAT mode should mark all clients as such. --- monsterwm.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'monsterwm.c') diff --git a/monsterwm.c b/monsterwm.c index f88f78c..f3cb60e 100644 --- a/monsterwm.c +++ b/monsterwm.c @@ -453,7 +453,8 @@ void maprequest(XEvent *e) { if (cd != newdsk) select_desktop(newdsk); client *c = addwindow(e->xmaprequest.window); - c->isfloating = floating || (c->istransient = XGetTransientForHint(dis, c->win, &w)); + c->istransient = XGetTransientForHint(dis, c->win, &w); + c->isfloating = floating || mode == FLOAT || c->istransient; int di; unsigned long dl; unsigned char *state = NULL; Atom da; if (XGetWindowProperty(dis, c->win, netatoms[NET_WM_STATE], 0L, sizeof da, @@ -802,8 +803,8 @@ void swap_master(void) { /* switch the tiling mode and reset all floating windows */ void switch_mode(const Arg *arg) { - if (mode == arg->i) for (client *c=head; c; c=c->next) c->isfloating = False; - mode = arg->i; + if (mode == arg->i && mode != FLOAT) for (client *c=head; c; c=c->next) c->isfloating = False; + if ((mode = arg->i) == FLOAT) for (client *c=head; c; c=c->next) c->isfloating = True; tile(); update_current(current); desktopinfo(); } -- cgit v1.3.1