all repos — fluxbox @ fde970a21d62756cdbca1fe5acd75386b251814c

custom fork of the fluxbox windowmanager

include iconic windows when cycling
also, stop cycling on one screen when cycling begins on another
markt markt
commit

fde970a21d62756cdbca1fe5acd75386b251814c

parent

d32a7af7e6540221edbf43cee7b89a36e0755a66

5 files changed, 32 insertions(+), 23 deletions(-)

jump to
M ChangeLogChangeLog

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

(Format: Year/Month/Day) Changes for 1.0rc3: +*06/07/14: + * Fix a possible bug with window cycling on multiple screens (Mark) + fluxbox.cc WorkspaceCmd.cc + * Include minimized windows when "alt-tabbing", added 16 to the + Next/PrevWindow bitmask to disable the behavior (Mark) + FocusControl.cc/hh *06/07/13: * Remove some redundant code for loading styles (Mark) fluxbox.cc Screen.cc RootTheme.cc/hh
M src/FocusControl.ccsrc/FocusControl.cc

@@ -57,6 +57,7 @@ m_focus_new(screen.resourceManager(), true,

screen.name()+".focusNewWindows", screen.altName()+".FocusNewWindows"), m_cycling_focus(false), + m_was_iconic(false), m_cycling_last(0) { m_cycling_window = m_focused_list.end();

@@ -73,38 +74,29 @@ // skip if not active client (i.e. only visit each fbwin once)

(opts & FocusControl::CYCLEGROUPS) != 0 && win->winClient().window() != winclient.window() || // skip if shaded (opts & FocusControl::CYCLESKIPSHADED) != 0 && win->isShaded() || + // skip if iconic + (opts & FocusControl::CYCLESKIPICONIC) != 0 && win->isIconic() || // skip if hidden win->isFocusHidden() ); } void FocusControl::cycleFocus(int opts, bool cycle_reverse) { - int num_windows = m_screen.currentWorkspace()->numberOfWindows(); - - if (num_windows < 1) - return; FocusedWindows *window_list = (opts & CYCLELINEAR) ? &m_creation_order_list : &m_focused_list; if (!m_cycling_focus) { - if (Fluxbox::instance()->watchingScreen()) + if (&m_screen == Fluxbox::instance()->watchingScreen()) m_cycling_focus = true; - if (opts & CYCLELINEAR) { - m_cycling_creation_order = true; - m_cycling_window = find(window_list->begin(),window_list->end(),s_focused_window); - } else { - m_cycling_creation_order = (opts & CYCLELINEAR); - m_cycling_window = window_list->begin(); - } + m_cycling_window = find(window_list->begin(),window_list->end(),s_focused_window); + m_cycling_creation_order = (opts & CYCLELINEAR); + m_was_iconic = false; m_cycling_last = 0; } else { // already cycling, so restack to put windows back in their proper order m_screen.layerManager().restack(); if (m_cycling_creation_order ^ (bool)(opts & CYCLELINEAR)) { m_cycling_creation_order ^= true; - if (m_cycling_window != m_focused_list.end() && m_cycling_window != m_creation_order_list.end()) - m_cycling_window = find(window_list->begin(),window_list->end(),*m_cycling_window); - else - m_cycling_window = window_list->begin(); + m_cycling_window = find(window_list->begin(),window_list->end(),*m_cycling_window); } } // if it is stacked, we want the highest window in the focused list

@@ -116,16 +108,18 @@

while (true) { if (cycle_reverse && it == it_begin) it = it_end; - cycle_reverse ? --it : ++it; - if (it == it_end) + else if (!cycle_reverse && it == it_end) it = it_begin; + else + cycle_reverse ? --it : ++it; // give up [do nothing] if we reach the current focused again - if ((*it) == (*m_cycling_window)) + if (it == m_cycling_window) break; + if (it == it_end) + continue; FluxboxWindow *fbwin = (*it)->fbwindow(); - if (fbwin && !fbwin->isIconic() && - (fbwin->isStuck() + if (fbwin && (fbwin->isStuck() || fbwin->workspaceNumber() == m_screen.currentWorkspaceID())) { // either on this workspace, or stuck

@@ -140,6 +134,9 @@ // set back to orig current Client in that fbwin

m_cycling_last->fbwindow()->setCurrentClient(*m_cycling_last, false); } m_cycling_last = &last_client; + if (m_was_iconic) + (*m_cycling_window)->fbwindow()->iconify(); + m_was_iconic = fbwin->isIconic(); } fbwin->tempRaise(); break;

@@ -362,6 +359,8 @@ * it gets a focusIn

*/ void FocusControl::revertFocus(BScreen &screen) { + if (screen.focusControl().isCycling()) + return; // Relevant resources: // resource.focus_last = whether we focus last focused when changing workspace // BScreen::FocusModel = sloppy, click, whatever
M src/FocusControl.hhsrc/FocusControl.hh

@@ -62,6 +62,7 @@ CYCLEGROUPS = 0x01,

CYCLESKIPSTUCK = 0x02, CYCLESKIPSHADED = 0x04, CYCLELINEAR = 0x08, + CYCLESKIPICONIC = 0x10, CYCLEDEFAULT = 0x00 };

@@ -117,6 +118,7 @@ FocusedWindows m_creation_order_list;

FocusedWindows::iterator m_cycling_window; bool m_cycling_focus; bool m_cycling_creation_order; + bool m_was_iconic; WinClient *m_cycling_last; static WinClient *s_focused_window;
M src/WorkspaceCmd.ccsrc/WorkspaceCmd.cc

@@ -55,7 +55,7 @@ screen->focusControl().nextFocus(m_option | FocusControl::CYCLELINEAR);

else { // if stacked cycling, then set a watch for // the release of exactly these modifiers - if (!fb->watchingScreen()) + if (screen != fb->watchingScreen()) Fluxbox::instance()->watchKeyRelease(*screen, mods); screen->focusControl().nextFocus(m_option); }

@@ -77,7 +77,7 @@ screen->focusControl().prevFocus(m_option | FocusControl::CYCLELINEAR);

else { // if stacked cycling, then set a watch for // the release of exactly these modifiers - if (!fb->watchingScreen()) + if (screen != fb->watchingScreen()) Fluxbox::instance()->watchKeyRelease(*screen, mods); screen->focusControl().prevFocus(m_option); }
M src/fluxbox.ccsrc/fluxbox.cc

@@ -1811,6 +1811,8 @@ if (mods == 0) {

cerr<<"WARNING: attempt to grab without modifiers!"<<endl; return; } + if (m_watching_screen) + m_watching_screen->focusControl().stopCyclingFocus(); m_watching_screen = &screen; // just make sure we are saving the mods with any other flags (xkb)