aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-05-11 17:14:41 (GMT)
committerfluxgen <fluxgen>2003-05-11 17:14:41 (GMT)
commitc188d1d39a57d9a16a220a0663024fcd919b0ad0 (patch)
tree54869068a6d3b55fcaa77d910687faa04554a581
parent7149b4dd5b403cdb7a84ca627496aeb997322abf (diff)
downloadfluxbox-c188d1d39a57d9a16a220a0663024fcd919b0ad0.zip
fluxbox-c188d1d39a57d9a16a220a0663024fcd919b0ad0.tar.bz2
minor cleaning
-rw-r--r--src/Gnome.cc10
-rw-r--r--src/Screen.cc40
-rw-r--r--src/Screen.hh4
-rw-r--r--src/ToolbarHandler.cc6
-rw-r--r--src/Window.cc6
-rw-r--r--src/Workspace.cc48
-rw-r--r--src/Workspace.hh32
-rw-r--r--src/fluxbox.cc4
8 files changed, 68 insertions, 82 deletions
diff --git a/src/Gnome.cc b/src/Gnome.cc
index 6e4a8b7..72e8ddd 100644
--- a/src/Gnome.cc
+++ b/src/Gnome.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: Gnome.cc,v 1.21 2003/05/11 13:36:10 fluxgen Exp $ 22// $Id: Gnome.cc,v 1.22 2003/05/11 17:11:58 fluxgen Exp $
23 23
24#include "Gnome.hh" 24#include "Gnome.hh"
25 25
@@ -134,9 +134,9 @@ void Gnome::updateClientList(BScreen &screen) {
134 screen.getWorkspacesList().end(); 134 screen.getWorkspacesList().end();
135 for (; workspace_it != workspace_it_end; ++workspace_it) { 135 for (; workspace_it != workspace_it_end; ++workspace_it) {
136 Workspace::Windows::iterator win_it = 136 Workspace::Windows::iterator win_it =
137 (*workspace_it)->getWindowList().begin(); 137 (*workspace_it)->windowList().begin();
138 Workspace::Windows::iterator win_it_end = 138 Workspace::Windows::iterator win_it_end =
139 (*workspace_it)->getWindowList().end(); 139 (*workspace_it)->windowList().end();
140 for (; win_it != win_it_end; ++win_it) 140 for (; win_it != win_it_end; ++win_it)
141 num += (*win_it)->numClients(); 141 num += (*win_it)->numClients();
142 } 142 }
@@ -154,9 +154,9 @@ void Gnome::updateClientList(BScreen &screen) {
154 154
155 // Fill in array of window ID's 155 // Fill in array of window ID's
156 Workspace::Windows::const_iterator it = 156 Workspace::Windows::const_iterator it =
157 (*workspace_it)->getWindowList().begin(); 157 (*workspace_it)->windowList().begin();
158 Workspace::Windows::const_iterator it_end = 158 Workspace::Windows::const_iterator it_end =
159 (*workspace_it)->getWindowList().end(); 159 (*workspace_it)->windowList().end();
160 for (; it != it_end; ++it) { 160 for (; it != it_end; ++it) {
161 // TODO! 161 // TODO!
162 //check if the window don't want to be visible in the list 162 //check if the window don't want to be visible in the list
diff --git a/src/Screen.cc b/src/Screen.cc
index 3130499..d8c02ef 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.155 2003/05/11 15:26:34 fluxgen Exp $ 25// $Id: Screen.cc,v 1.156 2003/05/11 17:11:59 fluxgen Exp $
26 26
27 27
28#include "Screen.hh" 28#include "Screen.hh"
@@ -1068,7 +1068,7 @@ void BScreen::changeWorkspaceID(unsigned int id) {
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->windowList();
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()) {
@@ -1138,24 +1138,28 @@ void BScreen::sendToWorkspace(unsigned int id, FluxboxWindow *win, bool changeWS
1138} 1138}
1139 1139
1140 1140
1141void BScreen::addNetizen(Netizen *n) { 1141void BScreen::addNetizen(Window win) {
1142 netizenList.push_back(n); 1142 Netizen *net = new Netizen(*this, win);
1143 netizenList.push_back(net);
1143 1144
1144 n->sendWorkspaceCount(); 1145 net->sendWorkspaceCount();
1145 n->sendCurrentWorkspace(); 1146 net->sendCurrentWorkspace();
1146 1147
1148 // send all windows to netizen
1147 Workspaces::iterator it = workspacesList.begin(); 1149 Workspaces::iterator it = workspacesList.begin();
1148 Workspaces::iterator it_end = workspacesList.end(); 1150 Workspaces::iterator it_end = workspacesList.end();
1149 for (; it != it_end; ++it) { 1151 for (; it != it_end; ++it) {
1150 for (int i = 0; i < (*it)->getCount(); ++i) { 1152 Workspace::Windows::iterator win_it = (*it)->windowList().begin();
1151 n->sendWindowAdd((*it)->getWindow(i)->getClientWindow(), 1153 Workspace::Windows::iterator win_it_end = (*it)->windowList().end();
1154 for (; win_it != win_it_end; ++win_it) {
1155 net->sendWindowAdd((*win_it)->getClientWindow(),
1152 (*it)->workspaceID()); 1156 (*it)->workspaceID());
1153 } 1157 }
1154 } 1158 }
1155 1159
1156 Window f = ((Fluxbox::instance()->getFocusedWindow()) ? 1160 Window f = ((Fluxbox::instance()->getFocusedWindow()) ?
1157 Fluxbox::instance()->getFocusedWindow()->getClientWindow() : None); 1161 Fluxbox::instance()->getFocusedWindow()->getClientWindow() : None);
1158 n->sendWindowFocus(f); 1162 net->sendWindowFocus(f);
1159} 1163}
1160 1164
1161void BScreen::removeNetizen(Window w) { 1165void BScreen::removeNetizen(Window w) {
@@ -1475,7 +1479,7 @@ void BScreen::nextFocus(int opts) {
1475 bool have_focused = false; 1479 bool have_focused = false;
1476 int focused_window_number = -1; 1480 int focused_window_number = -1;
1477 FluxboxWindow *focused = Fluxbox::instance()->getFocusedWindow(); 1481 FluxboxWindow *focused = Fluxbox::instance()->getFocusedWindow();
1478 const int num_windows = getCurrentWorkspace()->getCount(); 1482 const int num_windows = getCurrentWorkspace()->numberOfWindows();
1479 1483
1480 if (focused != 0) { 1484 if (focused != 0) {
1481 if (focused->screen().getScreenNumber() == 1485 if (focused->screen().getScreenNumber() ==
@@ -1535,7 +1539,7 @@ void BScreen::nextFocus(int opts) {
1535 cycling_window = it; 1539 cycling_window = it;
1536 } else { // not stacked cycling 1540 } else { // not stacked cycling
1537 Workspace *wksp = getCurrentWorkspace(); 1541 Workspace *wksp = getCurrentWorkspace();
1538 Workspace::Windows &wins = wksp->getWindowList(); 1542 Workspace::Windows &wins = wksp->windowList();
1539 Workspace::Windows::iterator it = wins.begin(); 1543 Workspace::Windows::iterator it = wins.begin();
1540 1544
1541 if (!have_focused) { 1545 if (!have_focused) {
@@ -1565,7 +1569,7 @@ void BScreen::prevFocus(int opts) {
1565 bool have_focused = false; 1569 bool have_focused = false;
1566 int focused_window_number = -1; 1570 int focused_window_number = -1;
1567 FluxboxWindow *focused; 1571 FluxboxWindow *focused;
1568 int num_windows = getCurrentWorkspace()->getCount(); 1572 int num_windows = getCurrentWorkspace()->numberOfWindows();
1569 1573
1570 if ((focused = Fluxbox::instance()->getFocusedWindow())) { 1574 if ((focused = Fluxbox::instance()->getFocusedWindow())) {
1571 if (focused->screen().getScreenNumber() == 1575 if (focused->screen().getScreenNumber() ==
@@ -1578,7 +1582,7 @@ void BScreen::prevFocus(int opts) {
1578 if (num_windows >= 1) { 1582 if (num_windows >= 1) {
1579 if (!(opts & CYCLELINEAR)) { 1583 if (!(opts & CYCLELINEAR)) {
1580 if (!cycling_focus) { 1584 if (!cycling_focus) {
1581 cycling_focus = True; 1585 cycling_focus = true;
1582 cycling_window = focused_list.end(); 1586 cycling_window = focused_list.end();
1583 cycling_last = 0; 1587 cycling_last = 0;
1584 } else { 1588 } else {
@@ -1628,7 +1632,7 @@ void BScreen::prevFocus(int opts) {
1628 } else { // not stacked cycling 1632 } else { // not stacked cycling
1629 1633
1630 Workspace *wksp = getCurrentWorkspace(); 1634 Workspace *wksp = getCurrentWorkspace();
1631 Workspace::Windows &wins = wksp->getWindowList(); 1635 Workspace::Windows &wins = wksp->windowList();
1632 Workspace::Windows::iterator it = wins.begin(); 1636 Workspace::Windows::iterator it = wins.begin();
1633 1637
1634 if (!have_focused) { 1638 if (!have_focused) {
@@ -1666,7 +1670,7 @@ void BScreen::raiseFocus() {
1666 focused_window_number = fb->getFocusedWindow()->getWindowNumber(); 1670 focused_window_number = fb->getFocusedWindow()->getWindowNumber();
1667 } 1671 }
1668 1672
1669 if ((getCurrentWorkspace()->getCount() > 1) && have_focused) 1673 if ((getCurrentWorkspace()->numberOfWindows() > 1) && have_focused)
1670 fb->getFocusedWindow()->raise(); 1674 fb->getFocusedWindow()->raise();
1671} 1675}
1672 1676
@@ -1693,7 +1697,7 @@ void BScreen::dirFocus(FluxboxWindow &win, FocusDir dir) {
1693 left = win.getXFrame(), 1697 left = win.getXFrame(),
1694 right = win.getXFrame() + win.width() + 2*borderW; 1698 right = win.getXFrame() + win.width() + 2*borderW;
1695 1699
1696 Workspace::Windows &wins = getCurrentWorkspace()->getWindowList(); 1700 Workspace::Windows &wins = getCurrentWorkspace()->windowList();
1697 Workspace::Windows::iterator it = wins.begin(); 1701 Workspace::Windows::iterator it = wins.begin();
1698 for (; it != wins.end(); ++it) { 1702 for (; it != wins.end(); ++it) {
1699 if ((*it) == &win) continue; // skip self 1703 if ((*it) == &win) continue; // skip self
@@ -2378,14 +2382,14 @@ void BScreen::setLayer(FbTk::XLayerItem &item, int layernum) {
2378 Goes to the workspace "right" of the current 2382 Goes to the workspace "right" of the current
2379*/ 2383*/
2380void BScreen::nextWorkspace(const int delta) { 2384void BScreen::nextWorkspace(const int delta) {
2381 changeWorkspaceID( (getCurrentWorkspaceID()+delta) % getCount()); 2385 changeWorkspaceID( (getCurrentWorkspaceID() + delta) % getCount());
2382} 2386}
2383 2387
2384/** 2388/**
2385 Goes to the workspace "left" of the current 2389 Goes to the workspace "left" of the current
2386*/ 2390*/
2387void BScreen::prevWorkspace(const int delta) { 2391void BScreen::prevWorkspace(const int delta) {
2388 changeWorkspaceID( (getCurrentWorkspaceID()-delta+getCount()) % getCount()); 2392 changeWorkspaceID( (getCurrentWorkspaceID() - delta + getCount()) % getCount());
2389} 2393}
2390 2394
2391/** 2395/**
diff --git a/src/Screen.hh b/src/Screen.hh
index c87bfa8..9f72f5b 100644
--- a/src/Screen.hh
+++ b/src/Screen.hh
@@ -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.hh,v 1.92 2003/05/10 22:45:08 fluxgen Exp $ 25// $Id: Screen.hh,v 1.93 2003/05/11 17:11:58 fluxgen Exp $
26 26
27#ifndef SCREEN_HH 27#ifndef SCREEN_HH
28#define SCREEN_HH 28#define SCREEN_HH
@@ -252,7 +252,7 @@ public:
252 void updateWorkspaceNamesAtom(); 252 void updateWorkspaceNamesAtom();
253 253
254 void addWorkspaceName(const char *name); 254 void addWorkspaceName(const char *name);
255 void addNetizen(Netizen *net); 255 void addNetizen(Window win);
256 void removeNetizen(Window win); 256 void removeNetizen(Window win);
257 void addIcon(FluxboxWindow *win); 257 void addIcon(FluxboxWindow *win);
258 void removeIcon(FluxboxWindow *win); 258 void removeIcon(FluxboxWindow *win);
diff --git a/src/ToolbarHandler.cc b/src/ToolbarHandler.cc
index 8a40bbe..f723818 100644
--- a/src/ToolbarHandler.cc
+++ b/src/ToolbarHandler.cc
@@ -20,7 +20,7 @@
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE. 21// DEALINGS IN THE SOFTWARE.
22 22
23// $Id: ToolbarHandler.cc,v 1.9 2003/05/11 13:36:11 fluxgen Exp $ 23// $Id: ToolbarHandler.cc,v 1.10 2003/05/11 17:11:58 fluxgen Exp $
24 24
25/** 25/**
26 * The ToolbarHandler class acts as a rough interface to the toolbar. 26 * The ToolbarHandler class acts as a rough interface to the toolbar.
@@ -152,7 +152,7 @@ void ToolbarHandler::initForScreen(BScreen &screen) {
152 BScreen::Workspaces::const_iterator workspace_it = m_screen.getWorkspacesList().begin(); 152 BScreen::Workspaces::const_iterator workspace_it = m_screen.getWorkspacesList().begin();
153 BScreen::Workspaces::const_iterator workspace_it_end = m_screen.getWorkspacesList().end(); 153 BScreen::Workspaces::const_iterator workspace_it_end = m_screen.getWorkspacesList().end();
154 for (; workspace_it != workspace_it_end; ++workspace_it) { 154 for (; workspace_it != workspace_it_end; ++workspace_it) {
155 Workspace::Windows &wins = (*workspace_it)->getWindowList(); 155 Workspace::Windows &wins = (*workspace_it)->windowList();
156 Workspace::Windows::iterator wit = wins.begin(); 156 Workspace::Windows::iterator wit = wins.begin();
157 Workspace::Windows::iterator wit_end = wins.end(); 157 Workspace::Windows::iterator wit_end = wins.end();
158 for (; wit != wit_end; ++wit) { 158 for (; wit != wit_end; ++wit) {
@@ -180,7 +180,7 @@ void ToolbarHandler::initForScreen(BScreen &screen) {
180 break; 180 break;
181 case WORKSPACE: 181 case WORKSPACE:
182 { 182 {
183 Workspace::Windows &wins = m_screen.getCurrentWorkspace()->getWindowList(); 183 Workspace::Windows &wins = m_screen.getCurrentWorkspace()->windowList();
184 Workspace::Windows::iterator wit = wins.begin(); 184 Workspace::Windows::iterator wit = wins.begin();
185 Workspace::Windows::iterator wit_end = wins.end(); 185 Workspace::Windows::iterator wit_end = wins.end();
186 for (; wit != wit_end; ++wit) { 186 for (; wit != wit_end; ++wit) {
diff --git a/src/Window.cc b/src/Window.cc
index 4e49091..9b563b0 100644
--- a/src/Window.cc
+++ b/src/Window.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: Window.cc,v 1.170 2003/05/11 15:32:23 fluxgen Exp $ 25// $Id: Window.cc,v 1.171 2003/05/11 17:14:41 fluxgen Exp $
26 26
27#include "Window.hh" 27#include "Window.hh"
28 28
@@ -857,7 +857,7 @@ void FluxboxWindow::getWMProtocols() {
857 else if (proto[i] == fbatoms->getWMTakeFocusAtom()) 857 else if (proto[i] == fbatoms->getWMTakeFocusAtom())
858 send_focus_message = true; 858 send_focus_message = true;
859 else if (proto[i] == fbatoms->getFluxboxStructureMessagesAtom()) 859 else if (proto[i] == fbatoms->getFluxboxStructureMessagesAtom())
860 screen().addNetizen(new Netizen(screen(), m_client->window())); 860 screen().addNetizen(m_client->window());
861 } 861 }
862 862
863 XFree(proto); 863 XFree(proto);
@@ -2855,7 +2855,7 @@ void FluxboxWindow::doSnapping(int &orig_left, int &orig_top) {
2855 // now check window edges 2855 // now check window edges
2856 2856
2857 Workspace::Windows &wins = 2857 Workspace::Windows &wins =
2858 screen().getCurrentWorkspace()->getWindowList(); 2858 screen().getCurrentWorkspace()->windowList();
2859 2859
2860 Workspace::Windows::iterator it = wins.begin(); 2860 Workspace::Windows::iterator it = wins.begin();
2861 Workspace::Windows::iterator it_end = wins.end(); 2861 Workspace::Windows::iterator it_end = wins.end();
diff --git a/src/Workspace.cc b/src/Workspace.cc
index 5a882b3..c5e6d73 100644
--- a/src/Workspace.cc
+++ b/src/Workspace.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: Workspace.cc,v 1.62 2003/05/11 15:35:03 fluxgen Exp $ 25// $Id: Workspace.cc,v 1.63 2003/05/11 17:14:41 fluxgen Exp $
26 26
27#include "Workspace.hh" 27#include "Workspace.hh"
28 28
@@ -114,12 +114,12 @@ Workspace::GroupList Workspace::m_groups;
114 114
115Workspace::Workspace(BScreen &scrn, FbTk::MultLayers &layermanager, unsigned int i): 115Workspace::Workspace(BScreen &scrn, FbTk::MultLayers &layermanager, unsigned int i):
116 m_screen(scrn), 116 m_screen(scrn),
117 lastfocus(0), 117 m_lastfocus(0),
118 m_clientmenu(*scrn.menuTheme(), scrn.getScreenNumber(), *scrn.getImageControl()), 118 m_clientmenu(*scrn.menuTheme(), scrn.getScreenNumber(), *scrn.getImageControl()),
119 m_layermanager(layermanager), 119 m_layermanager(layermanager),
120 m_name(""), 120 m_name(""),
121 m_id(i), 121 m_id(i),
122 cascade_x(32), cascade_y(32) { 122 m_cascade_x(32), m_cascade_y(32) {
123 123
124 m_clientmenu.setInternalMenu(); 124 m_clientmenu.setInternalMenu();
125 setName(screen().getNameOfWorkspace(m_id)); 125 setName(screen().getNameOfWorkspace(m_id));
@@ -134,9 +134,9 @@ Workspace::~Workspace() {
134void Workspace::setLastFocusedWindow(FluxboxWindow *win) { 134void Workspace::setLastFocusedWindow(FluxboxWindow *win) {
135 // make sure we have this window in the list 135 // make sure we have this window in the list
136 if (std::find(m_windowlist.begin(), m_windowlist.end(), win) != m_windowlist.end()) 136 if (std::find(m_windowlist.begin(), m_windowlist.end(), win) != m_windowlist.end())
137 lastfocus = win; 137 m_lastfocus = win;
138 else 138 else
139 lastfocus = 0; 139 m_lastfocus = 0;
140} 140}
141 141
142int Workspace::addWindow(FluxboxWindow &w, bool place) { 142int Workspace::addWindow(FluxboxWindow &w, bool place) {
@@ -212,8 +212,8 @@ int Workspace::removeWindow(FluxboxWindow *w) {
212 if (w == 0) 212 if (w == 0)
213 return -1; 213 return -1;
214 214
215 if (lastfocus == w) { 215 if (m_lastfocus == w) {
216 lastfocus = 0; 216 m_lastfocus = 0;
217 } 217 }
218 218
219 if (w->isFocused()) { 219 if (w->isFocused()) {
@@ -246,8 +246,8 @@ int Workspace::removeWindow(FluxboxWindow *w) {
246 246
247 updateClientmenu(); 247 updateClientmenu();
248 248
249 if (lastfocus == w || m_windowlist.empty()) 249 if (m_lastfocus == w || m_windowlist.empty())
250 lastfocus = 0; 250 m_lastfocus = 0;
251 251
252 if (!w->isStuck()) { 252 if (!w->isStuck()) {
253 FluxboxWindow::ClientList::iterator client_it = 253 FluxboxWindow::ClientList::iterator client_it =
@@ -314,21 +314,7 @@ void Workspace::reconfigure() {
314 } 314 }
315} 315}
316 316
317 317int Workspace::numberOfWindows() const {
318const FluxboxWindow *Workspace::getWindow(unsigned int index) const {
319 if (index < m_windowlist.size())
320 return m_windowlist[index];
321 return 0;
322}
323
324FluxboxWindow *Workspace::getWindow(unsigned int index) {
325 if (index < m_windowlist.size())
326 return m_windowlist[index];
327 return 0;
328}
329
330
331int Workspace::getCount() const {
332 return m_windowlist.size(); 318 return m_windowlist.size();
333} 319}
334 320
@@ -670,15 +656,15 @@ void Workspace::placeWindow(FluxboxWindow &win) {
670 // cascade placement or smart placement failed 656 // cascade placement or smart placement failed
671 if (! placed) { 657 if (! placed) {
672 658
673 if (((unsigned) cascade_x > (screen().getWidth() / 2)) || 659 if (((unsigned) m_cascade_x > (screen().getWidth() / 2)) ||
674 ((unsigned) cascade_y > (screen().getHeight() / 2))) 660 ((unsigned) m_cascade_y > (screen().getHeight() / 2)))
675 cascade_x = cascade_y = 32; 661 m_cascade_x = m_cascade_y = 32;
676 662
677 place_x = cascade_x; 663 place_x = m_cascade_x;
678 place_y = cascade_y; 664 place_y = m_cascade_y;
679 665
680 cascade_x += win.getTitleHeight(); 666 m_cascade_x += win.getTitleHeight();
681 cascade_y += win.getTitleHeight(); 667 m_cascade_y += win.getTitleHeight();
682 } 668 }
683 669
684 if (place_x + win_w > (signed) screen().getWidth()) 670 if (place_x + win_w > (signed) screen().getWidth())
diff --git a/src/Workspace.hh b/src/Workspace.hh
index bb7db8f..5862e50 100644
--- a/src/Workspace.hh
+++ b/src/Workspace.hh
@@ -1,5 +1,5 @@
1// Workspace.hh for Fluxbox 1// Workspace.hh for Fluxbox
2// Copyright (c) 2002 Henrik Kinnunen (fluxgen@linuxmail.org) 2// Copyright (c) 2002-2003 Henrik Kinnunen (fluxgen(at)users.sourceforge.net)
3// 3//
4// Workspace.hh for Blackbox - an X11 Window manager 4// Workspace.hh for Blackbox - an X11 Window manager
5// Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) 5// Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net)
@@ -52,9 +52,8 @@ public:
52 ~Workspace(); 52 ~Workspace();
53 53
54 void setLastFocusedWindow(FluxboxWindow *w); 54 void setLastFocusedWindow(FluxboxWindow *w);
55 /** 55
56 Set workspace name 56 /// Set workspace name
57 */
58 void setName(const std::string &name); 57 void setName(const std::string &name);
59 void showAll(); 58 void showAll();
60 void hideAll(); 59 void hideAll();
@@ -66,11 +65,13 @@ public:
66 int addWindow(FluxboxWindow &win, bool place = false); 65 int addWindow(FluxboxWindow &win, bool place = false);
67 int removeWindow(FluxboxWindow *win); 66 int removeWindow(FluxboxWindow *win);
68 void removeWindow(WinClient &client); 67 void removeWindow(WinClient &client);
69 BScreen &screen() { return m_screen; }
70 FluxboxWindow *getLastFocusedWindow() { return lastfocus; }
71 68
69 BScreen &screen() { return m_screen; }
72 const BScreen &screen() const { return m_screen; } 70 const BScreen &screen() const { return m_screen; }
73 const FluxboxWindow *getLastFocusedWindow() const { return lastfocus; } 71
72 FluxboxWindow *lastFocusedWindow() { return m_lastfocus; }
73 const FluxboxWindow *lastFocusedWindow() const { return m_lastfocus; }
74
74 FbTk::Menu &menu() { return m_clientmenu; } 75 FbTk::Menu &menu() { return m_clientmenu; }
75 inline const FbTk::Menu &menu() const { return m_clientmenu; } 76 inline const FbTk::Menu &menu() const { return m_clientmenu; }
76 /// name of this workspace 77 /// name of this workspace
@@ -79,18 +80,13 @@ public:
79 @return the number of this workspace, note: obsolete, should be in BScreen 80 @return the number of this workspace, note: obsolete, should be in BScreen
80 */ 81 */
81 inline unsigned int workspaceID() const { return m_id; } 82 inline unsigned int workspaceID() const { return m_id; }
82 /** 83
83 @param id the window id number 84 const Windows &windowList() const { return m_windowlist; }
84 @return window that match the id, else 0 85 Windows &windowList() { return m_windowlist; }
85 */
86 FluxboxWindow *getWindow(unsigned int id);
87 const FluxboxWindow *getWindow(unsigned int id) const;
88 const Windows &getWindowList() const { return m_windowlist; }
89 Windows &getWindowList() { return m_windowlist; }
90 86
91 bool isCurrent() const; 87 bool isCurrent() const;
92 bool isLastWindow(FluxboxWindow *window) const; 88 bool isLastWindow(FluxboxWindow *window) const;
93 int getCount() const; 89 int numberOfWindows() const;
94 void checkGrouping(FluxboxWindow &win); 90 void checkGrouping(FluxboxWindow &win);
95 static bool loadGroups(const std::string &filename); 91 static bool loadGroups(const std::string &filename);
96protected: 92protected:
@@ -100,7 +96,7 @@ private:
100 void updateClientmenu(); 96 void updateClientmenu();
101 97
102 BScreen &m_screen; 98 BScreen &m_screen;
103 FluxboxWindow *lastfocus; 99 FluxboxWindow *m_lastfocus;
104 FbTk::Menu m_clientmenu; 100 FbTk::Menu m_clientmenu;
105 101
106 typedef std::list<FluxboxWindow *> WindowStack; 102 typedef std::list<FluxboxWindow *> WindowStack;
@@ -114,7 +110,7 @@ private:
114 110
115 std::string m_name; ///< name of this workspace 111 std::string m_name; ///< name of this workspace
116 unsigned int m_id; ///< id, obsolete, this should be in BScreen 112 unsigned int m_id; ///< id, obsolete, this should be in BScreen
117 int cascade_x, cascade_y; 113 int m_cascade_x, m_cascade_y;
118}; 114};
119 115
120 116
diff --git a/src/fluxbox.cc b/src/fluxbox.cc
index b7727e8..9969593 100644
--- a/src/fluxbox.cc
+++ b/src/fluxbox.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: fluxbox.cc,v 1.136 2003/05/11 15:24:09 fluxgen Exp $ 25// $Id: fluxbox.cc,v 1.137 2003/05/11 17:11:59 fluxgen Exp $
26 26
27#include "fluxbox.hh" 27#include "fluxbox.hh"
28 28
@@ -1242,7 +1242,7 @@ void Fluxbox::handleKeyEvent(XKeyEvent &ke) {
1242 //!! just attach last window to focused window 1242 //!! just attach last window to focused window
1243 if (m_focused_window) { 1243 if (m_focused_window) {
1244 Workspace *space = keyscreen->getCurrentWorkspace(); 1244 Workspace *space = keyscreen->getCurrentWorkspace();
1245 Workspace::Windows &wins = space->getWindowList(); 1245 Workspace::Windows &wins = space->windowList();
1246 if (wins.size() == 1) 1246 if (wins.size() == 1)
1247 break; 1247 break;
1248 BScreen::FocusedWindows &fwins = keyscreen->getFocusedList(); 1248 BScreen::FocusedWindows &fwins = keyscreen->getFocusedList();