summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qwindowcontainer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/kernel/qwindowcontainer.cpp')
-rw-r--r--src/widgets/kernel/qwindowcontainer.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/widgets/kernel/qwindowcontainer.cpp b/src/widgets/kernel/qwindowcontainer.cpp
index 9d3a4ef0b2..3885431b05 100644
--- a/src/widgets/kernel/qwindowcontainer.cpp
+++ b/src/widgets/kernel/qwindowcontainer.cpp
@@ -34,6 +34,8 @@
#include "qwindowcontainer_p.h"
#include "qwidget_p.h"
#include <QtGui/qwindow.h>
+#include <QtGui/private/qguiapplication_p.h>
+#include <qpa/qplatformintegration.h>
#include <QDebug>
#include <QMdiSubWindow>
@@ -196,6 +198,13 @@ QWindowContainer::QWindowContainer(QWindow *embeddedWindow, QWidget *parent, Qt:
return;
}
+ // The embedded QWindow must use the same logic as QWidget when it comes to the surface type.
+ // Otherwise we may end up with BadMatch failures on X11.
+ if (embeddedWindow->surfaceType() == QSurface::RasterSurface
+ && QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::RasterGLSurface)
+ && !QApplication::testAttribute(Qt::AA_ForceRasterWidgets))
+ embeddedWindow->setSurfaceType(QSurface::RasterGLSurface);
+
d->window = embeddedWindow;
d->window->setParent(&d->fakeParent);
setAcceptDrops(true);