* 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
This commit is contained in:
Stephan Aßmus 2007-06-24 11:43:48 +00:00
parent 82fc8592fc
commit 82d0e2c2b5
1 changed files with 9 additions and 1 deletions

View File

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