diff options
| author | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2012-02-29 23:26:45 +0200 |
|---|---|---|
| committer | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2012-03-01 04:56:57 +0200 |
| commit | 6eb39f84c7d6334c01b38fda7118ffbfaae46f61 (patch) | |
| tree | eee6fb3154ce6e171d1fb027d9e6d3ac12268b83 /monsterwm.c | |
| parent | 89331be5767636e204a0bca5d518d5a7d01970ff (diff) | |
fix overlapping borders
when a floating or transient client exists,
then, selecting normal clients wouldn't raise them,
so, its active border was hidden, most times.
now every window is lowered, except the active one,
so the its borders are always on top.
this also fixes flickering of floating/transient
clients that were ovelapping.
however it introduces a weird behavior
when the mode is monocle, as in that case
when the floating client is selected,
the background/fullscreen window is always
the first opened window (or head).
Diffstat (limited to 'monsterwm.c')
| -rw-r--r-- | monsterwm.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/monsterwm.c b/monsterwm.c index 8231bfc..41b05da 100644 --- a/monsterwm.c +++ b/monsterwm.c @@ -892,22 +892,23 @@ void unmapnotify(XEvent *e) { * if no client is given update current * if current is NULL then delete the active window property * - * a window should have borders in any case except if - * - the window is not floating or transient - * - the window is fullscreen + * a window should have borders in any case, except if * - the window is the only window on screen - * - the mode is MONOCLE and non of the above applies + * - the window is fullscreen + * - the mode is MONOCLE and the window is not floating or transient */ void update_current(client *c) { if (!c) { XDeleteProperty(dis, root, netatoms[NET_ACTIVE]); return; } else current = c; + if (c->isfullscrn || c->isfloating || c->istransient) XRaiseWindow(dis, c->win); for (c=head; c; c=c->next) { XSetWindowBorderWidth(dis, c->win, (!head->next || c->isfullscrn || (mode == MONOCLE && !c->isfloating && !c->istransient)) ? 0 : BORDER_WIDTH); XSetWindowBorder(dis, c->win, (current == c ? win_focus : win_unfocus)); + if (current != c && !c->isfloating && !c->istransient) XLowerWindow(dis, c->win); if (CLICK_TO_FOCUS) XGrabButton(dis, Button1, None, c->win, True, ButtonPressMask, GrabModeAsync, GrabModeAsync, None, None); } @@ -917,12 +918,6 @@ void update_current(client *c) { 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 */ - 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); - XSync(dis, False); } |
