all repos — fluxbox @ e35670d4a6a1ace394ff13cae39e41c2171b9054

custom fork of the fluxbox windowmanager

opening window on different workspace should put it at front of focused list with focusnew
markt markt
commit

e35670d4a6a1ace394ff13cae39e41c2171b9054

parent

46fff8bf344b31c2b4e0f777312bfad22a6fcd26

4 files changed, 19 insertions(+), 5 deletions(-)

jump to
M ChangeLogChangeLog

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

(Format: Year/Month/Day) Changes for 1.0rc3: +*07/01/26: + * Opening a window on a different workspace with Focus New Windows enabled + should focus the window when you get to that workspace -- as a free bonus, + stacking order should be more stable on fluxbox restart (Mark) + Screen.cc FocusControl.cc/hh *07/01/25: * Don't raise any windows above OverrideRedirect windows, otherwise they eventually get pushed to the bottomm, bug #1447583 (Mark)
M src/FocusControl.ccsrc/FocusControl.cc

@@ -149,6 +149,11 @@ m_focused_list.push_back(&client);

m_creation_order_list.push_back(&client); } +void FocusControl::addFocusFront(WinClient &client) { + m_focused_list.push_front(&client); + m_creation_order_list.push_back(&client); +} + // move all clients in given window to back of focused list void FocusControl::setFocusBack(FluxboxWindow *fbwin) { // do nothing if there are no windows open

@@ -375,8 +380,9 @@ }

} void FocusControl::shutdown() { - FocusedWindows::iterator it = m_focused_list.begin(); - for (; it != m_focused_list.end(); ++it) { + // restore windows backwards so they get put back correctly on restart + FocusedWindows::reverse_iterator it = m_focused_list.rbegin(); + for (; it != m_focused_list.rend(); ++it) { if (*it && (*it)->fbwindow()) (*it)->fbwindow()->restore(*it, true); }
M src/FocusControl.hhsrc/FocusControl.hh

@@ -85,6 +85,7 @@ bool isMouseFocus() const { return focusModel() == MOUSEFOCUS; }

bool isMouseTabFocus() const { return tabFocusModel() == MOUSETABFOCUS; } bool isCycling() const { return m_cycling_focus; } void addFocusBack(WinClient &client); + void addFocusFront(WinClient &client); void setFocusBack(FluxboxWindow *fbwin); FocusModel focusModel() const { return *m_focus_model; }
M src/Screen.ccsrc/Screen.cc

@@ -1403,9 +1403,11 @@ }

} } - // always put on end of focused list, if it gets focused it'll get pushed up - // there is only the one win client at this stage - focusControl().addFocusBack(*winclient); + // add the window to the focus list + if (focusControl().focusNew()) + focusControl().addFocusFront(*winclient); + else + focusControl().addFocusBack(*winclient); // we also need to check if another window expects this window to the left // and if so, then join it.