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.
This commit is contained in:
mathias 2005-06-15 09:48:46 +00:00
parent acaa583093
commit cdc4338c6b
4 changed files with 61 additions and 2 deletions

View file

@ -1,6 +1,10 @@
(Format: Year/Month/Day)
Changes for 0.9.14:
*05/06/15:
* Fixes #1213003, SendToWorkspace shouldnt follow (Mathias)
- SendToWorkspace silently changes the workspace of the window
- TakeToWorkspace takes the window and puts it onto the ws
FbCommandFactory.cc CurrentWindowCmd.cc/hh
* Fixes #1216020, *.font.effect wont get cleared if not defined in style (Mathias)
FbTk/Font.cc
*05/06/09:

View file

@ -48,17 +48,35 @@ void SetHeadCmd::real_execute() {
void SendToWorkspaceCmd::real_execute() {
if (m_workspace_num >= 0 && m_workspace_num < fbwindow().screen().getNumberOfWorkspaces())
fbwindow().screen().sendToWorkspace(m_workspace_num, &fbwindow());
fbwindow().screen().sendToWorkspace(m_workspace_num, &fbwindow(), false);
}
void SendToNextWorkspaceCmd::real_execute() {
const int ws_nr =
( fbwindow().screen().currentWorkspaceID() + m_workspace_num ) %
fbwindow().screen().getNumberOfWorkspaces();
fbwindow().screen().sendToWorkspace(ws_nr, &fbwindow(), false);
}
void SendToPrevWorkspaceCmd::real_execute() {
int ws_nr = fbwindow().screen().currentWorkspaceID() - m_workspace_num;
if ( ws_nr < 0 ) ws_nr += fbwindow().screen().getNumberOfWorkspaces();
fbwindow().screen().sendToWorkspace(ws_nr, &fbwindow(), false);
}
void TakeToWorkspaceCmd::real_execute() {
if (m_workspace_num >= 0 && m_workspace_num < fbwindow().screen().getNumberOfWorkspaces())
fbwindow().screen().sendToWorkspace(m_workspace_num, &fbwindow());
}
void TakeToNextWorkspaceCmd::real_execute() {
unsigned int workspace_num=
( fbwindow().screen().currentWorkspaceID() + m_workspace_num ) %
fbwindow().screen().getNumberOfWorkspaces();
fbwindow().screen().sendToWorkspace(workspace_num, &fbwindow());
}
void SendToPrevWorkspaceCmd::real_execute() {
void TakeToPrevWorkspaceCmd::real_execute() {
int workspace_num= fbwindow().screen().currentWorkspaceID() - m_workspace_num;
if ( workspace_num < 0 ) workspace_num+= fbwindow().screen().getNumberOfWorkspaces();
fbwindow().screen().sendToWorkspace(workspace_num, &fbwindow());

View file

@ -96,6 +96,34 @@ private:
const int m_workspace_num;
};
class TakeToWorkspaceCmd : public WindowHelperCmd {
public:
explicit TakeToWorkspaceCmd(int workspace_num) : m_workspace_num(workspace_num) { }
protected:
void real_execute();
private:
const int m_workspace_num;
};
class TakeToNextWorkspaceCmd : public WindowHelperCmd {
public:
explicit TakeToNextWorkspaceCmd(int workspace_num) : m_workspace_num(workspace_num) { }
protected:
void real_execute();
private:
const int m_workspace_num;
};
class TakeToPrevWorkspaceCmd : public WindowHelperCmd {
public:
explicit TakeToPrevWorkspaceCmd(int workspace_num) : m_workspace_num(workspace_num) { }
protected:
void real_execute();
private:
const int m_workspace_num;
};
// goto tab
class GoToTabCmd: public WindowHelperCmd {
public:

View file

@ -122,6 +122,9 @@ FbCommandFactory::FbCommandFactory() {
"stick",
"stickwindow",
"tab",
"taketoworkspace",
"taketonextworkspace",
"taketoprevworkspace",
"toggledecor",
"windowmenu",
"workspace",
@ -279,6 +282,12 @@ FbTk::Command *FbCommandFactory::stringToCommand(const std::string &command,
return new SendToNextWorkspaceCmd(atoi(arguments.c_str()));
else if (command == "sendtoprevworkspace")
return new SendToPrevWorkspaceCmd(atoi(arguments.c_str()));
else if (command == "taketoworkspace")
return new TakeToWorkspaceCmd(atoi(arguments.c_str()) - 1);
else if (command == "taketonextworkspace")
return new TakeToNextWorkspaceCmd(atoi(arguments.c_str()));
else if (command == "taketoprevworkspace")
return new TakeToPrevWorkspaceCmd(atoi(arguments.c_str()));
else if (command == "killwindow" || command == "kill")
return new KillWindowCmd();
else if (command == "tab") {