added parameter to next/prev Focus and optionsbits for them
This commit is contained in:
parent
3a23ff8bdc
commit
c6b11959cf
2 changed files with 26 additions and 12 deletions
|
@ -22,10 +22,9 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// 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
|
//use GNU extensions
|
||||||
// library
|
|
||||||
#ifndef _GNU_SOURCE
|
#ifndef _GNU_SOURCE
|
||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
#endif // _GNU_SOURCE
|
#endif // _GNU_SOURCE
|
||||||
|
@ -1102,7 +1101,7 @@ void BScreen::reassociateWindow(FluxboxWindow *w, int wkspc_id, Bool ignore_stic
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void BScreen::nextFocus(void) {
|
void BScreen::nextFocus(int opts) {
|
||||||
Bool have_focused = False;
|
Bool have_focused = False;
|
||||||
int focused_window_number = -1;
|
int focused_window_number = -1;
|
||||||
FluxboxWindow *next;
|
FluxboxWindow *next;
|
||||||
|
@ -1123,9 +1122,16 @@ void BScreen::nextFocus(void) {
|
||||||
do {
|
do {
|
||||||
if ((++next_window_number) >= num_windows)
|
if ((++next_window_number) >= num_windows)
|
||||||
next_window_number = 0;
|
next_window_number = 0;
|
||||||
|
|
||||||
next = getCurrentWorkspace()->getWindow(next_window_number);
|
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) {
|
if (next_window_number != focused_window_number) {
|
||||||
next->setInputFocus();
|
next->setInputFocus();
|
||||||
|
@ -1142,7 +1148,7 @@ void BScreen::nextFocus(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void BScreen::prevFocus(void) {
|
void BScreen::prevFocus(int opts) {
|
||||||
Bool have_focused = False;
|
Bool have_focused = False;
|
||||||
int focused_window_number = -1;
|
int focused_window_number = -1;
|
||||||
FluxboxWindow *prev;
|
FluxboxWindow *prev;
|
||||||
|
@ -1161,8 +1167,13 @@ void BScreen::prevFocus(void) {
|
||||||
prev_window_number = getCurrentWorkspace()->getCount() - 1;
|
prev_window_number = getCurrentWorkspace()->getCount() - 1;
|
||||||
|
|
||||||
prev = getCurrentWorkspace()->getWindow(prev_window_number);
|
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)
|
if (prev_window_number != focused_window_number)
|
||||||
getCurrentWorkspace()->raiseWindow(prev);
|
getCurrentWorkspace()->raiseWindow(prev);
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// 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
|
#ifndef SCREEN_HH
|
||||||
#define SCREEN_HH
|
#define SCREEN_HH
|
||||||
|
@ -203,8 +203,8 @@ public:
|
||||||
void sendToWorkspace(int, bool);
|
void sendToWorkspace(int, bool);
|
||||||
void raiseWindows(Window *, int);
|
void raiseWindows(Window *, int);
|
||||||
void reassociateWindow(FluxboxWindow *, int, Bool);
|
void reassociateWindow(FluxboxWindow *, int, Bool);
|
||||||
void prevFocus(void);
|
void prevFocus(int = 0);
|
||||||
void nextFocus(void);
|
void nextFocus(int = 0);
|
||||||
void raiseFocus(void);
|
void raiseFocus(void);
|
||||||
void reconfigure(void);
|
void reconfigure(void);
|
||||||
void rereadMenu(void);
|
void rereadMenu(void);
|
||||||
|
@ -229,6 +229,9 @@ public:
|
||||||
enum { RESTART = 1, RESTARTOTHER, EXIT, SHUTDOWN, EXECUTE, RECONFIGURE,
|
enum { RESTART = 1, RESTARTOTHER, EXIT, SHUTDOWN, EXECUTE, RECONFIGURE,
|
||||||
WINDOWSHADE, WINDOWICONIFY, WINDOWMAXIMIZE, WINDOWCLOSE, WINDOWRAISE,
|
WINDOWSHADE, WINDOWICONIFY, WINDOWMAXIMIZE, WINDOWCLOSE, WINDOWRAISE,
|
||||||
WINDOWLOWER, WINDOWSTICK, WINDOWKILL, SETSTYLE, WINDOWTAB};
|
WINDOWLOWER, WINDOWSTICK, WINDOWKILL, SETSTYLE, WINDOWTAB};
|
||||||
|
// prevFocus/nextFocus option bits
|
||||||
|
enum { CYCLESKIPLOWERTABS = 0x01, CYCLESKIPSTUCK = 0x02, CYCLESKIPSHADED = 0x04,
|
||||||
|
CYCLEDEFAULT = 0x00 };
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#ifdef GNOME
|
#ifdef GNOME
|
||||||
|
|
Loading…
Reference in a new issue