aboutsummaryrefslogtreecommitdiff
path: root/src/Workspace.cc
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 /src/Workspace.cc
parent7149b4dd5b403cdb7a84ca627496aeb997322abf (diff)
downloadfluxbox-c188d1d39a57d9a16a220a0663024fcd919b0ad0.zip
fluxbox-c188d1d39a57d9a16a220a0663024fcd919b0ad0.tar.bz2
minor cleaning
Diffstat (limited to 'src/Workspace.cc')
-rw-r--r--src/Workspace.cc48
1 files changed, 17 insertions, 31 deletions
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())