stop focus cycling on explicit workspace changes Otherwise implicit focus changes by the workspace change would be perceived as focus stealing and the focus restored to the last window on the original desktop
Thomas Lübking thomas.luebking@gmail.com
2 files changed,
5 insertions(+),
0 deletions(-)
M
src/Screen.cc
→
src/Screen.cc
@@ -1535,6 +1535,7 @@ /**
Goes to the workspace "right" of the current */ void BScreen::nextWorkspace(int delta) { + focusControl().stopCyclingFocus(); if (delta) changeWorkspaceID( (currentWorkspaceID() + delta) % numberOfWorkspaces()); else if (m_former_workspace)@@ -1545,6 +1546,7 @@ /**
Goes to the workspace "left" of the current */ void BScreen::prevWorkspace(int delta) { + focusControl().stopCyclingFocus(); if (delta) changeWorkspaceID( (static_cast<signed>(numberOfWorkspaces()) + currentWorkspaceID() - (delta % numberOfWorkspaces())) % numberOfWorkspaces()); else if (m_former_workspace)@@ -1555,6 +1557,7 @@ /**
Goes to the workspace "right" of the current */ void BScreen::rightWorkspace(int delta) { + focusControl().stopCyclingFocus(); if (currentWorkspaceID()+delta < numberOfWorkspaces()) changeWorkspaceID(currentWorkspaceID()+delta); }@@ -1563,6 +1566,7 @@ /**
Goes to the workspace "left" of the current */ void BScreen::leftWorkspace(int delta) { + focusControl().stopCyclingFocus(); if (currentWorkspaceID() >= static_cast<unsigned int>(delta)) changeWorkspaceID(currentWorkspaceID()-delta); }
M
src/WorkspaceCmd.cc
→
src/WorkspaceCmd.cc
@@ -383,6 +383,7 @@
void JumpToWorkspaceCmd::execute() { BScreen *screen = Fluxbox::instance()->mouseScreen(); if (screen != 0) { + screen->focusControl().stopCyclingFocus(); int num = screen->numberOfWorkspaces(); int actual = m_workspace_num; // we need an extra +1, since it's subtracted in FbCommandFactory