diff options
author | fluxgen <fluxgen> | 2002-03-18 19:58:06 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2002-03-18 19:58:06 (GMT) |
commit | 3a23ff8bdce8b53e3b87eb74f894dacb5ca7cbc8 (patch) | |
tree | e72dc51cb4fe1ca076fe59c58717b278768e4bba /src/Window.cc | |
parent | 981dd0dacfcea16c7c262e174275b96fea9654eb (diff) | |
download | fluxbox-3a23ff8bdce8b53e3b87eb74f894dacb5ca7cbc8.zip fluxbox-3a23ff8bdce8b53e3b87eb74f894dacb5ca7cbc8.tar.bz2 |
added isLowerTab() and lastFocusTime
Diffstat (limited to 'src/Window.cc')
-rw-r--r-- | src/Window.cc | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/Window.cc b/src/Window.cc index 843687d..be6fcc8 100644 --- a/src/Window.cc +++ b/src/Window.cc | |||
@@ -1,5 +1,5 @@ | |||
1 | // Window.cc for Fluxbox Window Manager | 1 | // Window.cc for Fluxbox Window Manager |
2 | // Copyright (c) 2001 - 2002 Henrik Kinnunen (fluxgen@linuxmail.org) | 2 | // Copyright (c) 2001 - 2002 Henrik Kinnunen (fluxgen@linuxmail.org) |
3 | // | 3 | // |
4 | // Window.cc for Blackbox - an X11 Window manager | 4 | // Window.cc for Blackbox - an X11 Window manager |
5 | // Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) | 5 | // Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) |
@@ -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: Window.cc,v 1.31 2002/02/27 22:04:01 fluxgen Exp $ | 25 | // $Id: Window.cc,v 1.32 2002/03/18 19:58:06 fluxgen Exp $ |
26 | 26 | ||
27 | //use GNU extensions | 27 | //use GNU extensions |
28 | #ifndef _GNU_SOURCE | 28 | #ifndef _GNU_SOURCE |
@@ -79,6 +79,7 @@ tab(0) | |||
79 | ,gnome_hints(0) | 79 | ,gnome_hints(0) |
80 | #endif | 80 | #endif |
81 | { | 81 | { |
82 | lastFocusTime.tv_sec = lastFocusTime.tv_usec = 0; | ||
82 | 83 | ||
83 | #ifdef DEBUG | 84 | #ifdef DEBUG |
84 | fprintf(stderr, | 85 | fprintf(stderr, |
@@ -2372,6 +2373,10 @@ void FluxboxWindow::stick(void) { | |||
2372 | void FluxboxWindow::setFocusFlag(bool focus) { | 2373 | void FluxboxWindow::setFocusFlag(bool focus) { |
2373 | focused = focus; | 2374 | focused = focus; |
2374 | 2375 | ||
2376 | // Record focus timestamp for window cycling enhancements, such as skipping lower tabs | ||
2377 | if (focused) | ||
2378 | gettimeofday(&lastFocusTime, 0); | ||
2379 | |||
2375 | if (decorations.titlebar) { | 2380 | if (decorations.titlebar) { |
2376 | if (focused) { | 2381 | if (focused) { |
2377 | if (frame.ftitle) | 2382 | if (frame.ftitle) |
@@ -2699,6 +2704,17 @@ void FluxboxWindow::restoreGravity(void) { | |||
2699 | } | 2704 | } |
2700 | } | 2705 | } |
2701 | 2706 | ||
2707 | bool FluxboxWindow::isLowerTab(void) const { | ||
2708 | Tab* chkTab = (tab ? tab->first() : 0); | ||
2709 | while (chkTab) { | ||
2710 | FluxboxWindow* chkWin = chkTab->getWindow(); | ||
2711 | if (chkWin && chkWin != this && | ||
2712 | timercmp(&chkWin->lastFocusTime, &lastFocusTime, >)) | ||
2713 | return true; | ||
2714 | chkTab = chkTab->next(); | ||
2715 | } | ||
2716 | return false; | ||
2717 | } | ||
2702 | 2718 | ||
2703 | void FluxboxWindow::redrawLabel(void) { | 2719 | void FluxboxWindow::redrawLabel(void) { |
2704 | if (focused) { | 2720 | if (focused) { |