aboutsummaryrefslogtreecommitdiff
path: root/src/FocusControl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/FocusControl.cc')
-rw-r--r--src/FocusControl.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/FocusControl.cc b/src/FocusControl.cc
index 6b4f64a..c4c441e 100644
--- a/src/FocusControl.cc
+++ b/src/FocusControl.cc
@@ -219,7 +219,8 @@ WinClient *FocusControl::lastFocusedWindow(FluxboxWindow &group, WinClient *igno
219void FocusControl::setScreenFocusedWindow(WinClient &win_client) { 219void FocusControl::setScreenFocusedWindow(WinClient &win_client) {
220 220
221 // raise newly focused window to the top of the focused list 221 // raise newly focused window to the top of the focused list
222 if (!m_cycling_focus) { // don't change the order if we're cycling 222 // don't change the order if we're cycling or shutting down
223 if (!m_cycling_focus && !win_client.screen().isShuttingdown()) {
223 m_focused_list.remove(&win_client); 224 m_focused_list.remove(&win_client);
224 m_focused_list.push_front(&win_client); 225 m_focused_list.push_front(&win_client);
225 m_cycling_window = m_focused_list.begin(); 226 m_cycling_window = m_focused_list.begin();
@@ -334,6 +335,9 @@ void FocusControl::dirFocus(FluxboxWindow &win, FocusDir dir) {
334} 335}
335 336
336void FocusControl::removeClient(WinClient &client) { 337void FocusControl::removeClient(WinClient &client) {
338 if (client.screen().isShuttingdown())
339 return;
340
337 WinClient *cyc = 0; 341 WinClient *cyc = 0;
338 if (m_cycling_window != m_focused_list.end() && m_cycling_window != m_creation_order_list.end()) 342 if (m_cycling_window != m_focused_list.end() && m_cycling_window != m_creation_order_list.end())
339 cyc = *m_cycling_window; 343 cyc = *m_cycling_window;
@@ -347,6 +351,14 @@ void FocusControl::removeClient(WinClient &client) {
347 } 351 }
348} 352}
349 353
354void FocusControl::shutdown() {
355 FocusedWindows::iterator it = m_focused_list.begin();
356 for (; it != m_focused_list.end(); ++it) {
357 if (*it && (*it)->fbwindow())
358 (*it)->fbwindow()->restore(*it, true);
359 }
360}
361
350/** 362/**
351 * This function is called whenever we aren't quite sure what 363 * This function is called whenever we aren't quite sure what
352 * focus is meant to be, it'll make things right ;-) 364 * focus is meant to be, it'll make things right ;-)