--- src/kernel/qwidget.cpp.orig	Sat Jul  6 03:18:10 2002
+++ src/kernel/qwidget.cpp	Sat Jul  6 03:31:18 2002
@@ -3198,12 +3198,14 @@
 static bool noMoreToplevels()
 {
     QWidgetList *list   = qApp->topLevelWidgets();
+    QWidget     *main   = qApp->mainWidget();
     QWidget     *widget = list->first();
     while ( widget ) {
 	if ( !widget->isHidden()
 	     && !widget->isDesktop()
 	     && !widget->isPopup()
-	     && !widget->testWFlags( Qt::WStyle_Dialog) )
+	     && (!widget->testWFlags( Qt::WStyle_Dialog)
+	        || !widget->parentWidget()))
 	    break;
 	widget = list->next();
     }