mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 21:08:08 +01:00
Shortcuts for moving windows between workspaces.
Added new keyboard shortcuts for moving windows between workspaces. MoveToWorkspace1Key moves the active window directly to workspace 1. Similarly for MoveToWorkspace2Key through MoveToWorkspace10Key. MoveToNextWorkspaceKey moves the window to the next workspace, MoveToPrevWorkspaceKey moves the window to the previous workspace. Both keys respect the ws_advance and ws_cycle preferences. MoveToNextWorkspaceLayerKey moves the window ten workspaces "forward" if possible. MoveToPrevWorkspaceLayerKey moves the window ten workspaces "back" if possible.
This commit is contained in:
committed by
Carlos R. Mafra
parent
cfdf1e92fe
commit
ae7235c2df
40
src/event.c
40
src/event.c
@@ -1558,6 +1558,46 @@ static void handleKeyPress(XEvent * event)
|
||||
wWorkspaceChange(scr, scr->last_workspace);
|
||||
break;
|
||||
|
||||
case WKBD_MOVE_WORKSPACE1 ... WKBD_MOVE_WORKSPACE10:
|
||||
widx = command - WKBD_MOVE_WORKSPACE1;
|
||||
i = (scr->current_workspace / 10) * 10 + widx;
|
||||
if (wwin && (wPreferences.ws_advance || i < scr->workspace_count))
|
||||
wWindowChangeWorkspace(wwin, i);
|
||||
break;
|
||||
|
||||
case WKBD_MOVE_NEXTWORKSPACE:
|
||||
if (wwin)
|
||||
wWindowChangeWorkspaceRelative(wwin, 1);
|
||||
break;
|
||||
case WKBD_MOVE_PREVWORKSPACE:
|
||||
if (wwin)
|
||||
wWindowChangeWorkspaceRelative(wwin, -1);
|
||||
break;
|
||||
case WKBD_MOVE_LASTWORKSPACE:
|
||||
if (wwin)
|
||||
wWindowChangeWorkspace(wwin, scr->last_workspace);
|
||||
break;
|
||||
|
||||
case WKBD_MOVE_NEXTWSLAYER:
|
||||
case WKBD_MOVE_PREVWSLAYER:
|
||||
{
|
||||
if (wwin) {
|
||||
int row, column;
|
||||
|
||||
row = scr->current_workspace / 10;
|
||||
column = scr->current_workspace % 10;
|
||||
|
||||
if (command == WKBD_MOVE_NEXTWSLAYER) {
|
||||
if ((row + 1) * 10 < scr->workspace_count)
|
||||
wWindowChangeWorkspace(wwin, column + (row + 1) * 10);
|
||||
} else {
|
||||
if (row > 0)
|
||||
wWindowChangeWorkspace(wwin, column + (row - 1) * 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case WKBD_WINDOW1:
|
||||
case WKBD_WINDOW2:
|
||||
case WKBD_WINDOW3:
|
||||
|
||||
Reference in New Issue
Block a user