aboutsummaryrefslogtreecommitdiff
path: root/src/CurrentWindowCmd.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/CurrentWindowCmd.cc')
-rw-r--r--src/CurrentWindowCmd.cc26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/CurrentWindowCmd.cc b/src/CurrentWindowCmd.cc
index 4a60e63..58ec78c 100644
--- a/src/CurrentWindowCmd.cc
+++ b/src/CurrentWindowCmd.cc
@@ -61,16 +61,18 @@ void SendToWorkspaceCmd::real_execute() {
61 61
62void SendToNextWorkspaceCmd::real_execute() { 62void SendToNextWorkspaceCmd::real_execute() {
63 const int ws_nr = 63 const int ws_nr =
64 ( fbwindow().workspaceNumber() + m_workspace_num ) % 64 ( fbwindow().workspaceNumber() + m_delta ) %
65 fbwindow().screen().numberOfWorkspaces(); 65 fbwindow().screen().numberOfWorkspaces();
66 fbwindow().screen().sendToWorkspace(ws_nr, &fbwindow(), false); 66 fbwindow().screen().sendToWorkspace(ws_nr, &fbwindow(), false);
67} 67}
68 68
69void SendToPrevWorkspaceCmd::real_execute() { 69void SendToPrevWorkspaceCmd::real_execute() {
70 int ws_nr = (fbwindow().workspaceNumber() - m_workspace_num) % 70 int ws_nr = (fbwindow().workspaceNumber() - m_delta );
71 fbwindow().screen().numberOfWorkspaces();
72 if ( ws_nr < 0 ) 71 if ( ws_nr < 0 )
73 ws_nr += fbwindow().screen().numberOfWorkspaces(); 72 ws_nr += fbwindow().screen().numberOfWorkspaces();
73
74 ws_nr = ws_nr % fbwindow().screen().numberOfWorkspaces();
75
74 fbwindow().screen().sendToWorkspace(ws_nr, &fbwindow(), false); 76 fbwindow().screen().sendToWorkspace(ws_nr, &fbwindow(), false);
75} 77}
76 78
@@ -79,18 +81,20 @@ void TakeToWorkspaceCmd::real_execute() {
79} 81}
80 82
81void TakeToNextWorkspaceCmd::real_execute() { 83void TakeToNextWorkspaceCmd::real_execute() {
82 unsigned int workspace_num= 84 unsigned int ws_nr =
83 ( fbwindow().workspaceNumber() + m_workspace_num ) % 85 ( fbwindow().workspaceNumber() + m_delta) %
84 fbwindow().screen().numberOfWorkspaces(); 86 fbwindow().screen().numberOfWorkspaces();
85 fbwindow().screen().sendToWorkspace(workspace_num, &fbwindow()); 87 fbwindow().screen().sendToWorkspace(ws_nr, &fbwindow());
86} 88}
87 89
88void TakeToPrevWorkspaceCmd::real_execute() { 90void TakeToPrevWorkspaceCmd::real_execute() {
89 int workspace_num = (fbwindow().workspaceNumber() - m_workspace_num) % 91 int ws_nr = (fbwindow().workspaceNumber() - m_delta);
90 fbwindow().screen().numberOfWorkspaces(); 92 if ( ws_nr < 0 )
91 if ( workspace_num < 0 ) 93 ws_nr += fbwindow().screen().numberOfWorkspaces();
92 workspace_num += fbwindow().screen().numberOfWorkspaces(); 94
93 fbwindow().screen().sendToWorkspace(workspace_num, &fbwindow()); 95 ws_nr = ws_nr % fbwindow().screen().numberOfWorkspaces();
96
97 fbwindow().screen().sendToWorkspace(ws_nr, &fbwindow());
94} 98}
95 99
96void GoToTabCmd::real_execute() { 100void GoToTabCmd::real_execute() {