aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2005-07-04 18:18:32 (GMT)
committerfluxgen <fluxgen>2005-07-04 18:18:32 (GMT)
commit1727656e0a36cd9095e173dfa43200ed14c178d1 (patch)
tree200a048b9f7ed888047fb0a4fd82660c349087c6
parent9049dd33d31ccc03dd3f130681eb481d2b3ff0e6 (diff)
downloadfluxbox_paul-1727656e0a36cd9095e173dfa43200ed14c178d1.zip
fluxbox_paul-1727656e0a36cd9095e173dfa43200ed14c178d1.tar.bz2
cleaning, change getCount to numberOfWorkspace
-rw-r--r--src/CurrentWindowCmd.cc16
-rw-r--r--src/IconbarTool.cc12
-rw-r--r--src/Netizen.cc2
-rw-r--r--src/Screen.cc24
-rw-r--r--src/Screen.hh22
-rw-r--r--src/Window.cc17
-rw-r--r--src/Window.hh1
-rw-r--r--src/fluxbox.cc17
8 files changed, 46 insertions, 65 deletions
diff --git a/src/CurrentWindowCmd.cc b/src/CurrentWindowCmd.cc
index 4db34c1..f6b38aa 100644
--- a/src/CurrentWindowCmd.cc
+++ b/src/CurrentWindowCmd.cc
@@ -47,38 +47,38 @@ void SetHeadCmd::real_execute() {
47} 47}
48 48
49void SendToWorkspaceCmd::real_execute() { 49void SendToWorkspaceCmd::real_execute() {
50 if (m_workspace_num >= 0 && m_workspace_num < fbwindow().screen().getNumberOfWorkspaces()) 50 fbwindow().screen().sendToWorkspace(m_workspace_num, &fbwindow(), false);
51 fbwindow().screen().sendToWorkspace(m_workspace_num, &fbwindow(), false);
52} 51}
53 52
54void SendToNextWorkspaceCmd::real_execute() { 53void SendToNextWorkspaceCmd::real_execute() {
55 const int ws_nr = 54 const int ws_nr =
56 ( fbwindow().screen().currentWorkspaceID() + m_workspace_num ) % 55 ( fbwindow().screen().currentWorkspaceID() + m_workspace_num ) %
57 fbwindow().screen().getNumberOfWorkspaces(); 56 fbwindow().screen().numberOfWorkspaces();
58 fbwindow().screen().sendToWorkspace(ws_nr, &fbwindow(), false); 57 fbwindow().screen().sendToWorkspace(ws_nr, &fbwindow(), false);
59} 58}
60 59
61void SendToPrevWorkspaceCmd::real_execute() { 60void SendToPrevWorkspaceCmd::real_execute() {
62 int ws_nr = fbwindow().screen().currentWorkspaceID() - m_workspace_num; 61 int ws_nr = fbwindow().screen().currentWorkspaceID() - m_workspace_num;
63 if ( ws_nr < 0 ) ws_nr += fbwindow().screen().getNumberOfWorkspaces(); 62 if ( ws_nr < 0 )
63 ws_nr += fbwindow().screen().numberOfWorkspaces();
64 fbwindow().screen().sendToWorkspace(ws_nr, &fbwindow(), false); 64 fbwindow().screen().sendToWorkspace(ws_nr, &fbwindow(), false);
65} 65}
66 66
67void TakeToWorkspaceCmd::real_execute() { 67void TakeToWorkspaceCmd::real_execute() {
68 if (m_workspace_num >= 0 && m_workspace_num < fbwindow().screen().getNumberOfWorkspaces()) 68 fbwindow().screen().sendToWorkspace(m_workspace_num, &fbwindow());
69 fbwindow().screen().sendToWorkspace(m_workspace_num, &fbwindow());
70} 69}
71 70
72void TakeToNextWorkspaceCmd::real_execute() { 71void TakeToNextWorkspaceCmd::real_execute() {
73 unsigned int workspace_num= 72 unsigned int workspace_num=
74 ( fbwindow().screen().currentWorkspaceID() + m_workspace_num ) % 73 ( fbwindow().screen().currentWorkspaceID() + m_workspace_num ) %
75 fbwindow().screen().getNumberOfWorkspaces(); 74 fbwindow().screen().numberOfWorkspaces();
76 fbwindow().screen().sendToWorkspace(workspace_num, &fbwindow()); 75 fbwindow().screen().sendToWorkspace(workspace_num, &fbwindow());
77} 76}
78 77
79void TakeToPrevWorkspaceCmd::real_execute() { 78void TakeToPrevWorkspaceCmd::real_execute() {
80 int workspace_num= fbwindow().screen().currentWorkspaceID() - m_workspace_num; 79 int workspace_num= fbwindow().screen().currentWorkspaceID() - m_workspace_num;
81 if ( workspace_num < 0 ) workspace_num+= fbwindow().screen().getNumberOfWorkspaces(); 80 if ( workspace_num < 0 )
81 workspace_num += fbwindow().screen().numberOfWorkspaces();
82 fbwindow().screen().sendToWorkspace(workspace_num, &fbwindow()); 82 fbwindow().screen().sendToWorkspace(workspace_num, &fbwindow());
83} 83}
84 84
diff --git a/src/IconbarTool.cc b/src/IconbarTool.cc
index d86c7bc..c9de74c 100644
--- a/src/IconbarTool.cc
+++ b/src/IconbarTool.cc
@@ -877,8 +877,8 @@ void IconbarTool::addWindow(FluxboxWindow &win) {
877void IconbarTool::updateIcons() { 877void IconbarTool::updateIcons() {
878 std::list<FluxboxWindow *> itemlist; 878 std::list<FluxboxWindow *> itemlist;
879 // add icons to the itemlist 879 // add icons to the itemlist
880 BScreen::Icons::iterator icon_it = m_screen.getIconList().begin(); 880 BScreen::Icons::iterator icon_it = m_screen.iconList().begin();
881 BScreen::Icons::iterator icon_it_end = m_screen.getIconList().end(); 881 BScreen::Icons::iterator icon_it_end = m_screen.iconList().end();
882 for (; icon_it != icon_it_end; ++icon_it) { 882 for (; icon_it != icon_it_end; ++icon_it) {
883 if (mode() == ICONS) 883 if (mode() == ICONS)
884 itemlist.push_back(*icon_it); 884 itemlist.push_back(*icon_it);
@@ -904,8 +904,8 @@ void IconbarTool::updateWorkspace() {
904 904
905 // add icons from current workspace 905 // add icons from current workspace
906 if (mode() != WORKSPACENOICONS) { 906 if (mode() != WORKSPACENOICONS) {
907 BScreen::Icons::iterator icon_it = m_screen.getIconList().begin(); 907 BScreen::Icons::iterator icon_it = m_screen.iconList().begin();
908 BScreen::Icons::iterator icon_it_end = m_screen.getIconList().end(); 908 BScreen::Icons::iterator icon_it_end = m_screen.iconList().end();
909 for (; icon_it != icon_it_end; ++icon_it) { 909 for (; icon_it != icon_it_end; ++icon_it) {
910 if ((*icon_it)->workspaceNumber() == m_screen.currentWorkspaceID()) 910 if ((*icon_it)->workspaceNumber() == m_screen.currentWorkspaceID())
911 itemlist.push_back(*icon_it); 911 itemlist.push_back(*icon_it);
@@ -930,8 +930,8 @@ void IconbarTool::updateAllWindows() {
930 // add icons 930 // add icons
931 if(mode() != NOICONS && mode() != WORKSPACENOICONS) { 931 if(mode() != NOICONS && mode() != WORKSPACENOICONS) {
932 full_list.insert(full_list.end(), 932 full_list.insert(full_list.end(),
933 m_screen.getIconList().begin(), 933 m_screen.iconList().begin(),
934 m_screen.getIconList().end()); 934 m_screen.iconList().end());
935 } 935 }
936 936
937 removeDuplicate(m_icon_list, full_list); 937 removeDuplicate(m_icon_list, full_list);
diff --git a/src/Netizen.cc b/src/Netizen.cc
index a76b001..c220a83 100644
--- a/src/Netizen.cc
+++ b/src/Netizen.cc
@@ -50,7 +50,7 @@ Netizen::Netizen(const BScreen &scr, Window win):
50void Netizen::sendWorkspaceCount() { 50void Netizen::sendWorkspaceCount() {
51 51
52 event.xclient.data.l[0] = FbAtoms::instance()->getFluxboxNotifyWorkspaceCountAtom(); 52 event.xclient.data.l[0] = FbAtoms::instance()->getFluxboxNotifyWorkspaceCountAtom();
53 event.xclient.data.l[1] = m_screen.getCount(); 53 event.xclient.data.l[1] = m_screen.numberOfWorkspaces();
54 54
55 XSendEvent(m_display, window(), False, NoEventMask, &event); 55 XSendEvent(m_display, window(), False, NoEventMask, &event);
56} 56}
diff --git a/src/Screen.cc b/src/Screen.cc
index 926193d..3df9266 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -650,9 +650,9 @@ void BScreen::hideMenus() {
650#endif // SLIT 650#endif // SLIT
651 651
652 // hide icon menus 652 // hide icon menus
653 if (getIconList().size()) { 653 if (iconList().size()) {
654 Icons::iterator it = getIconList().begin(); 654 Icons::iterator it = iconList().begin();
655 const Icons::iterator it_end = getIconList().end(); 655 const Icons::iterator it_end = iconList().end();
656 for (; it != it_end; ++it) 656 for (; it != it_end; ++it)
657 (*it)->menu().hide(); 657 (*it)->menu().hide();
658 } 658 }
@@ -804,7 +804,7 @@ void BScreen::addIcon(FluxboxWindow *w) {
804 return; 804 return;
805 805
806 // make sure we have a unique list 806 // make sure we have a unique list
807 if (find(getIconList().begin(), getIconList().end(), w) != getIconList().end()) 807 if (find(iconList().begin(), iconList().end(), w) != iconList().end())
808 return; 808 return;
809 809
810 m_icon_list.push_back(w); 810 m_icon_list.push_back(w);
@@ -818,13 +818,13 @@ void BScreen::removeIcon(FluxboxWindow *w) {
818 if (w == 0) 818 if (w == 0)
819 return; 819 return;
820 820
821 Icons::iterator erase_it = remove_if(getIconList().begin(), 821 Icons::iterator erase_it = remove_if(iconList().begin(),
822 getIconList().end(), 822 iconList().end(),
823 bind2nd(equal_to<FluxboxWindow *>(), w)); 823 bind2nd(equal_to<FluxboxWindow *>(), w));
824 // no need to send iconlist signal if we didn't 824 // no need to send iconlist signal if we didn't
825 // change the iconlist 825 // change the iconlist
826 if (erase_it != m_icon_list.end()) { 826 if (erase_it != m_icon_list.end()) {
827 getIconList().erase(erase_it); 827 iconList().erase(erase_it);
828 m_iconlist_sig.notify(); 828 m_iconlist_sig.notify();
829 } 829 }
830} 830}
@@ -1354,7 +1354,7 @@ void BScreen::reassociateWindow(FluxboxWindow *w, unsigned int wkspc_id,
1354 if (w == 0) 1354 if (w == 0)
1355 return; 1355 return;
1356 1356
1357 if (wkspc_id >= getCount()) 1357 if (wkspc_id >= numberOfWorkspaces())
1358 wkspc_id = currentWorkspace()->workspaceID(); 1358 wkspc_id = currentWorkspace()->workspaceID();
1359 1359
1360 if (!w->isIconic() && w->workspaceNumber() == wkspc_id) 1360 if (!w->isIconic() && w->workspaceNumber() == wkspc_id)
@@ -1992,21 +1992,21 @@ void BScreen::setLayer(FbTk::XLayerItem &item, int layernum) {
1992 Goes to the workspace "right" of the current 1992 Goes to the workspace "right" of the current
1993*/ 1993*/
1994void BScreen::nextWorkspace(const int delta) { 1994void BScreen::nextWorkspace(const int delta) {
1995 changeWorkspaceID( (currentWorkspaceID() + delta) % getCount()); 1995 changeWorkspaceID( (currentWorkspaceID() + delta) % numberOfWorkspaces());
1996} 1996}
1997 1997
1998/** 1998/**
1999 Goes to the workspace "left" of the current 1999 Goes to the workspace "left" of the current
2000*/ 2000*/
2001void BScreen::prevWorkspace(const int delta) { 2001void BScreen::prevWorkspace(const int delta) {
2002 changeWorkspaceID( (currentWorkspaceID() - delta + getCount()) % getCount()); 2002 changeWorkspaceID( (currentWorkspaceID() - delta + numberOfWorkspaces()) % numberOfWorkspaces());
2003} 2003}
2004 2004
2005/** 2005/**
2006 Goes to the workspace "right" of the current 2006 Goes to the workspace "right" of the current
2007*/ 2007*/
2008void BScreen::rightWorkspace(const int delta) { 2008void BScreen::rightWorkspace(const int delta) {
2009 if (currentWorkspaceID()+delta < getCount()) 2009 if (currentWorkspaceID()+delta < numberOfWorkspaces())
2010 changeWorkspaceID(currentWorkspaceID()+delta); 2010 changeWorkspaceID(currentWorkspaceID()+delta);
2011} 2011}
2012 2012
@@ -2152,7 +2152,7 @@ void BScreen::notifyReleasedKeys(XKeyEvent &ke) {
2152 */ 2152 */
2153WinClient *BScreen::getLastFocusedWindow(int workspace) { 2153WinClient *BScreen::getLastFocusedWindow(int workspace) {
2154 if (focused_list.empty()) return 0; 2154 if (focused_list.empty()) return 0;
2155 if (workspace < 0 || workspace >= (int) getCount()) 2155 if (workspace < 0 || workspace >= (int) numberOfWorkspaces())
2156 return focused_list.front(); 2156 return focused_list.front();
2157 2157
2158 FocusedWindows::iterator it = focused_list.begin(); 2158 FocusedWindows::iterator it = focused_list.begin();
diff --git a/src/Screen.hh b/src/Screen.hh
index abebd02..d5de5bc 100644
--- a/src/Screen.hh
+++ b/src/Screen.hh
@@ -125,17 +125,15 @@ public:
125 inline const std::string &windowMenuFilename() const { return *resource.windowmenufile; } 125 inline const std::string &windowMenuFilename() const { return *resource.windowmenufile; }
126 inline FbTk::ImageControl &imageControl() { return *m_image_control.get(); } 126 inline FbTk::ImageControl &imageControl() { return *m_image_control.get(); }
127 // menus 127 // menus
128 const FbTk::Menu &getRootmenu() const { return *m_rootmenu.get(); } 128 const FbTk::Menu &rootMenu() const { return *m_rootmenu.get(); }
129 FbTk::Menu &getRootmenu() { return *m_rootmenu.get(); } 129 FbTk::Menu &rootMenu() { return *m_rootmenu.get(); }
130 const FbTk::Menu &configMenu() const { return *m_configmenu.get(); } 130 const FbTk::Menu &configMenu() const { return *m_configmenu.get(); }
131 FbTk::Menu &configMenu() { return *m_configmenu.get(); } 131 FbTk::Menu &configMenu() { return *m_configmenu.get(); }
132 const FbTk::Menu &windowMenu() const { return *m_windowmenu.get(); } 132 const FbTk::Menu &windowMenu() const { return *m_windowmenu.get(); }
133 FbTk::Menu &windowMenu() { return *m_windowmenu.get(); } 133 FbTk::Menu &windowMenu() { return *m_windowmenu.get(); }
134
135 ExtraMenus &extraWindowMenus() { return m_extramenus; } 134 ExtraMenus &extraWindowMenus() { return m_extramenus; }
136 const ExtraMenus &extraWindowMenus() const { return m_extramenus; } 135 const ExtraMenus &extraWindowMenus() const { return m_extramenus; }
137 136
138 inline const std::string &getRootCommand() const { return *resource.rootcommand; }
139 inline ResizeModel getResizeModel() const { return *resource.resize_model; } 137 inline ResizeModel getResizeModel() const { return *resource.resize_model; }
140 inline FocusModel getFocusModel() const { return *resource.focus_model; } 138 inline FocusModel getFocusModel() const { return *resource.focus_model; }
141 inline FollowModel getFollowModel() const { return *resource.follow_model; } 139 inline FollowModel getFollowModel() const { return *resource.follow_model; }
@@ -147,8 +145,8 @@ public:
147 inline Workspace *currentWorkspace() { return m_current_workspace; } 145 inline Workspace *currentWorkspace() { return m_current_workspace; }
148 inline const Workspace *currentWorkspace() const { return m_current_workspace; } 146 inline const Workspace *currentWorkspace() const { return m_current_workspace; }
149 147
150 const FbTk::Menu &getWorkspacemenu() const { return *m_workspacemenu.get(); } 148 const FbTk::Menu &workspaceMenu() const { return *m_workspacemenu.get(); }
151 FbTk::Menu &getWorkspacemenu() { return *m_workspacemenu.get(); } 149 FbTk::Menu &workspaceMenu() { return *m_workspacemenu.get(); }
152 150
153 151
154 unsigned int currentWorkspaceID() const; 152 unsigned int currentWorkspaceID() const;
@@ -169,11 +167,10 @@ public:
169 inline int screenNumber() const { return rootWindow().screenNumber(); } 167 inline int screenNumber() const { return rootWindow().screenNumber(); }
170 168
171 /// @return number of workspaces 169 /// @return number of workspaces
172 inline unsigned int getCount() const { return m_workspaces_list.size(); } 170 unsigned int numberOfWorkspaces() const { return m_workspaces_list.size(); }
173 /// @return number of icons 171
174 inline unsigned int getIconCount() const { return m_icon_list.size(); } 172 inline const Icons &iconList() const { return m_icon_list; }
175 inline const Icons &getIconList() const { return m_icon_list; } 173 inline Icons &iconList() { return m_icon_list; }
176 inline Icons &getIconList() { return m_icon_list; }
177 inline const FocusedWindows &getFocusedList() const { return focused_list; } 174 inline const FocusedWindows &getFocusedList() const { return focused_list; }
178 inline FocusedWindows &getFocusedList() { return focused_list; } 175 inline FocusedWindows &getFocusedList() { return focused_list; }
179 WinClient *getLastFocusedWindow(int workspace = -1); 176 WinClient *getLastFocusedWindow(int workspace = -1);
@@ -215,9 +212,6 @@ public:
215 /// hide all windowmenus except the given one (if given) 212 /// hide all windowmenus except the given one (if given)
216 void hideWindowMenus(const FluxboxWindow* except= 0); 213 void hideWindowMenus(const FluxboxWindow* except= 0);
217 214
218 /// @return the resource value of number of workspace
219 inline int getNumberOfWorkspaces() const { return *resource.workspaces; }
220
221 inline PlacementPolicy getPlacementPolicy() const { return *resource.placement_policy; } 215 inline PlacementPolicy getPlacementPolicy() const { return *resource.placement_policy; }
222 inline int getEdgeSnapThreshold() const { return *resource.edge_snap_threshold; } 216 inline int getEdgeSnapThreshold() const { return *resource.edge_snap_threshold; }
223 inline RowDirection getRowPlacementDirection() const { return *resource.row_direction; } 217 inline RowDirection getRowPlacementDirection() const { return *resource.row_direction; }
diff --git a/src/Window.cc b/src/Window.cc
index a8613c3..b7f78cf 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -503,7 +503,7 @@ void FluxboxWindow::init() {
503 503
504 restoreAttributes(); 504 restoreAttributes();
505 505
506 if (m_workspace_number < 0 || m_workspace_number >= screen().getCount()) 506 if (m_workspace_number < 0 || m_workspace_number >= screen().numberOfWorkspaces())
507 m_workspace_number = screen().currentWorkspaceID(); 507 m_workspace_number = screen().currentWorkspaceID();
508 508
509 bool place_window = (m_old_pos_x == 0); 509 bool place_window = (m_old_pos_x == 0);
@@ -2198,7 +2198,7 @@ void FluxboxWindow::restoreAttributes() {
2198 } 2198 }
2199 2199
2200 if (( m_blackbox_attrib.workspace != screen().currentWorkspaceID()) && 2200 if (( m_blackbox_attrib.workspace != screen().currentWorkspaceID()) &&
2201 ( m_blackbox_attrib.workspace < screen().getCount())) 2201 ( m_blackbox_attrib.workspace < screen().numberOfWorkspaces()))
2202 m_workspace_number = m_blackbox_attrib.workspace; 2202 m_workspace_number = m_blackbox_attrib.workspace;
2203 2203
2204 if (m_blackbox_attrib.flags & ATTRIB_OMNIPRESENT && 2204 if (m_blackbox_attrib.flags & ATTRIB_OMNIPRESENT &&
@@ -2267,8 +2267,6 @@ void FluxboxWindow::popupMenu() {
2267 return; 2267 return;
2268 } 2268 }
2269 2269
2270 WindowCmd<void>::setWindow(this);
2271
2272 menu().disableTitle(); 2270 menu().disableTitle();
2273 int menu_y = frame().titlebar().height() + frame().titlebar().borderWidth(); 2271 int menu_y = frame().titlebar().height() + frame().titlebar().borderWidth();
2274 if (!decorations.titlebar) // if we don't have any titlebar 2272 if (!decorations.titlebar) // if we don't have any titlebar
@@ -2278,13 +2276,6 @@ void FluxboxWindow::popupMenu() {
2278 showMenu(m_last_button_x, menu_y + frame().y()); 2276 showMenu(m_last_button_x, menu_y + frame().y());
2279} 2277}
2280 2278
2281/**
2282 Determine if this is the lowest tab of them all
2283*/
2284bool FluxboxWindow::isLowerTab() const {
2285 cerr<<__FILE__<<"(FluxboxWindow::isLowerTab()) TODO!"<<endl;
2286 return true;
2287}
2288 2279
2289/** 2280/**
2290 Redirect any unhandled event to our handlers 2281 Redirect any unhandled event to our handlers
@@ -2754,12 +2745,12 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) {
2754 if (me.x_root >= int(screen().width()) - warpPad - 1 && 2745 if (me.x_root >= int(screen().width()) - warpPad - 1 &&
2755 moved_x > 0) { 2746 moved_x > 0) {
2756 //warp right 2747 //warp right
2757 new_id = (cur_id + 1) % screen().getCount(); 2748 new_id = (cur_id + 1) % screen().numberOfWorkspaces();
2758 dx = - me.x_root; // move mouse back to x=0 2749 dx = - me.x_root; // move mouse back to x=0
2759 } else if (me.x_root <= warpPad && 2750 } else if (me.x_root <= warpPad &&
2760 moved_x < 0) { 2751 moved_x < 0) {
2761 //warp left 2752 //warp left
2762 new_id = (cur_id + screen().getCount() - 1) % screen().getCount(); 2753 new_id = (cur_id + screen().numberOfWorkspaces() - 1) % screen().numberOfWorkspaces();
2763 dx = screen().width() - me.x_root-1; // move mouse to screen width - 1 2754 dx = screen().width() - me.x_root-1; // move mouse to screen width - 1
2764 } 2755 }
2765 if (new_id != cur_id) { 2756 if (new_id != cur_id) {
diff --git a/src/Window.hh b/src/Window.hh
index 6d0c77f..b4fcdfb 100644
--- a/src/Window.hh
+++ b/src/Window.hh
@@ -340,7 +340,6 @@ public:
340 340
341 unsigned int titlebarHeight() const; 341 unsigned int titlebarHeight() const;
342 342
343 bool isLowerTab() const;
344 int initialState() const; 343 int initialState() const;
345 344
346 inline FbWinFrame &frame() { return m_frame; } 345 inline FbWinFrame &frame() { return m_frame; }
diff --git a/src/fluxbox.cc b/src/fluxbox.cc
index 58222d7..732e8a6 100644
--- a/src/fluxbox.cc
+++ b/src/fluxbox.cc
@@ -931,10 +931,10 @@ void Fluxbox::handleButtonEvent(XButtonEvent &be) {
931 if (! screen->isRootColormapInstalled()) 931 if (! screen->isRootColormapInstalled())
932 screen->imageControl().installRootColormap(); 932 screen->imageControl().installRootColormap();
933 // hide menus 933 // hide menus
934 if (screen->getRootmenu().isVisible()) 934 if (screen->rootMenu().isVisible())
935 screen->getRootmenu().hide(); 935 screen->rootMenu().hide();
936 if (screen->getWorkspacemenu().isVisible()) 936 if (screen->workspaceMenu().isVisible())
937 screen->getWorkspacemenu().hide(); 937 screen->workspaceMenu().hide();
938 938
939 } else if (be.button == 2) { 939 } else if (be.button == 2) {
940 FbCommands::ShowWorkspaceMenuCmd cmd; 940 FbCommands::ShowWorkspaceMenuCmd cmd;
@@ -1033,7 +1033,7 @@ void Fluxbox::handleClientMessage(XClientMessageEvent &ce) {
1033 BScreen *screen = searchScreen(ce.window); 1033 BScreen *screen = searchScreen(ce.window);
1034 1034
1035 if (screen && ce.data.l[0] >= 0 && 1035 if (screen && ce.data.l[0] >= 0 &&
1036 ce.data.l[0] < (signed)screen->getCount()) 1036 ce.data.l[0] < (signed)screen->numberOfWorkspaces())
1037 screen->changeWorkspaceID(ce.data.l[0]); 1037 screen->changeWorkspaceID(ce.data.l[0]);
1038 1038
1039 } else if (ce.message_type == m_fbatoms->getFluxboxChangeWindowFocusAtom()) { 1039 } else if (ce.message_type == m_fbatoms->getFluxboxChangeWindowFocusAtom()) {
@@ -1468,7 +1468,7 @@ void Fluxbox::save_rc() {
1468 sprintf(rc_string, "session.screen%d.workspaceNames: ", screen_number); 1468 sprintf(rc_string, "session.screen%d.workspaceNames: ", screen_number);
1469 string workspaces_string(rc_string); 1469 string workspaces_string(rc_string);
1470 1470
1471 for (unsigned int workspace=0; workspace < screen->getCount(); workspace++) { 1471 for (unsigned int workspace=0; workspace < screen->numberOfWorkspaces(); workspace++) {
1472 if (screen->getWorkspace(workspace)->name().size()!=0) 1472 if (screen->getWorkspace(workspace)->name().size()!=0)
1473 workspaces_string.append(screen->getWorkspace(workspace)->name()); 1473 workspaces_string.append(screen->getWorkspace(workspace)->name());
1474 else 1474 else
@@ -1575,10 +1575,7 @@ void Fluxbox::load_rc(BScreen &screen) {
1575 sprintf(class_lookup, "Session.Screen%d.WorkspaceNames", screen_number); 1575 sprintf(class_lookup, "Session.Screen%d.WorkspaceNames", screen_number);
1576 if (XrmGetResource(*database, name_lookup, class_lookup, &value_type, 1576 if (XrmGetResource(*database, name_lookup, class_lookup, &value_type,
1577 &value)) { 1577 &value)) {
1578#ifdef DEBUG 1578
1579 cerr<<__FILE__<<"("<<__FUNCTION__<<"): Workspaces="<<
1580 screen.getNumberOfWorkspaces()<<endl;
1581#endif // DEBUG
1582 string values(value.addr); 1579 string values(value.addr);
1583 BScreen::WorkspaceNames names; 1580 BScreen::WorkspaceNames names;
1584 1581