summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2025-02-15 14:48:40 -0800
committerVito Caputo <vcaputo@pengaru.com>2025-03-21 10:57:27 -0700
commit4b5e9070ca9c8b3486f57628ad746da63d77e1e5 (patch)
tree275fad59f92db7207509dd5a129539e3b4df3433
parent315aaf7408484d0138bf3958b3c7fe76a2119706 (diff)
key: support reversing migrating by screen
-rw-r--r--src/key.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/key.c b/src/key.c
index 3786d47..2c2a3fd 100644
--- a/src/key.c
+++ b/src/key.c
@@ -16,6 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <assert.h>
#include <X11/Xlib.h>
#include <X11/keysym.h>
#include <stdlib.h>
@@ -228,9 +229,22 @@ void vwm_key_pressed(vwm_t *vwm, Window win, XKeyPressedEvent *keypress)
* of the current desktop which map to displays.
*/
} else if (keypress->state & ShiftMask) {
+ vwm_screen_rel_t rel;
+
/* "migrate" the focused window to the next screen */
- vwm_win_autoconf(vwm, vwin, VWM_SCREEN_REL_XWIN_NEXT, vwin->autoconfigured, vwin->autoconfigured_param);
- /* TODO reverse via VWM_SCREEN_REL_XWIN_PREV */
+
+ switch (direction) {
+ case VWM_DIRECTION_FORWARD:
+ rel = VWM_SCREEN_REL_XWIN_NEXT;
+ break;
+ case VWM_DIRECTION_REVERSE:
+ rel = VWM_SCREEN_REL_XWIN_PREV;
+ break;
+ default:
+ assert(0);
+ }
+
+ vwm_win_autoconf(vwm, vwin, rel, vwin->autoconfigured, vwin->autoconfigured_param);
} else {
/* focus the MRU window on the next screen */
vwm_win_focus_next(vwm, vwin, direction, VWM_FENCE_MASKED_VIOLATE);
© All Rights Reserved