preserve order of focused windows on restart
This commit is contained in:
parent
2732e23812
commit
d666bec238
5 changed files with 18 additions and 3 deletions
|
@ -1,5 +1,8 @@
|
||||||
(Format: Year/Month/Day)
|
(Format: Year/Month/Day)
|
||||||
Changes for 1.0rc3:
|
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:
|
*06/07/16:
|
||||||
* Fix a bug in Transparent.cc, (Henrik)
|
* Fix a bug in Transparent.cc, (Henrik)
|
||||||
#1362913 Fluxbox core dumps on Solaris
|
#1362913 Fluxbox core dumps on Solaris
|
||||||
|
|
|
@ -219,7 +219,8 @@ WinClient *FocusControl::lastFocusedWindow(FluxboxWindow &group, WinClient *igno
|
||||||
void FocusControl::setScreenFocusedWindow(WinClient &win_client) {
|
void FocusControl::setScreenFocusedWindow(WinClient &win_client) {
|
||||||
|
|
||||||
// raise newly focused window to the top of the focused list
|
// 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.remove(&win_client);
|
||||||
m_focused_list.push_front(&win_client);
|
m_focused_list.push_front(&win_client);
|
||||||
m_cycling_window = m_focused_list.begin();
|
m_cycling_window = m_focused_list.begin();
|
||||||
|
@ -334,6 +335,9 @@ void FocusControl::dirFocus(FluxboxWindow &win, FocusDir dir) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void FocusControl::removeClient(WinClient &client) {
|
void FocusControl::removeClient(WinClient &client) {
|
||||||
|
if (client.screen().isShuttingdown())
|
||||||
|
return;
|
||||||
|
|
||||||
WinClient *cyc = 0;
|
WinClient *cyc = 0;
|
||||||
if (m_cycling_window != m_focused_list.end() && m_cycling_window != m_creation_order_list.end())
|
if (m_cycling_window != m_focused_list.end() && m_cycling_window != m_creation_order_list.end())
|
||||||
cyc = *m_cycling_window;
|
cyc = *m_cycling_window;
|
||||||
|
@ -347,6 +351,14 @@ void FocusControl::removeClient(WinClient &client) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function is called whenever we aren't quite sure what
|
* This function is called whenever we aren't quite sure what
|
||||||
* focus is meant to be, it'll make things right ;-)
|
* focus is meant to be, it'll make things right ;-)
|
||||||
|
|
|
@ -95,6 +95,7 @@ public:
|
||||||
WinClient *lastFocusedWindow(FluxboxWindow &group, WinClient *ignore_client);
|
WinClient *lastFocusedWindow(FluxboxWindow &group, WinClient *ignore_client);
|
||||||
|
|
||||||
void removeClient(WinClient &client);
|
void removeClient(WinClient &client);
|
||||||
|
void shutdown();
|
||||||
|
|
||||||
static void revertFocus(BScreen &screen);
|
static void revertFocus(BScreen &screen);
|
||||||
// like revertFocus, but specifically related to this window (transients etc)
|
// like revertFocus, but specifically related to this window (transients etc)
|
||||||
|
|
|
@ -1789,6 +1789,7 @@ void BScreen::shutdown() {
|
||||||
rootWindow().setEventMask(NoEventMask);
|
rootWindow().setEventMask(NoEventMask);
|
||||||
FbTk::App::instance()->sync(false);
|
FbTk::App::instance()->sync(false);
|
||||||
m_shutdown = true;
|
m_shutdown = true;
|
||||||
|
m_focus_control->shutdown();
|
||||||
for_each(m_workspaces_list.begin(),
|
for_each(m_workspaces_list.begin(),
|
||||||
m_workspaces_list.end(),
|
m_workspaces_list.end(),
|
||||||
mem_fun(&Workspace::shutdown));
|
mem_fun(&Workspace::shutdown));
|
||||||
|
|
|
@ -377,8 +377,6 @@ void Workspace::setName(const std::string &name) {
|
||||||
void Workspace::shutdown() {
|
void Workspace::shutdown() {
|
||||||
// note: when the window dies it'll remove it self from the list
|
// note: when the window dies it'll remove it self from the list
|
||||||
while (!m_windowlist.empty()) {
|
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 window (the window removes it self from m_windowlist)
|
||||||
delete m_windowlist.back();
|
delete m_windowlist.back();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue