From a4c227f152d455d21f58c52f01a69e2442888e60 Mon Sep 17 00:00:00 2001 From: Ivan Kanakarakis Date: Fri, 24 Feb 2012 04:27:43 +0200 Subject: fix infinite raising floating clients one on top of the other --- monsterwm.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'monsterwm.c') 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); } -- cgit v1.3.1