aboutsummaryrefslogtreecommitdiff
path: root/src/Screen.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Screen.cc')
-rw-r--r--src/Screen.cc15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index c24250a..17d8c23 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -194,6 +194,7 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
194 m_layermanager(num_layers), 194 m_layermanager(num_layers),
195 root_colormap_installed(false), 195 root_colormap_installed(false),
196 m_current_workspace(0), 196 m_current_workspace(0),
197 m_former_workspace(0),
197 m_focused_windowtheme(new FbWinFrameTheme(scrn, ".focus", ".Focus")), 198 m_focused_windowtheme(new FbWinFrameTheme(scrn, ".focus", ".Focus")),
198 m_unfocused_windowtheme(new FbWinFrameTheme(scrn, ".unfocus", ".Unfocus")), 199 m_unfocused_windowtheme(new FbWinFrameTheme(scrn, ".unfocus", ".Unfocus")),
199 // the order of windowtheme and winbutton theme is important 200 // the order of windowtheme and winbutton theme is important
@@ -919,6 +920,8 @@ int BScreen::removeLastWorkspace() {
919 920
920 if (m_current_workspace->workspaceID() == wkspc->workspaceID()) 921 if (m_current_workspace->workspaceID() == wkspc->workspaceID())
921 changeWorkspaceID(m_current_workspace->workspaceID() - 1); 922 changeWorkspaceID(m_current_workspace->workspaceID() - 1);
923 if (m_former_workspace && m_former_workspace->workspaceID() == wkspc->workspaceID())
924 m_former_workspace = 0;
922 925
923 wkspc->removeAll(wkspc->workspaceID()-1); 926 wkspc->removeAll(wkspc->workspaceID()-1);
924 927
@@ -950,6 +953,8 @@ void BScreen::changeWorkspaceID(unsigned int id, bool revert) {
950 id == m_current_workspace->workspaceID()) 953 id == m_current_workspace->workspaceID())
951 return; 954 return;
952 955
956 m_former_workspace = m_current_workspace;
957
953 /* Ignore all EnterNotify events until the pointer actually moves */ 958 /* Ignore all EnterNotify events until the pointer actually moves */
954 this->focusControl().ignoreAtPointer(); 959 this->focusControl().ignoreAtPointer();
955 960
@@ -1524,14 +1529,20 @@ void BScreen::setLayer(FbTk::LayerItem &item, int layernum) {
1524 Goes to the workspace "right" of the current 1529 Goes to the workspace "right" of the current
1525*/ 1530*/
1526void BScreen::nextWorkspace(int delta) { 1531void BScreen::nextWorkspace(int delta) {
1527 changeWorkspaceID( (currentWorkspaceID() + delta) % numberOfWorkspaces()); 1532 if (delta)
1533 changeWorkspaceID( (currentWorkspaceID() + delta) % numberOfWorkspaces());
1534 else if (m_former_workspace)
1535 changeWorkspaceID(m_former_workspace->workspaceID());
1528} 1536}
1529 1537
1530/** 1538/**
1531 Goes to the workspace "left" of the current 1539 Goes to the workspace "left" of the current
1532*/ 1540*/
1533void BScreen::prevWorkspace(int delta) { 1541void BScreen::prevWorkspace(int delta) {
1534 changeWorkspaceID( (static_cast<signed>(numberOfWorkspaces()) + currentWorkspaceID() - (delta % numberOfWorkspaces())) % numberOfWorkspaces()); 1542 if (delta)
1543 changeWorkspaceID( (static_cast<signed>(numberOfWorkspaces()) + currentWorkspaceID() - (delta % numberOfWorkspaces())) % numberOfWorkspaces());
1544 else if (m_former_workspace)
1545 changeWorkspaceID(m_former_workspace->workspaceID());
1535} 1546}
1536 1547
1537/** 1548/**