summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Screen.cc29
-rw-r--r--src/Screen.hh9
2 files changed, 26 insertions, 12 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
1105void BScreen::nextFocus(void) { 1104void 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
1145void BScreen::prevFocus(void) { 1151void 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);
diff --git a/src/Screen.hh b/src/Screen.hh
index 1e9c3bb..ffb5df4 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.22 2002/03/08 12:19:07 fluxgen Exp $ 25// $Id: Screen.hh,v 1.23 2002/03/18 20:20:09 fluxgen Exp $
26 26
27#ifndef SCREEN_HH 27#ifndef SCREEN_HH
28#define SCREEN_HH 28#define SCREEN_HH
@@ -203,8 +203,8 @@ public:
203 void sendToWorkspace(int, bool); 203 void sendToWorkspace(int, bool);
204 void raiseWindows(Window *, int); 204 void raiseWindows(Window *, int);
205 void reassociateWindow(FluxboxWindow *, int, Bool); 205 void reassociateWindow(FluxboxWindow *, int, Bool);
206 void prevFocus(void); 206 void prevFocus(int = 0);
207 void nextFocus(void); 207 void nextFocus(int = 0);
208 void raiseFocus(void); 208 void raiseFocus(void);
209 void reconfigure(void); 209 void reconfigure(void);
210 void rereadMenu(void); 210 void rereadMenu(void);
@@ -229,6 +229,9 @@ public:
229 enum { RESTART = 1, RESTARTOTHER, EXIT, SHUTDOWN, EXECUTE, RECONFIGURE, 229 enum { RESTART = 1, RESTARTOTHER, EXIT, SHUTDOWN, EXECUTE, RECONFIGURE,
230 WINDOWSHADE, WINDOWICONIFY, WINDOWMAXIMIZE, WINDOWCLOSE, WINDOWRAISE, 230 WINDOWSHADE, WINDOWICONIFY, WINDOWMAXIMIZE, WINDOWCLOSE, WINDOWRAISE,
231 WINDOWLOWER, WINDOWSTICK, WINDOWKILL, SETSTYLE, WINDOWTAB}; 231 WINDOWLOWER, WINDOWSTICK, WINDOWKILL, SETSTYLE, WINDOWTAB};
232 // prevFocus/nextFocus option bits
233 enum { CYCLESKIPLOWERTABS = 0x01, CYCLESKIPSTUCK = 0x02, CYCLESKIPSHADED = 0x04,
234 CYCLEDEFAULT = 0x00 };
232 235
233private: 236private:
234 #ifdef GNOME 237 #ifdef GNOME