src/gui/kernel/qclipboard_x11.cpp
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
--- a/src/gui/kernel/qclipboard_x11.cpp	Tue Jan 26 12:42:25 2010 +0200
+++ b/src/gui/kernel/qclipboard_x11.cpp	Tue Feb 02 00:43:10 2010 +0200
@@ -78,6 +78,7 @@
 #include "qimagewriter.h"
 #include "qvariant.h"
 #include "qdnd_p.h"
+#include <private/qwidget_p.h>
 
 #ifndef QT_NO_XFIXES
 #include <X11/extensions/Xfixes.h>
@@ -131,6 +132,11 @@
     requestor = new QWidget(0);
     requestor->createWinId();
     requestor->setObjectName(QLatin1String("internal clipboard requestor"));
+    // We dont need this internal widgets to appear in QApplication::topLevelWidgets()
+    if (QWidgetPrivate::allWidgets) {
+        QWidgetPrivate::allWidgets->remove(owner);
+        QWidgetPrivate::allWidgets->remove(requestor);
+    }
     qAddPostRoutine(cleanup);
 }
 
@@ -769,6 +775,9 @@
     delete requestor;
     requestor = new QWidget(0);
     requestor->setObjectName(QLatin1String("internal clipboard requestor"));
+    // We dont need this internal widget to appear in QApplication::topLevelWidgets()
+    if (QWidgetPrivate::allWidgets)
+        QWidgetPrivate::allWidgets->remove(requestor);
 
     return QByteArray();
 }