Mike's face
Monday, December 17th, 2018








IceWM enhancements

Improved workspace navigation.

I like flipping using ctrl-tab to flip between workspaces 1 and 2 (or 3 and 4), and ctrl-alt-tab to flip between 1 and 3 (or 2 and 4).  In addition, the shift key would take the current active window to the newly selected workspace.

Here's an adhoc patch:

wmmgr.cc:
YWindowManager::grabKeys
>    GRAB_WMKEY(gKeySysWorkspaceFlipOdd);
>    GRAB_WMKEY(gKeySysWorkspaceFlipEven);
>    GRAB_WMKEY(gKeySysWorkspaceFlipOddTakeWin);
>    GRAB_WMKEY(gKeySysWorkspaceFlipEvenTakeWin);

YWindowManager::handleWMKey
> } else if (IS_WMKEY(k, vm, gKeySysWorkspaceFlipOdd)) {
> switchToFlippedWorkspace(1, false);
> } else if (IS_WMKEY(k, vm, gKeySysWorkspaceFlipEven)) {
> switchToFlippedWorkspace(2, false);
> } else if (IS_WMKEY(k, vm, gKeySysWorkspaceFlipOddTakeWin)) {
> switchToFlippedWorkspace(1, true);
> } else if (IS_WMKEY(k, vm, gKeySysWorkspaceFlipEvenTakeWin)) {
> switchToFlippedWorkspace(2, true);

void YWindowManager::switchToFlippedWorkspace(int flip, bool takeCurrent)
{
    switchToWorkspace(activeWorkspace() ^ flip, takeCurrent);
}

default.h:
>    OKV("KeySysWorkspaceFlipOdd", gKeySysWorkspaceFlipOdd, ""),
>    OKV("KeySysWorkspaceFlipEven", gKeySysWorkspaceFlipEven, ""),
>    OKV("KeySysWorkspaceFlipOddTakeWin", gKeySysWorkspaceFlipOddTakeWin, ""),
>    OKV("KeySysWorkspaceFlipEvenTakeWin", gKeySysWorkspaceFlipEvenTakeWin,""),

bindkeys.h:
> #define defgKeySysWorkspaceFlipOdd      XK_Tab, kfCtrl, "Ctrl+Tab"
> #define defgKeySysWorkspaceFlipEven    XK_Tab, kfAlt+kfCtrl, "Alt+Ctrl+Tab"
> #define defgKeySysWorkspaceFlipOddTakeWin      XK_Tab, kfCtrl+kfShift, "Ctrl+Shift+Tab"
> #define defgKeySysWorkspaceFlipEvenTakeWin    XK_Tab, kfAlt+kfCtrl+kfShift, "Alt+Ctrl+Shift+Tab"


(C) Copyright 2004-2007 Mike Pot