diff options
| -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); } |
