aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormathias <mathias>2005-06-15 09:48:46 (GMT)
committermathias <mathias>2005-06-15 09:48:46 (GMT)
commitcdc4338c6b7175e0c2654e42a01ae575722f4fd1 (patch)
tree3141c97a59c1213aeb8ab7a674dfba3512cf9311 /src
parentacaa58309364238371dec1c30d8fe5097843fd57 (diff)
downloadfluxbox-cdc4338c6b7175e0c2654e42a01ae575722f4fd1.zip
fluxbox-cdc4338c6b7175e0c2654e42a01ae575722f4fd1.tar.bz2
Fixes #1213003, SendToWorkspace shouldnt follow
SendToWorkspace and the rest are putting the window onto the new workspace silently, TakeToWorkspace warps to the new workspace with the window.
Diffstat (limited to 'src')
-rw-r--r--src/CurrentWindowCmd.cc22
-rw-r--r--src/CurrentWindowCmd.hh28
-rw-r--r--src/FbCommandFactory.cc9
3 files changed, 57 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());
diff --git a/src/CurrentWindowCmd.hh b/src/CurrentWindowCmd.hh
index 6e17566..0ef7eca 100644
--- a/src/CurrentWindowCmd.hh
+++ b/src/CurrentWindowCmd.hh
@@ -96,6 +96,34 @@ private:
96 const int m_workspace_num; 96 const int m_workspace_num;
97}; 97};
98 98
99class TakeToWorkspaceCmd : public WindowHelperCmd {
100public:
101 explicit TakeToWorkspaceCmd(int workspace_num) : m_workspace_num(workspace_num) { }
102protected:
103 void real_execute();
104private:
105 const int m_workspace_num;
106};
107
108class TakeToNextWorkspaceCmd : public WindowHelperCmd {
109public:
110 explicit TakeToNextWorkspaceCmd(int workspace_num) : m_workspace_num(workspace_num) { }
111protected:
112 void real_execute();
113private:
114 const int m_workspace_num;
115};
116
117class TakeToPrevWorkspaceCmd : public WindowHelperCmd {
118public:
119 explicit TakeToPrevWorkspaceCmd(int workspace_num) : m_workspace_num(workspace_num) { }
120protected:
121 void real_execute();
122private:
123 const int m_workspace_num;
124};
125
126
99// goto tab 127// goto tab
100class GoToTabCmd: public WindowHelperCmd { 128class GoToTabCmd: public WindowHelperCmd {
101public: 129public:
diff --git a/src/FbCommandFactory.cc b/src/FbCommandFactory.cc
index ec91a86..f3c6f51 100644
--- a/src/FbCommandFactory.cc
+++ b/src/FbCommandFactory.cc
@@ -122,6 +122,9 @@ FbCommandFactory::FbCommandFactory() {
122 "stick", 122 "stick",
123 "stickwindow", 123 "stickwindow",
124 "tab", 124 "tab",
125 "taketoworkspace",
126 "taketonextworkspace",
127 "taketoprevworkspace",
125 "toggledecor", 128 "toggledecor",
126 "windowmenu", 129 "windowmenu",
127 "workspace", 130 "workspace",
@@ -279,6 +282,12 @@ FbTk::Command *FbCommandFactory::stringToCommand(const std::string &command,
279 return new SendToNextWorkspaceCmd(atoi(arguments.c_str())); 282 return new SendToNextWorkspaceCmd(atoi(arguments.c_str()));
280 else if (command == "sendtoprevworkspace") 283 else if (command == "sendtoprevworkspace")
281 return new SendToPrevWorkspaceCmd(atoi(arguments.c_str())); 284 return new SendToPrevWorkspaceCmd(atoi(arguments.c_str()));
285 else if (command == "taketoworkspace")
286 return new TakeToWorkspaceCmd(atoi(arguments.c_str()) - 1);
287 else if (command == "taketonextworkspace")
288 return new TakeToNextWorkspaceCmd(atoi(arguments.c_str()));
289 else if (command == "taketoprevworkspace")
290 return new TakeToPrevWorkspaceCmd(atoi(arguments.c_str()));
282 else if (command == "killwindow" || command == "kill") 291 else if (command == "killwindow" || command == "kill")
283 return new KillWindowCmd(); 292 return new KillWindowCmd();
284 else if (command == "tab") { 293 else if (command == "tab") {