diff options
author | fluxgen <fluxgen> | 2002-03-18 20:20:09 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2002-03-18 20:20:09 (GMT) |
commit | c6b11959cfa91b472ee6cc17ea45a1c6c5670c03 (patch) | |
tree | 437f6594c7819890db82ed77aaea5d18601f904f /src/Screen.cc | |
parent | 3a23ff8bdce8b53e3b87eb74f894dacb5ca7cbc8 (diff) | |
download | fluxbox-c6b11959cfa91b472ee6cc17ea45a1c6c5670c03.zip fluxbox-c6b11959cfa91b472ee6cc17ea45a1c6c5670c03.tar.bz2 |
added parameter to next/prev Focus and optionsbits for them
Diffstat (limited to 'src/Screen.cc')
-rw-r--r-- | src/Screen.cc | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/src/Screen.cc b/src/Screen.cc index a3a938f..41dfa53 100644 --- a/src/Screen.cc +++ b/src/Screen.cc | |||
@@ -22,10 +22,9 @@ | |||
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.34 2002/03/08 12:18:22 fluxgen Exp $ | 25 | // $Id: Screen.cc,v 1.35 2002/03/18 20:20:09 fluxgen Exp $ |
26 | 26 | ||
27 | // stupid macros needed to access some functions in version 2 of the GNU C | 27 | //use GNU extensions |
28 | // library | ||
29 | #ifndef _GNU_SOURCE | 28 | #ifndef _GNU_SOURCE |
30 | #define _GNU_SOURCE | 29 | #define _GNU_SOURCE |
31 | #endif // _GNU_SOURCE | 30 | #endif // _GNU_SOURCE |
@@ -1102,7 +1101,7 @@ void BScreen::reassociateWindow(FluxboxWindow *w, int wkspc_id, Bool ignore_stic | |||
1102 | } | 1101 | } |
1103 | 1102 | ||
1104 | 1103 | ||
1105 | void BScreen::nextFocus(void) { | 1104 | void BScreen::nextFocus(int opts) { |
1106 | Bool have_focused = False; | 1105 | Bool have_focused = False; |
1107 | int focused_window_number = -1; | 1106 | int focused_window_number = -1; |
1108 | FluxboxWindow *next; | 1107 | FluxboxWindow *next; |
@@ -1123,9 +1122,16 @@ void BScreen::nextFocus(void) { | |||
1123 | do { | 1122 | do { |
1124 | if ((++next_window_number) >= num_windows) | 1123 | if ((++next_window_number) >= num_windows) |
1125 | next_window_number = 0; | 1124 | next_window_number = 0; |
1125 | |||
1126 | next = getCurrentWorkspace()->getWindow(next_window_number); | 1126 | next = getCurrentWorkspace()->getWindow(next_window_number); |
1127 | } while ((!next->setInputFocus()) && next_window_number != | 1127 | |
1128 | focused_window_number); | 1128 | if (! ( (opts & CYCLESKIPSTUCK) != 0 && next->isStuck() || // skip if stuck |
1129 | (opts & CYCLESKIPLOWERTABS) != 0 && next->isLowerTab() || // skip if lower tab | ||
1130 | (opts & CYCLESKIPSHADED) != 0 && next->isShaded() || // skip if shaded | ||
1131 | !next->setInputFocus())) // skip unless set input focus | ||
1132 | break; | ||
1133 | |||
1134 | } while (next_window_number != focused_window_number); | ||
1129 | 1135 | ||
1130 | if (next_window_number != focused_window_number) { | 1136 | if (next_window_number != focused_window_number) { |
1131 | next->setInputFocus(); | 1137 | next->setInputFocus(); |
@@ -1142,7 +1148,7 @@ void BScreen::nextFocus(void) { | |||
1142 | } | 1148 | } |
1143 | 1149 | ||
1144 | 1150 | ||
1145 | void BScreen::prevFocus(void) { | 1151 | void BScreen::prevFocus(int opts) { |
1146 | Bool have_focused = False; | 1152 | Bool have_focused = False; |
1147 | int focused_window_number = -1; | 1153 | int focused_window_number = -1; |
1148 | FluxboxWindow *prev; | 1154 | FluxboxWindow *prev; |
@@ -1161,8 +1167,13 @@ void BScreen::prevFocus(void) { | |||
1161 | prev_window_number = getCurrentWorkspace()->getCount() - 1; | 1167 | prev_window_number = getCurrentWorkspace()->getCount() - 1; |
1162 | 1168 | ||
1163 | prev = getCurrentWorkspace()->getWindow(prev_window_number); | 1169 | prev = getCurrentWorkspace()->getWindow(prev_window_number); |
1164 | } while ((! prev->setInputFocus()) && (prev_window_number != | 1170 | |
1165 | focused_window_number)); | 1171 | if (! ( (opts & CYCLESKIPSTUCK) != 0 && prev->isStuck() || // skip if stuck |
1172 | (opts & CYCLESKIPLOWERTABS) != 0 && prev->isLowerTab() ||// skip if lower tab | ||
1173 | (opts & CYCLESKIPSHADED) != 0 && prev->isShaded() ||// skip if shaded | ||
1174 | !prev->setInputFocus()) ) // skip unless set input focus | ||
1175 | break; | ||
1176 | } while (prev_window_number != focused_window_number); | ||
1166 | 1177 | ||
1167 | if (prev_window_number != focused_window_number) | 1178 | if (prev_window_number != focused_window_number) |
1168 | getCurrentWorkspace()->raiseWindow(prev); | 1179 | getCurrentWorkspace()->raiseWindow(prev); |