all repos — fluxbox @ 3a23ff8bdce8b53e3b87eb74f894dacb5ca7cbc8

custom fork of the fluxbox windowmanager

added isLowerTab() and lastFocusTime
fluxgen fluxgen
commit

3a23ff8bdce8b53e3b87eb74f894dacb5ca7cbc8

parent

981dd0dacfcea16c7c262e174275b96fea9654eb

2 files changed, 24 insertions(+), 3 deletions(-)

jump to
M src/Window.ccsrc/Window.cc

@@ -1,5 +1,5 @@

// Window.cc for Fluxbox Window Manager -// Copyright (c) 2001 - 2002 Henrik Kinnunen (fluxgen@linuxmail.org) +// Copyright (c) 2001 - 2002 Henrik Kinnunen (fluxgen@linuxmail.org) // // Window.cc for Blackbox - an X11 Window manager // Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net)

@@ -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: Window.cc,v 1.31 2002/02/27 22:04:01 fluxgen Exp $ +// $Id: Window.cc,v 1.32 2002/03/18 19:58:06 fluxgen Exp $ //use GNU extensions #ifndef _GNU_SOURCE

@@ -79,6 +79,7 @@ #ifdef GNOME

,gnome_hints(0) #endif { + lastFocusTime.tv_sec = lastFocusTime.tv_usec = 0; #ifdef DEBUG fprintf(stderr,

@@ -2372,6 +2373,10 @@

void FluxboxWindow::setFocusFlag(bool focus) { focused = focus; + // Record focus timestamp for window cycling enhancements, such as skipping lower tabs + if (focused) + gettimeofday(&lastFocusTime, 0); + if (decorations.titlebar) { if (focused) { if (frame.ftitle)

@@ -2699,6 +2704,17 @@ break;

} } +bool FluxboxWindow::isLowerTab(void) const { + Tab* chkTab = (tab ? tab->first() : 0); + while (chkTab) { + FluxboxWindow* chkWin = chkTab->getWindow(); + if (chkWin && chkWin != this && + timercmp(&chkWin->lastFocusTime, &lastFocusTime, >)) + return true; + chkTab = chkTab->next(); + } + return false; +} void FluxboxWindow::redrawLabel(void) { if (focused) {
M src/Window.hhsrc/Window.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: Window.hh,v 1.11 2002/02/26 22:35:58 fluxgen Exp $ +// $Id: Window.hh,v 1.12 2002/03/18 19:58:06 fluxgen Exp $ #ifndef WINDOW_HH #define WINDOW_HH

@@ -168,6 +168,8 @@ { return frame.title_h; }

inline void setWindowNumber(int n) { window_number = n; } + inline const timeval& getLastFocusTime() const {return lastFocusTime;} + bool validateClient(void); bool setInputFocus(void); void setTab(bool flag);

@@ -187,6 +189,7 @@ void configure(int dx, int dy, unsigned int dw, unsigned int dh);

void setWorkspace(int n); void changeBlackboxHints(BaseDisplay::BlackboxHints *); void restoreAttributes(void); + bool isLowerTab(void) const; void buttonPressEvent(XButtonEvent *); void buttonReleaseEvent(XButtonEvent *);

@@ -226,6 +229,8 @@ BaseDisplay::BlackboxAttributes blackbox_attrib;

Time lastButtonPressTime; Windowmenu *windowmenu; + + timeval lastFocusTime; int focus_mode, window_number, workspace_number; unsigned long current_state;