diff options
author | rathnor <rathnor> | 2003-06-15 11:37:53 (GMT) |
---|---|---|
committer | rathnor <rathnor> | 2003-06-15 11:37:53 (GMT) |
commit | 1856480901f1aed0235300f17ebcf827c9bf9aac (patch) | |
tree | ebc6900a790ce2fefb1f828b84ec597d65a34b0d | |
parent | 97fcf60f46000fc2770a00ed4a76df90f13d9ab3 (diff) | |
download | fluxbox_lack-1856480901f1aed0235300f17ebcf827c9bf9aac.zip fluxbox_lack-1856480901f1aed0235300f17ebcf827c9bf9aac.tar.bz2 |
fix up nextFocus/prevFocu for cycling through groups (not just clients)
-rw-r--r-- | src/Screen.cc | 22 | ||||
-rw-r--r-- | src/Screen.hh | 6 |
2 files changed, 15 insertions, 13 deletions
diff --git a/src/Screen.cc b/src/Screen.cc index 85fdec9..8b76dba 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.181 2003/06/12 15:24:37 fluxgen Exp $ | 25 | // $Id: Screen.cc,v 1.182 2003/06/15 11:37:53 rathnor Exp $ |
26 | 26 | ||
27 | 27 | ||
28 | #include "Screen.hh" | 28 | #include "Screen.hh" |
@@ -1536,7 +1536,7 @@ void BScreen::nextFocus(int opts) { | |||
1536 | // keep track of the originally selected window in a set | 1536 | // keep track of the originally selected window in a set |
1537 | WinClient &last_client = fbwin->winClient(); | 1537 | WinClient &last_client = fbwin->winClient(); |
1538 | 1538 | ||
1539 | if (! (doSkipWindow(fbwin, opts) || !fbwin->setCurrentClient(**it)) ) { | 1539 | if (! (doSkipWindow(**it, opts) || !fbwin->setCurrentClient(**it)) ) { |
1540 | // moved onto a new fbwin | 1540 | // moved onto a new fbwin |
1541 | if (!cycling_last || cycling_last->fbwindow() != fbwin) { | 1541 | if (!cycling_last || cycling_last->fbwindow() != fbwin) { |
1542 | if (cycling_last) | 1542 | if (cycling_last) |
@@ -1566,7 +1566,7 @@ void BScreen::nextFocus(int opts) { | |||
1566 | if (it == wins.end()) | 1566 | if (it == wins.end()) |
1567 | it = wins.begin(); | 1567 | it = wins.begin(); |
1568 | // see if the window should be skipped | 1568 | // see if the window should be skipped |
1569 | if (! (doSkipWindow((*it), opts) || !(*it)->setInputFocus()) ) | 1569 | if (! (doSkipWindow((*it)->winClient(), opts) || !(*it)->setInputFocus()) ) |
1570 | break; | 1570 | break; |
1571 | } while ((*it) != focused); | 1571 | } while ((*it) != focused); |
1572 | if ((*it) != focused && it != wins.end()) | 1572 | if ((*it) != focused && it != wins.end()) |
@@ -1627,7 +1627,7 @@ void BScreen::prevFocus(int opts) { | |||
1627 | WinClient &last_client = fbwin->winClient(); | 1627 | WinClient &last_client = fbwin->winClient(); |
1628 | 1628 | ||
1629 | 1629 | ||
1630 | if (! (doSkipWindow(fbwin, opts) || !fbwin->setCurrentClient(**it)) ) { | 1630 | if (! (doSkipWindow(**it, opts) || !fbwin->setCurrentClient(**it)) ) { |
1631 | // moved onto a new fbwin | 1631 | // moved onto a new fbwin |
1632 | if (!cycling_last || cycling_last->fbwindow() != fbwin) { | 1632 | if (!cycling_last || cycling_last->fbwindow() != fbwin) { |
1633 | if (cycling_last) | 1633 | if (cycling_last) |
@@ -1659,7 +1659,7 @@ void BScreen::prevFocus(int opts) { | |||
1659 | it = wins.end(); | 1659 | it = wins.end(); |
1660 | --it; | 1660 | --it; |
1661 | // see if the window should be skipped | 1661 | // see if the window should be skipped |
1662 | if (! (doSkipWindow((*it), opts) || !(*it)->setInputFocus()) ) | 1662 | if (! (doSkipWindow((*it)->winClient(), opts) || !(*it)->setInputFocus()) ) |
1663 | break; | 1663 | break; |
1664 | } while ((*it) != focused); | 1664 | } while ((*it) != focused); |
1665 | 1665 | ||
@@ -2411,11 +2411,13 @@ void BScreen::leftWorkspace(const int delta) { | |||
2411 | /** | 2411 | /** |
2412 | @return true if the windows should be skiped else false | 2412 | @return true if the windows should be skiped else false |
2413 | */ | 2413 | */ |
2414 | bool BScreen::doSkipWindow(const FluxboxWindow *w, int opts) { | 2414 | bool BScreen::doSkipWindow(const WinClient &winclient, int opts) { |
2415 | return ((opts & CYCLESKIPSTUCK) != 0 && w->isStuck() || // skip if stuck | 2415 | const FluxboxWindow *win = winclient.fbwindow(); |
2416 | /* (opts & CYCLESKIPLOWERTABS) != 0 && w->isLowerTab() || // skip if lower tab | 2416 | return (!win || |
2417 | */ | 2417 | (opts & CYCLESKIPSTUCK) != 0 && win->isStuck() || // skip if stuck |
2418 | (opts & CYCLESKIPSHADED) != 0 && w->isShaded()); // skip if shaded | 2418 | (opts & CYCLEGROUPS) != 0 && win->winClient() != winclient || // skip if not active client (i.e. only visit each fbwin once) |
2419 | (opts & CYCLESKIPSHADED) != 0 && win->isShaded() // skip if shaded | ||
2420 | ); | ||
2419 | } | 2421 | } |
2420 | 2422 | ||
2421 | void BScreen::renderGeomWindow() { | 2423 | void BScreen::renderGeomWindow() { |
diff --git a/src/Screen.hh b/src/Screen.hh index e696498..a90ca29 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.104 2003/06/12 15:22:59 fluxgen Exp $ | 25 | // $Id: Screen.hh,v 1.105 2003/06/15 11:37:53 rathnor Exp $ |
26 | 26 | ||
27 | #ifndef SCREEN_HH | 27 | #ifndef SCREEN_HH |
28 | #define SCREEN_HH | 28 | #define SCREEN_HH |
@@ -339,7 +339,7 @@ public: | |||
339 | UNDERMOUSEPLACEMENT, LEFTRIGHT, RIGHTLEFT, TOPBOTTOM, BOTTOMTOP }; | 339 | UNDERMOUSEPLACEMENT, LEFTRIGHT, RIGHTLEFT, TOPBOTTOM, BOTTOMTOP }; |
340 | 340 | ||
341 | // prevFocus/nextFocus option bits | 341 | // prevFocus/nextFocus option bits |
342 | enum { CYCLESKIPLOWERTABS = 0x01, CYCLESKIPSTUCK = 0x02, CYCLESKIPSHADED = 0x04, | 342 | enum { CYCLEGROUPS = 0x01, CYCLESKIPSTUCK = 0x02, CYCLESKIPSHADED = 0x04, |
343 | CYCLELINEAR = 0x08, CYCLEDEFAULT = 0x00 }; | 343 | CYCLELINEAR = 0x08, CYCLEDEFAULT = 0x00 }; |
344 | 344 | ||
345 | class ScreenSubject:public FbTk::Subject { | 345 | class ScreenSubject:public FbTk::Subject { |
@@ -359,7 +359,7 @@ private: | |||
359 | 359 | ||
360 | void initMenu(); | 360 | void initMenu(); |
361 | 361 | ||
362 | bool doSkipWindow(const FluxboxWindow *w, int options); | 362 | bool doSkipWindow(const WinClient &winclient, int options); |
363 | 363 | ||
364 | void renderGeomWindow(); | 364 | void renderGeomWindow(); |
365 | 365 | ||