aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kanakarakis <ivan.kanak@gmail.com>2012-06-21 14:18:56 +0300
committerIvan Kanakarakis <ivan.kanak@gmail.com>2012-06-21 14:26:58 +0300
commit0ee46b69ff6d1b9750da111c4ce32a5b789b6e79 (patch)
treeb7cc72c98d9828db513a70e89ca24d09e74f9d5f
parent35fa75a89aed950c3946213ca1c73251b3cc96a0 (diff)
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.
-rw-r--r--monsterwm.c7
1 files changed, 4 insertions, 3 deletions
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();
}