|
[PATCH 11/11] [RFC] improve quickswitch window to change workspace: msg#00024window-managers.icewm.devel
this idea is borrowed from the nvidia desktop software for windows you see in the alt+tab window a line with all workspaces and can switch between these with alt+`. but the actual workspace switch happens only after the pupup. state of the patch: + it somehow works + no graphical code + should it be possible to start quickswitch with alt+`? bert wesarg --- diff -urp old/src/bindkey.h new/src/bindkey.h --- old/src/bindkey.h 2006-11-12 19:20:22.207975576 +0100 +++ new/src/bindkey.h 2006-11-12 19:30:05.602107556 +0100 @@ -40,6 +40,8 @@ #define defgKeyWinLayerLower XK_Page_Down, kfCtrl+kfAlt, "Ctrl+Alt+Page_Down" #define defgKeySysSwitchNext XK_Tab, kfAlt, "Alt+Tab" #define defgKeySysSwitchLast XK_Tab, kfAlt+kfShift, "Alt+Shift+Tab" +#define defgKeySysSwitchNextWorkspace XK_grave, kfAlt, "Alt+`" +#define defgKeySysSwitchLastWorkspace XK_grave, kfAlt+kfShift, "Alt+Shift+`" #define defgKeySysWinNext XK_Escape, kfAlt, "Alt+Esc" #define defgKeySysWinPrev XK_Escape, kfAlt+kfShift, "Alt+Shift+Esc" #define defgKeySysWinMenu XK_Escape, kfShift, "Shift+Esc" @@ -159,6 +161,8 @@ DEF_WMKEY(gKeyWinLayerLower); DEF_WMKEY(gKeyWinMenu); DEF_WMKEY(gKeySysSwitchNext); DEF_WMKEY(gKeySysSwitchLast); +DEF_WMKEY(gKeySysSwitchNextWorkspace); +DEF_WMKEY(gKeySysSwitchLastWorkspace); DEF_WMKEY(gKeySysWinNext); DEF_WMKEY(gKeySysWinPrev); DEF_WMKEY(gKeySysWinMenu); diff -urp old/src/default.h new/src/default.h --- old/src/default.h 2006-11-12 19:28:14.062396141 +0100 +++ new/src/default.h 2006-11-12 19:30:05.603107347 +0100 @@ -409,6 +409,8 @@ cfoption icewm_preferences[] = { OKV("KeyWinLayerLower", gKeyWinLayerLower, "Lower the window one layer"), OKV("KeySysSwitchNext", gKeySysSwitchNext, ""), OKV("KeySysSwitchLast", gKeySysSwitchLast, ""), + OKV("KeySysSwitchNextWorkspace", gKeySysSwitchNextWorkspace, "Key to change the the next aktive workspace windowlist while in quickswitch"), + OKV("KeySysSwitchLastWorkspace", gKeySysSwitchLastWorkspace, "Key to change the the previous aktive workspace windowlist while in quickswitch"), OKV("KeySysWinNext", gKeySysWinNext, ""), OKV("KeySysWinPrev", gKeySysWinPrev, ""), OKV("KeySysWinMenu", gKeySysWinMenu, ""), diff -urp old/src/wmmgr.cc new/src/wmmgr.cc --- old/src/wmmgr.cc 2006-11-12 19:27:29.114780838 +0100 +++ new/src/wmmgr.cc 2006-11-12 19:30:05.604107138 +0100 @@ -126,6 +126,8 @@ void YWindowManager::grabKeys() { if (quickSwitch) { GRAB_WMKEY(gKeySysSwitchNext); GRAB_WMKEY(gKeySysSwitchLast); + GRAB_WMKEY(gKeySysSwitchNextWorkspace); + GRAB_WMKEY(gKeySysSwitchLastWorkspace); } GRAB_WMKEY(gKeySysWinNext); GRAB_WMKEY(gKeySysWinPrev); @@ -271,6 +273,10 @@ bool YWindowManager::handleWMKey(const X XAllowEvents(xapp->display(), AsyncKeyboard, key.time); switchWindow->begin(0, key.state); return true; + } else if (IS_WMKEY(k, vm, gKeySysSwitchNextWorkspace)) { + return true; + } else if (IS_WMKEY(k, vm, gKeySysSwitchLastWorkspace)) { + return true; } } if (IS_WMKEY(k, vm, gKeySysWinNext)) { diff -urp old/src/wmswitch.cc new/src/wmswitch.cc --- old/src/wmswitch.cc 2006-11-12 19:27:29.115780629 +0100 +++ new/src/wmswitch.cc 2006-11-12 19:30:05.605106929 +0100 @@ -414,14 +414,12 @@ int SwitchWindow::getZListCount() { int SwitchWindow::getZList(YFrameWindow **list, int max) { if (quickSwitchGroupWorkspaces || !quickSwitchToAllWorkspaces) { - int activeWorkspace = fRoot->activeWorkspace(); - int count = 0; - count += GetZListWorkspace(list, max, true, activeWorkspace); + count += GetZListWorkspace(list, max, true, activeSwitchWorkspace); if (quickSwitchToAllWorkspaces) { for (int w = 0; w <= workspaceCount; w++) { - if (w != activeWorkspace) + if (w != activeSwitchWorkspace) count += GetZListWorkspace(list + count, max - count, true, w); } } @@ -609,6 +607,7 @@ void SwitchWindow::begin(bool zdown, int int xiscreen = manager->getScreen(); fLastWindow = fActiveWindow = manager->getFocus(); + activeSwitchWorkspace = fRoot->activeWorkspace(); updateZList(); zTarget = 0; fActiveWindow = nextWindow(zdown); @@ -694,11 +693,29 @@ bool SwitchWindow::handleKey(const XKeyE if (key.type == KeyPress) { if ((IS_WMKEY(k, vm, gKeySysSwitchNext))) { fActiveWindow = nextWindow(true); - displayFocus(fActiveWindow); + if (activeSwitchWorkspace == fRoot->activeWorkspace()) + displayFocus(fActiveWindow); return true; } else if ((IS_WMKEY(k, vm, gKeySysSwitchLast))) { fActiveWindow = nextWindow(false); - displayFocus(fActiveWindow); + if (activeSwitchWorkspace == fRoot->activeWorkspace()) + displayFocus(fActiveWindow); + return true; + } else if ((IS_WMKEY(k, vm, gKeySysSwitchNextWorkspace))) { + activeSwitchWorkspace = (activeSwitchWorkspace + 1) % workspaceCount; + updateZList(); + zTarget = 0; + fActiveWindow = manager->getLastFocus(); + displayFocus(0); + repaint(); + return true; + } else if ((IS_WMKEY(k, vm, gKeySysSwitchLastWorkspace))) { + activeSwitchWorkspace = (activeSwitchWorkspace - 1) % workspaceCount; + updateZList(); + zTarget = 0; + fActiveWindow = manager->getLastFocus(); + displayFocus(0); + repaint(); return true; } else if (k == XK_Escape) { cancel(); diff -urp old/src/wmswitch.h new/src/wmswitch.h --- old/src/wmswitch.h 2006-09-10 18:12:11.000000000 +0200 +++ new/src/wmswitch.h 2006-11-12 19:30:05.605106929 +0100 @@ -56,6 +56,7 @@ private: int zCount; int zTarget; YFrameWindow **zList; + int activeSwitchWorkspace; void cancel(); void accept(); ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | [PATCH 10/11] [RFC] resize window till workspace border: 00024, Bert Wesarg |
|---|---|
| Next by Date: | [ icewm-Feature Requests-1596923 ] Network Manager applet/docklet: 00024, SourceForge.net |
| Previous by Thread: | [PATCH 10/11] [RFC] resize window till workspace borderi: 00024, Bert Wesarg |
| Next by Thread: | [ icewm-Feature Requests-1596923 ] Network Manager applet/docklet: 00024, SourceForge.net |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |