aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Screen.cc71
1 files changed, 35 insertions, 36 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index 1b27ff3..3964c9a 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Screen.cc,v 1.152 2003/05/10 22:52:44 fluxgen Exp $ 25// $Id: Screen.cc,v 1.153 2003/05/11 11:47:19 rathnor Exp $
26 26
27 27
28#include "Screen.hh" 28#include "Screen.hh"
@@ -1049,54 +1049,53 @@ int BScreen::removeLastWorkspace() {
1049 1049
1050 1050
1051void BScreen::changeWorkspaceID(unsigned int id) { 1051void BScreen::changeWorkspaceID(unsigned int id) {
1052 if (! current_workspace || id >= workspacesList.size()) 1052 if (! current_workspace || id >= workspacesList.size() ||
1053 id == current_workspace->workspaceID())
1053 return; 1054 return;
1054 1055
1055 if (id != current_workspace->workspaceID()) { 1056 XSync(FbTk::App::instance()->display(), true);
1056 XSync(FbTk::App::instance()->display(), true); 1057 FluxboxWindow *focused = Fluxbox::instance()->getFocusedWindow();
1057 FluxboxWindow *focused = Fluxbox::instance()->getFocusedWindow();
1058#ifdef DEBUG 1058#ifdef DEBUG
1059 cerr<<__FILE__<<"("<<__FUNCTION__<<"): focused = "<<focused<<endl; 1059 cerr<<__FILE__<<"("<<__FUNCTION__<<"): focused = "<<focused<<endl;
1060#endif // DEBUG 1060#endif // DEBUG
1061 1061
1062 if (focused && focused->isMoving()) { 1062 if (focused && focused->isMoving()) {
1063 if (doOpaqueMove()) 1063 if (doOpaqueMove())
1064 reassociateWindow(focused, id, true); 1064 reassociateWindow(focused, id, true);
1065 // don't reassociate if not opaque moving 1065 // don't reassociate if not opaque moving
1066 focused->pauseMoving(); 1066 focused->pauseMoving();
1067 } 1067 }
1068 1068
1069 // reassociate all windows that are stuck to the new workspace 1069 // reassociate all windows that are stuck to the new workspace
1070 Workspace *wksp = getCurrentWorkspace(); 1070 Workspace *wksp = getCurrentWorkspace();
1071 Workspace::Windows wins = wksp->getWindowList(); 1071 Workspace::Windows wins = wksp->getWindowList();
1072 Workspace::Windows::iterator it = wins.begin(); 1072 Workspace::Windows::iterator it = wins.begin();
1073 for (; it != wins.end(); ++it) { 1073 for (; it != wins.end(); ++it) {
1074 if ((*it)->isStuck()) { 1074 if ((*it)->isStuck()) {
1075 reassociateWindow(*it, id, true); 1075 reassociateWindow(*it, id, true);
1076 }
1077 } 1076 }
1077 }
1078 1078
1079 current_workspace->hideAll(); 1079 current_workspace->hideAll();
1080 1080
1081 workspacemenu->setItemSelected(current_workspace->workspaceID() + 2, false); 1081 workspacemenu->setItemSelected(current_workspace->workspaceID() + 2, false);
1082 1082
1083 // set new workspace 1083 // set new workspace
1084 current_workspace = getWorkspace(id); 1084 current_workspace = getWorkspace(id);
1085 1085
1086 workspacemenu->setItemSelected(current_workspace->workspaceID() + 2, true); 1086 workspacemenu->setItemSelected(current_workspace->workspaceID() + 2, true);
1087 if (getToolbar() != 0) 1087 if (getToolbar() != 0)
1088 getToolbar()->redrawWorkspaceLabel(true); 1088 getToolbar()->redrawWorkspaceLabel(true);
1089 1089
1090 current_workspace->showAll(); 1090 current_workspace->showAll();
1091 1091
1092 if (focused && (focused->isStuck() || focused->isMoving())) { 1092 if (focused && (focused->isStuck() || focused->isMoving())) {
1093 focused->setInputFocus(); 1093 focused->setInputFocus();
1094 } else 1094 } else
1095 Fluxbox::instance()->revertFocus(this); 1095 Fluxbox::instance()->revertFocus(this);
1096 1096
1097 if (focused && focused->isMoving()) { 1097 if (focused && focused->isMoving()) {
1098 focused->resumeMoving(); 1098 focused->resumeMoving();
1099 }
1100 } 1099 }
1101 1100
1102 updateNetizenCurrentWorkspace(); 1101 updateNetizenCurrentWorkspace();