aboutsummaryrefslogtreecommitdiff
path: root/src/CurrentWindowCmd.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/CurrentWindowCmd.cc')
-rw-r--r--src/CurrentWindowCmd.cc22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/CurrentWindowCmd.cc b/src/CurrentWindowCmd.cc
index ba3af0d..834dcad 100644
--- a/src/CurrentWindowCmd.cc
+++ b/src/CurrentWindowCmd.cc
@@ -48,17 +48,35 @@ void SetHeadCmd::real_execute() {
48 48
49void SendToWorkspaceCmd::real_execute() { 49void SendToWorkspaceCmd::real_execute() {
50 if (m_workspace_num >= 0 && m_workspace_num < fbwindow().screen().getNumberOfWorkspaces()) 50 if (m_workspace_num >= 0 && m_workspace_num < fbwindow().screen().getNumberOfWorkspaces())
51 fbwindow().screen().sendToWorkspace(m_workspace_num, &fbwindow()); 51 fbwindow().screen().sendToWorkspace(m_workspace_num, &fbwindow(), false);
52} 52}
53 53
54void SendToNextWorkspaceCmd::real_execute() { 54void SendToNextWorkspaceCmd::real_execute() {
55 const int ws_nr =
56 ( fbwindow().screen().currentWorkspaceID() + m_workspace_num ) %
57 fbwindow().screen().getNumberOfWorkspaces();
58 fbwindow().screen().sendToWorkspace(ws_nr, &fbwindow(), false);
59}
60
61void SendToPrevWorkspaceCmd::real_execute() {
62 int ws_nr = fbwindow().screen().currentWorkspaceID() - m_workspace_num;
63 if ( ws_nr < 0 ) ws_nr += fbwindow().screen().getNumberOfWorkspaces();
64 fbwindow().screen().sendToWorkspace(ws_nr, &fbwindow(), false);
65}
66
67void TakeToWorkspaceCmd::real_execute() {
68 if (m_workspace_num >= 0 && m_workspace_num < fbwindow().screen().getNumberOfWorkspaces())
69 fbwindow().screen().sendToWorkspace(m_workspace_num, &fbwindow());
70}
71
72void TakeToNextWorkspaceCmd::real_execute() {
55 unsigned int workspace_num= 73 unsigned int workspace_num=
56 ( fbwindow().screen().currentWorkspaceID() + m_workspace_num ) % 74 ( fbwindow().screen().currentWorkspaceID() + m_workspace_num ) %
57 fbwindow().screen().getNumberOfWorkspaces(); 75 fbwindow().screen().getNumberOfWorkspaces();
58 fbwindow().screen().sendToWorkspace(workspace_num, &fbwindow()); 76 fbwindow().screen().sendToWorkspace(workspace_num, &fbwindow());
59} 77}
60 78
61void SendToPrevWorkspaceCmd::real_execute() { 79void TakeToPrevWorkspaceCmd::real_execute() {
62 int workspace_num= fbwindow().screen().currentWorkspaceID() - m_workspace_num; 80 int workspace_num= fbwindow().screen().currentWorkspaceID() - m_workspace_num;
63 if ( workspace_num < 0 ) workspace_num+= fbwindow().screen().getNumberOfWorkspaces(); 81 if ( workspace_num < 0 ) workspace_num+= fbwindow().screen().getNumberOfWorkspaces();
64 fbwindow().screen().sendToWorkspace(workspace_num, &fbwindow()); 82 fbwindow().screen().sendToWorkspace(workspace_num, &fbwindow());