diff --git a/src/kits/app/Application.cpp b/src/kits/app/Application.cpp index 295871eba2..d6a968b5e6 100644 --- a/src/kits/app/Application.cpp +++ b/src/kits/app/Application.cpp @@ -1350,6 +1350,7 @@ BApplication::write_drag(_BSession_ *session, BMessage *message) bool BApplication::_WindowQuitLoop(bool quitFilePanels, bool force) { + bool canQuit = true; int32 index = 0; while (true) { BWindow *window = WindowAt(index); @@ -1364,7 +1365,8 @@ BApplication::_WindowQuitLoop(bool quitFilePanels, bool force) continue; // don't quit file panels if we haven't been asked for it - if (!quitFilePanels && window->IsFilePanel()) { + if (quitFilePanels ^ window->IsFilePanel()) { + canQuit = false; window->Unlock(); index++; continue; @@ -1387,7 +1389,7 @@ BApplication::_WindowQuitLoop(bool quitFilePanels, bool force) // we need to continue at the start of the list again - it // might have changed } - return true; + return canQuit; }