preserve order of focused windows on restart

This commit is contained in:
markt 2006-07-19 07:31:39 +00:00
parent 2732e23812
commit d666bec238
5 changed files with 18 additions and 3 deletions

View file

@ -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

View file

@ -219,7 +219,8 @@ WinClient *FocusControl::lastFocusedWindow(FluxboxWindow &group, WinClient *igno
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::dirFocus(FluxboxWindow &win, FocusDir dir) {
}
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;
@ -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
* focus is meant to be, it'll make things right ;-)

View file

@ -95,6 +95,7 @@ public:
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)

View file

@ -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));

View file

@ -377,8 +377,6 @@ void Workspace::setName(const std::string &name) {
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();
}