aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-06-13 20:50:49 (GMT)
committerfluxgen <fluxgen>2003-06-13 20:50:49 (GMT)
commitc60b20fda66cfe0e904d7ea865fa1e7c34b4dc8d (patch)
tree1a1a1ea6b65921dcfa590d8f37c81db9daa1284c /src
parentbad0725b227a24c9761440a8fef6317a327b3093 (diff)
downloadfluxbox-c60b20fda66cfe0e904d7ea865fa1e7c34b4dc8d.zip
fluxbox-c60b20fda66cfe0e904d7ea865fa1e7c34b4dc8d.tar.bz2
fixed autogrouping, checkGrouping now returns true or false...
Diffstat (limited to 'src')
-rw-r--r--src/Workspace.cc21
-rw-r--r--src/Workspace.hh2
2 files changed, 15 insertions, 8 deletions
diff --git a/src/Workspace.cc b/src/Workspace.cc
index dc60873..89efbf5 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.71 2003/06/12 14:30:00 fluxgen Exp $ 25// $Id: Workspace.cc,v 1.72 2003/06/13 20:50:49 fluxgen Exp $
26 26
27#include "Workspace.hh" 27#include "Workspace.hh"
28 28
@@ -340,7 +340,7 @@ private:
340}; 340};
341 341
342//Note: this function doesn't check if the window is groupable 342//Note: this function doesn't check if the window is groupable
343void Workspace::checkGrouping(FluxboxWindow &win) { 343bool Workspace::checkGrouping(FluxboxWindow &win) {
344#ifdef DEBUG 344#ifdef DEBUG
345 cerr<<__FILE__<<"("<<__LINE__<<"): Checking grouping. ("<<win.instanceName()<<"/"<< 345 cerr<<__FILE__<<"("<<__LINE__<<"): Checking grouping. ("<<win.instanceName()<<"/"<<
346 win.className()<<")"<<endl; 346 win.className()<<")"<<endl;
@@ -349,7 +349,7 @@ void Workspace::checkGrouping(FluxboxWindow &win) {
349#ifdef DEBUG 349#ifdef DEBUG
350 cerr<<__FILE__<<"("<<__LINE__<<"): window can't use a tab"<<endl; 350 cerr<<__FILE__<<"("<<__LINE__<<"): window can't use a tab"<<endl;
351#endif // DEBUG 351#endif // DEBUG
352 return; 352 return false;
353 } 353 }
354 354
355 // go throu every group and search for matching win instancename 355 // go throu every group and search for matching win instancename
@@ -370,18 +370,25 @@ void Workspace::checkGrouping(FluxboxWindow &win) {
370#ifdef DEBUG 370#ifdef DEBUG
371 cerr<<__FILE__<<" check group with : "<<(*wit)->instanceName()<<endl; 371 cerr<<__FILE__<<" check group with : "<<(*wit)->instanceName()<<endl;
372#endif // DEBUG 372#endif // DEBUG
373 if (find_if((*g).begin(), (*g).end(), FindInGroup(*(*wit))) != (*g).end()) { 373 if (find_if((*g).begin(),
374 (*g).end(),
375 FindInGroup(*(*wit))) != (*g).end()) {
374 // make sure the window is groupable 376 // make sure the window is groupable
375 if ( !(*wit)->isGroupable()) 377 if ( !(*wit)->isGroupable() && (*wit)->winClient().fbwindow() == &win)
376 break; // try next name 378 break; // try next name
377 cerr<<__FILE__<<"("<<__FUNCTION__<<") TODO attach client here!"<<endl; 379#ifdef DEBUG
378 return; // grouping done 380 cerr<<__FILE__<<"("<<__FUNCTION__<<"): window ("<<*wit<<") attaching window ("<<&win<<")"<<endl;
381#endif // DEBUG
382 (*wit)->attachClient(win.winClient());
383 return true; // grouping done
379 } 384 }
380 } 385 }
381 386
382 } 387 }
383 388
384 } 389 }
390
391 return false;
385} 392}
386 393
387bool Workspace::loadGroups(const std::string &filename) { 394bool Workspace::loadGroups(const std::string &filename) {
diff --git a/src/Workspace.hh b/src/Workspace.hh
index bca7e41..c0afe65 100644
--- a/src/Workspace.hh
+++ b/src/Workspace.hh
@@ -88,7 +88,7 @@ public:
88 bool isCurrent() const; 88 bool isCurrent() const;
89 bool isLastWindow(FluxboxWindow *window) const; 89 bool isLastWindow(FluxboxWindow *window) const;
90 int numberOfWindows() const; 90 int numberOfWindows() const;
91 void checkGrouping(FluxboxWindow &win); 91 bool checkGrouping(FluxboxWindow &win);
92 static bool loadGroups(const std::string &filename); 92 static bool loadGroups(const std::string &filename);
93protected: 93protected:
94 void placeWindow(FluxboxWindow &win); 94 void placeWindow(FluxboxWindow &win);