From 82d0e2c2b5433d041a75884dbd8d202997352933 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sun, 24 Jun 2007 11:43:48 +0000 Subject: [PATCH] * do not ask hidden windows if they want to quit (not to be confused with minimized windows, those need to be asked of course) * added some comments about why this code is a little flawed but works anyways NOTE: I really wonder wether traversing the window list in reverse is correct git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21501 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/app/Application.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/kits/app/Application.cpp b/src/kits/app/Application.cpp index 0f8cc9efda..22ba3089d8 100644 --- a/src/kits/app/Application.cpp +++ b/src/kits/app/Application.cpp @@ -1349,11 +1349,19 @@ BApplication::_WindowQuitLoop(bool quitFilePanels, bool force) BWindow *window = (BWindow*)looperList.ItemAt(i); // don't quit file panels if we haven't been asked for it + // NOTE: the window pointer will be NULL if the looper was not + // a BWindow or if the thread wasn't running, see above if (window == NULL || (!quitFilePanels && window->IsFilePanel())) continue; + // NOTE: the window pointer might be stale, in case the looper + // was already quit by quitting an earlier looper... but fortunately, + // we can still call Lock() on the invalid pointer, and it + // will return false... if (window->Lock()) { - if (!force && !window->QuitRequested() + // never ask hidden windows if they want to quit, ignore + // them if force == false, just quit them if force == true + if (!force && !window->IsHidden() && !window->QuitRequested() && !(quitFilePanels && window->IsFilePanel())) { // the window does not want to quit, so we don't either window->Unlock();