aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Lübking <thomas.luebking@gmail.com>2016-11-20 13:05:07 (GMT)
committerThomas Lübking <thomas.luebking@gmail.com>2016-11-20 13:08:25 (GMT)
commit26c1cfcc07c88b02bd9aa1c23aca61d8a3a313ea (patch)
tree72fd549edb52c364b3146fed24f07ddd3ddd03ad /src
parent3d7b466e7aff343dee152d4937d824d2860aac6b (diff)
downloadfluxbox-26c1cfcc07c88b02bd9aa1c23aca61d8a3a313ea.zip
fluxbox-26c1cfcc07c88b02bd9aa1c23aca61d8a3a313ea.tar.bz2
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
Diffstat (limited to 'src')
-rw-r--r--src/Screen.cc4
-rw-r--r--src/WorkspaceCmd.cc1
2 files changed, 5 insertions, 0 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index 1205d79..ff44f14 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -1535,6 +1535,7 @@ void BScreen::setLayer(FbTk::LayerItem &item, int layernum) {
1535 Goes to the workspace "right" of the current 1535 Goes to the workspace "right" of the current
1536*/ 1536*/
1537void BScreen::nextWorkspace(int delta) { 1537void BScreen::nextWorkspace(int delta) {
1538 focusControl().stopCyclingFocus();
1538 if (delta) 1539 if (delta)
1539 changeWorkspaceID( (currentWorkspaceID() + delta) % numberOfWorkspaces()); 1540 changeWorkspaceID( (currentWorkspaceID() + delta) % numberOfWorkspaces());
1540 else if (m_former_workspace) 1541 else if (m_former_workspace)
@@ -1545,6 +1546,7 @@ void BScreen::nextWorkspace(int delta) {
1545 Goes to the workspace "left" of the current 1546 Goes to the workspace "left" of the current
1546*/ 1547*/
1547void BScreen::prevWorkspace(int delta) { 1548void BScreen::prevWorkspace(int delta) {
1549 focusControl().stopCyclingFocus();
1548 if (delta) 1550 if (delta)
1549 changeWorkspaceID( (static_cast<signed>(numberOfWorkspaces()) + currentWorkspaceID() - (delta % numberOfWorkspaces())) % numberOfWorkspaces()); 1551 changeWorkspaceID( (static_cast<signed>(numberOfWorkspaces()) + currentWorkspaceID() - (delta % numberOfWorkspaces())) % numberOfWorkspaces());
1550 else if (m_former_workspace) 1552 else if (m_former_workspace)
@@ -1555,6 +1557,7 @@ void BScreen::prevWorkspace(int delta) {
1555 Goes to the workspace "right" of the current 1557 Goes to the workspace "right" of the current
1556*/ 1558*/
1557void BScreen::rightWorkspace(int delta) { 1559void BScreen::rightWorkspace(int delta) {
1560 focusControl().stopCyclingFocus();
1558 if (currentWorkspaceID()+delta < numberOfWorkspaces()) 1561 if (currentWorkspaceID()+delta < numberOfWorkspaces())
1559 changeWorkspaceID(currentWorkspaceID()+delta); 1562 changeWorkspaceID(currentWorkspaceID()+delta);
1560} 1563}
@@ -1563,6 +1566,7 @@ void BScreen::rightWorkspace(int delta) {
1563 Goes to the workspace "left" of the current 1566 Goes to the workspace "left" of the current
1564*/ 1567*/
1565void BScreen::leftWorkspace(int delta) { 1568void BScreen::leftWorkspace(int delta) {
1569 focusControl().stopCyclingFocus();
1566 if (currentWorkspaceID() >= static_cast<unsigned int>(delta)) 1570 if (currentWorkspaceID() >= static_cast<unsigned int>(delta))
1567 changeWorkspaceID(currentWorkspaceID()-delta); 1571 changeWorkspaceID(currentWorkspaceID()-delta);
1568} 1572}
diff --git a/src/WorkspaceCmd.cc b/src/WorkspaceCmd.cc
index bca56c6..6d18b73 100644
--- a/src/WorkspaceCmd.cc
+++ b/src/WorkspaceCmd.cc
@@ -383,6 +383,7 @@ JumpToWorkspaceCmd::JumpToWorkspaceCmd(int workspace_num):m_workspace_num(worksp
383void JumpToWorkspaceCmd::execute() { 383void JumpToWorkspaceCmd::execute() {
384 BScreen *screen = Fluxbox::instance()->mouseScreen(); 384 BScreen *screen = Fluxbox::instance()->mouseScreen();
385 if (screen != 0) { 385 if (screen != 0) {
386 screen->focusControl().stopCyclingFocus();
386 int num = screen->numberOfWorkspaces(); 387 int num = screen->numberOfWorkspaces();
387 int actual = m_workspace_num; 388 int actual = m_workspace_num;
388 // we need an extra +1, since it's subtracted in FbCommandFactory 389 // we need an extra +1, since it's subtracted in FbCommandFactory