summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2022-02-05 21:19:55 -0800
committerVito Caputo <vcaputo@pengaru.com>2022-02-05 21:19:55 -0800
commit0c9563656ce00b0ad2608ec9b81301080be163dc (patch)
treeb224003e2f4a465ebf2dc91e7a70c24c39918d80
parentab2bc6f761682b5a0de50a580b5d3ae8d7649098 (diff)
key: create desktop on isolated window mru migrate
When the context has a lone desktop, attempting a migrate to the next MRU desktop does nothing. This change treats the situation exceptionally and creates a new desktop in the context for receiving the migrated window, as it's likely the desired result.
-rw-r--r--src/key.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/key.c b/src/key.c
index da1a22b..34af4f7 100644
--- a/src/key.c
+++ b/src/key.c
@@ -228,9 +228,13 @@ void vwm_key_pressed(vwm_t *vwm, Window win, XKeyPressedEvent *keypress)
} else if (send_it) { /* "send" the focused window to a new desktop in the current context, kind of an alias of send_it+XK_v */
if (vwin)
vwm_win_send(vwm, vwin, vwm_desktop_mru(vwm, vwm_desktop_create(vwm, vwin->desktop->context)));
- } else if (keypress->state & ShiftMask) { /* migrate the focused window with the desktop focus to the most recently used desktop */
- if (vwin)
+ } else if (keypress->state & ShiftMask) { /* migrate the focused window with the desktop focus to the most recently used desktop, creating one if none exists for convenience */
+ if (vwin) {
+ if (next_desktop == vwm->focused_desktop)
+ next_desktop = vwm_desktop_create(vwm, vwin->desktop->context);
+
vwm_win_migrate(vwm, vwin, next_desktop);
+ }
} else {
vwm_desktop_focus(vwm, next_desktop);
}
© All Rights Reserved