mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 12:28:22 +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
24
src/window.c
24
src/window.c
@@ -1917,6 +1917,30 @@ void wWindowChangeWorkspace(WWindow *wwin, int workspace)
|
||||
wWindowUnmap(wwin);
|
||||
}
|
||||
|
||||
void wWindowChangeWorkspaceRelative(WWindow *wwin, int amount)
|
||||
{
|
||||
WScreen *scr = wwin->screen_ptr;
|
||||
int w = scr->current_workspace + amount;
|
||||
|
||||
if (amount < 0) {
|
||||
if (w >= 0) {
|
||||
wWindowChangeWorkspace(wwin, w);
|
||||
} else if (wPreferences.ws_cycle) {
|
||||
wWindowChangeWorkspace(wwin, scr->workspace_count + w);
|
||||
}
|
||||
} else if (amount > 0) {
|
||||
if (w < scr->workspace_count) {
|
||||
wWindowChangeWorkspace(wwin, w);
|
||||
} else if (wPreferences.ws_advance) {
|
||||
int workspace = WMIN(w, MAX_WORKSPACES - 1);
|
||||
wWorkspaceMake(scr, workspace);
|
||||
wWindowChangeWorkspace(wwin, workspace);
|
||||
} else if (wPreferences.ws_cycle) {
|
||||
wWindowChangeWorkspace(wwin, w % scr->workspace_count);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void wWindowSynthConfigureNotify(WWindow *wwin)
|
||||
{
|
||||
XEvent sevent;
|
||||
|
||||
Reference in New Issue
Block a user