diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2022-12-15 12:05:01 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-15 12:05:01 -0500 |
commit | 3ff7a5de1a54c9f478b23de1a0bd6c6188ea80a6 (patch) | |
tree | 0d014da28cf6a8a1045cd2a7d7df8301522ea47c /src/yuzu/bootmanager.cpp | |
parent | e2f32e8c88621dbb816d38bc1ffc610d7eb2ae03 (diff) | |
parent | 09e3029c1118616394e5e9c45dfcdd4adcdf86ad (diff) |
Merge pull request #7410 from Nefsen402/wayland-fixes
Wayland fixes
Diffstat (limited to 'src/yuzu/bootmanager.cpp')
-rw-r--r-- | src/yuzu/bootmanager.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp index 5b5b6fed8..1a47fb9c9 100644 --- a/src/yuzu/bootmanager.cpp +++ b/src/yuzu/bootmanager.cpp @@ -61,8 +61,6 @@ void EmuThread::run() { // Main process has been loaded. Make the context current to this thread and begin GPU and CPU // execution. - gpu.Start(); - gpu.ObtainContext(); emit LoadProgress(VideoCore::LoadCallbackStage::Prepare, 0, 0); @@ -77,6 +75,7 @@ void EmuThread::run() { emit LoadProgress(VideoCore::LoadCallbackStage::Complete, 0, 0); gpu.ReleaseContext(); + gpu.Start(); system.GetCpuManager().OnGpuReady(); @@ -224,6 +223,7 @@ class RenderWidget : public QWidget { public: explicit RenderWidget(GRenderWindow* parent) : QWidget(parent), render_window(parent) { setAttribute(Qt::WA_NativeWindow); + setAttribute(Qt::WA_DontCreateNativeAncestors); setAttribute(Qt::WA_PaintOnScreen); } @@ -314,6 +314,8 @@ GRenderWindow::GRenderWindow(GMainWindow* parent, EmuThread* emu_thread_, input_subsystem->Initialize(); this->setMouseTracking(true); + strict_context_required = QGuiApplication::platformName() == QStringLiteral("wayland"); + connect(this, &GRenderWindow::FirstFrameDisplayed, parent, &GMainWindow::OnLoadComplete); connect(this, &GRenderWindow::ExecuteProgramSignal, parent, &GMainWindow::OnExecuteProgram, Qt::QueuedConnection); @@ -952,6 +954,12 @@ void GRenderWindow::OnMinimalClientAreaChangeRequest(std::pair<u32, u32> minimal bool GRenderWindow::InitializeOpenGL() { #ifdef HAS_OPENGL + if (!QOpenGLContext::supportsThreadedOpenGL()) { + QMessageBox::warning(this, tr("OpenGL not available!"), + tr("OpenGL shared contexts are not supported.")); + return false; + } + // TODO: One of these flags might be interesting: WA_OpaquePaintEvent, WA_NoBackground, // WA_DontShowOnScreen, WA_DeleteOnClose auto child = new OpenGLRenderWidget(this); |