RenderWidget: Set WA_DontCreateNativeAncestors
Some windowing systems like wayland are designed to show hardware accellerated surfaces as subsurfaces and not native windows.
This commit is contained in:
parent
041252ba36
commit
3846d0c2cd
1 changed files with 5 additions and 0 deletions
|
@ -41,6 +41,8 @@
|
||||||
#include <qpa/qplatformnativeinterface.h>
|
#include <qpa/qplatformnativeinterface.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static Frontend::WindowSystemType GetWindowSystemType();
|
||||||
|
|
||||||
EmuThread::EmuThread(Frontend::GraphicsContext& core_context) : core_context(core_context) {}
|
EmuThread::EmuThread(Frontend::GraphicsContext& core_context) : core_context(core_context) {}
|
||||||
|
|
||||||
EmuThread::~EmuThread() = default;
|
EmuThread::~EmuThread() = default;
|
||||||
|
@ -243,6 +245,9 @@ public:
|
||||||
: RenderWidget(parent), is_secondary(is_secondary) {
|
: RenderWidget(parent), is_secondary(is_secondary) {
|
||||||
setAttribute(Qt::WA_NativeWindow);
|
setAttribute(Qt::WA_NativeWindow);
|
||||||
setAttribute(Qt::WA_PaintOnScreen);
|
setAttribute(Qt::WA_PaintOnScreen);
|
||||||
|
if (GetWindowSystemType() == Frontend::WindowSystemType::Wayland) {
|
||||||
|
setAttribute(Qt::WA_DontCreateNativeAncestors);
|
||||||
|
}
|
||||||
windowHandle()->setSurfaceType(QWindow::OpenGLSurface);
|
windowHandle()->setSurfaceType(QWindow::OpenGLSurface);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue