diff options
| author | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2012-02-24 04:27:43 +0200 |
|---|---|---|
| committer | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2012-02-24 04:29:25 +0200 |
| commit | a4c227f152d455d21f58c52f01a69e2442888e60 (patch) | |
| tree | 245c91dd5289460b3fc62f2048396085060cad3b | |
| parent | 5a0a2b1488255cda8718dd188b37acf31323a69a (diff) | |
fix infinite raising floating clients one on top of the other
| -rw-r--r-- | monsterwm.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/monsterwm.c b/monsterwm.c index fa18c17..b6d8b47 100644 --- a/monsterwm.c +++ b/monsterwm.c @@ -918,13 +918,14 @@ void update_current(client *c) { XChangeProperty(dis, root, netatoms[NET_ACTIVE], XA_WINDOW, 32, PropModeReplace, (unsigned char *)¤t->win, 1); XSetInputFocus(dis, current->win, RevertToPointerRoot, CurrentTime); + if (CLICK_TO_FOCUS) XUngrabButton(dis, Button1, None, current->win); /* keep transient and floating windows on top of regular windows */ - int tf = 0; - for (c=head; c; c=c->next) if (c->istransient || c->isfloating) tf = XRaiseWindow(dis, c->win); - if (!tf || current->isfloating || current->istransient) XRaiseWindow(dis, current->win); + Bool r = False; + if (current->isfloating || current->istransient) { XRaiseWindow(dis, current->win); r = True; } + else for (c=head; c; c=c->next) if (c->istransient || c->isfloating) r = XRaiseWindow(dis, c->win); + if (!r) XRaiseWindow(dis, current->win); - if (CLICK_TO_FOCUS) XUngrabButton(dis, Button1, None, current->win); XSync(dis, False); } |
