From 26c1cfcc07c88b02bd9aa1c23aca61d8a3a313ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Sun, 20 Nov 2016 14:05:07 +0100 Subject: [PATCH] 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 --- src/Screen.cc | 4 ++++ src/WorkspaceCmd.cc | 1 + 2 files changed, 5 insertions(+) diff --git a/src/Screen.cc b/src/Screen.cc index 1205d79e..ff44f14b 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -1535,6 +1535,7 @@ void BScreen::setLayer(FbTk::LayerItem &item, int layernum) { 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 @@ void BScreen::nextWorkspace(int delta) { Goes to the workspace "left" of the current */ void BScreen::prevWorkspace(int delta) { + focusControl().stopCyclingFocus(); if (delta) changeWorkspaceID( (static_cast(numberOfWorkspaces()) + currentWorkspaceID() - (delta % numberOfWorkspaces())) % numberOfWorkspaces()); else if (m_former_workspace) @@ -1555,6 +1557,7 @@ void BScreen::prevWorkspace(int delta) { 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 @@ void BScreen::rightWorkspace(int delta) { Goes to the workspace "left" of the current */ void BScreen::leftWorkspace(int delta) { + focusControl().stopCyclingFocus(); if (currentWorkspaceID() >= static_cast(delta)) changeWorkspaceID(currentWorkspaceID()-delta); } diff --git a/src/WorkspaceCmd.cc b/src/WorkspaceCmd.cc index bca56c69..6d18b73d 100644 --- a/src/WorkspaceCmd.cc +++ b/src/WorkspaceCmd.cc @@ -383,6 +383,7 @@ JumpToWorkspaceCmd::JumpToWorkspaceCmd(int workspace_num):m_workspace_num(worksp 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