all repos — fluxbox @ d666bec238b6681cedd3f6094f2e0dd772c512f9

custom fork of the fluxbox windowmanager

preserve order of focused windows on restart
markt markt
commit

d666bec238b6681cedd3f6094f2e0dd772c512f9

parent

2732e23812eb6b7adbd5f9ad1e4a23d3db1f9655

5 files changed, 18 insertions(+), 3 deletions(-)

jump to
M ChangeLogChangeLog

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

(Format: Year/Month/Day) Changes for 1.0rc3: +*06/07/19: + * Preserve order of focused windows on restart (Mark) + Workspace.cc Screen.cc FocusControl.cc/hh *06/07/16: * Fix a bug in Transparent.cc, (Henrik) #1362913 Fluxbox core dumps on Solaris
M src/FocusControl.ccsrc/FocusControl.cc

@@ -219,7 +219,8 @@

void FocusControl::setScreenFocusedWindow(WinClient &win_client) { // raise newly focused window to the top of the focused list - if (!m_cycling_focus) { // don't change the order if we're cycling + // don't change the order if we're cycling or shutting down + if (!m_cycling_focus && !win_client.screen().isShuttingdown()) { m_focused_list.remove(&win_client); m_focused_list.push_front(&win_client); m_cycling_window = m_focused_list.begin();

@@ -334,6 +335,9 @@

} void FocusControl::removeClient(WinClient &client) { + if (client.screen().isShuttingdown()) + return; + WinClient *cyc = 0; if (m_cycling_window != m_focused_list.end() && m_cycling_window != m_creation_order_list.end()) cyc = *m_cycling_window;

@@ -344,6 +348,14 @@

if (cyc == &client) { m_cycling_window = m_creation_order_list.end(); stopCyclingFocus(); + } +} + +void FocusControl::shutdown() { + FocusedWindows::iterator it = m_focused_list.begin(); + for (; it != m_focused_list.end(); ++it) { + if (*it && (*it)->fbwindow()) + (*it)->fbwindow()->restore(*it, true); } }
M src/FocusControl.hhsrc/FocusControl.hh

@@ -95,6 +95,7 @@ WinClient *lastFocusedWindow(int workspace);

WinClient *lastFocusedWindow(FluxboxWindow &group, WinClient *ignore_client); void removeClient(WinClient &client); + void shutdown(); static void revertFocus(BScreen &screen); // like revertFocus, but specifically related to this window (transients etc)
M src/Screen.ccsrc/Screen.cc

@@ -1789,6 +1789,7 @@ void BScreen::shutdown() {

rootWindow().setEventMask(NoEventMask); FbTk::App::instance()->sync(false); m_shutdown = true; + m_focus_control->shutdown(); for_each(m_workspaces_list.begin(), m_workspaces_list.end(), mem_fun(&Workspace::shutdown));
M src/Workspace.ccsrc/Workspace.cc

@@ -377,8 +377,6 @@ */

void Workspace::shutdown() { // note: when the window dies it'll remove it self from the list while (!m_windowlist.empty()) { - // restore with remap on all clients in that window - m_windowlist.back()->restore(true); //delete window (the window removes it self from m_windowlist) delete m_windowlist.back(); }