added parameter to next/prev Focus and optionsbits for them
fluxgen fluxgen
2 files changed,
26 insertions(+),
12 deletions(-)
M
src/Screen.cc
→
src/Screen.cc
@@ -22,10 +22,9 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.cc,v 1.34 2002/03/08 12:18:22 fluxgen Exp $ +// $Id: Screen.cc,v 1.35 2002/03/18 20:20:09 fluxgen Exp $ -// stupid macros needed to access some functions in version 2 of the GNU C -// library +//use GNU extensions #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif // _GNU_SOURCE@@ -1102,7 +1101,7 @@ }
} -void BScreen::nextFocus(void) { +void BScreen::nextFocus(int opts) { Bool have_focused = False; int focused_window_number = -1; FluxboxWindow *next;@@ -1123,9 +1122,16 @@ //try to set next window to focus
do { if ((++next_window_number) >= num_windows) next_window_number = 0; + next = getCurrentWorkspace()->getWindow(next_window_number); - } while ((!next->setInputFocus()) && next_window_number != - focused_window_number); + + if (! ( (opts & CYCLESKIPSTUCK) != 0 && next->isStuck() || // skip if stuck + (opts & CYCLESKIPLOWERTABS) != 0 && next->isLowerTab() || // skip if lower tab + (opts & CYCLESKIPSHADED) != 0 && next->isShaded() || // skip if shaded + !next->setInputFocus())) // skip unless set input focus + break; + + } while (next_window_number != focused_window_number); if (next_window_number != focused_window_number) { next->setInputFocus();@@ -1142,7 +1148,7 @@ }
} -void BScreen::prevFocus(void) { +void BScreen::prevFocus(int opts) { Bool have_focused = False; int focused_window_number = -1; FluxboxWindow *prev;@@ -1161,8 +1167,13 @@ if ((--prev_window_number) < 0)
prev_window_number = getCurrentWorkspace()->getCount() - 1; prev = getCurrentWorkspace()->getWindow(prev_window_number); - } while ((! prev->setInputFocus()) && (prev_window_number != - focused_window_number)); + + if (! ( (opts & CYCLESKIPSTUCK) != 0 && prev->isStuck() || // skip if stuck + (opts & CYCLESKIPLOWERTABS) != 0 && prev->isLowerTab() ||// skip if lower tab + (opts & CYCLESKIPSHADED) != 0 && prev->isShaded() ||// skip if shaded + !prev->setInputFocus()) ) // skip unless set input focus + break; + } while (prev_window_number != focused_window_number); if (prev_window_number != focused_window_number) getCurrentWorkspace()->raiseWindow(prev);
M
src/Screen.hh
→
src/Screen.hh
@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.hh,v 1.22 2002/03/08 12:19:07 fluxgen Exp $ +// $Id: Screen.hh,v 1.23 2002/03/18 20:20:09 fluxgen Exp $ #ifndef SCREEN_HH #define SCREEN_HH@@ -203,8 +203,8 @@ void sendToWorkspace(int);
void sendToWorkspace(int, bool); void raiseWindows(Window *, int); void reassociateWindow(FluxboxWindow *, int, Bool); - void prevFocus(void); - void nextFocus(void); + void prevFocus(int = 0); + void nextFocus(int = 0); void raiseFocus(void); void reconfigure(void); void rereadMenu(void);@@ -229,6 +229,9 @@ enum { ROUNDBULLET = 1, TRIANGELBULLET, SQUAERBULLET, NOBULLET };
enum { RESTART = 1, RESTARTOTHER, EXIT, SHUTDOWN, EXECUTE, RECONFIGURE, WINDOWSHADE, WINDOWICONIFY, WINDOWMAXIMIZE, WINDOWCLOSE, WINDOWRAISE, WINDOWLOWER, WINDOWSTICK, WINDOWKILL, SETSTYLE, WINDOWTAB}; + // prevFocus/nextFocus option bits + enum { CYCLESKIPLOWERTABS = 0x01, CYCLESKIPSTUCK = 0x02, CYCLESKIPSHADED = 0x04, + CYCLEDEFAULT = 0x00 }; private: #ifdef GNOME