summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2018-10-23 00:55:41 -0700
committerVito Caputo <vcaputo@pengaru.com>2018-10-23 00:55:41 -0700
commit5478ba895bb5ad811836384953e96e3209038122 (patch)
treecfc01c302c9ba3d31770f434287166da16ccc427
parent2f717227620d6cbae7d7da2a16a7fe4002220858 (diff)
window: vwm_win_focus_next() skip shelf unmap/map
When the shelf isn't the currently focused context but the focus next is relative to the focus context the mapping manipulation shouldn't be performed. This would cause unexpected appearance of shelved windows in a virtual desktop should a shelved window become invisibly unmanaged. Simple way to repro is to shelf an mplayer window. When the movie finishes, if you're on a desktop, out of nowhere the next shelved window appears but you're not supposed to be looking at the shelf. A simple visit to the shelf then back to the desktop would undo the anomaly, but it's trivial to fix - hell there was already a FIXME/TODO sitting there.
-rw-r--r--src/window.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/window.c b/src/window.c
index bffbfe5..2596cca 100644
--- a/src/window.c
+++ b/src/window.c
@@ -301,19 +301,16 @@ _retry:
if (vwin->shelved) {
if (next != vwm->focused_shelf) {
- /* shelf switch, unmap the focused shelf and take it over */
- /* TODO FIXME: this makes assumptions about the shelf being focused calling unmap/map directly.. */
- vwm_win_unmap(vwm, vwm->focused_shelf);
-
- XFlush(VWM_XDISPLAY(vwm));
-
- vwm_win_map(vwm, next);
+ if (vwm->focused_context == VWM_CONTEXT_SHELF) {
+ vwm_win_unmap(vwm, vwm->focused_shelf);
+ XFlush(VWM_XDISPLAY(vwm));
+ vwm_win_map(vwm, next);
+ }
vwm->focused_shelf = next;
vwm_win_focus(vwm, next);
}
} else {
if (next != next->desktop->focused_window) {
- /* focus the changed window */
vwm_win_focus(vwm, next);
XRaiseWindow(VWM_XDISPLAY(vwm), next->xwindow->id);
}
© All Rights Reserved