From 61bafc329d09ecbde59e2c3f0f6bf38eaa738fec Mon Sep 17 00:00:00 2001 From: BearOso Date: Sun, 16 Jul 2023 13:28:44 -0500 Subject: [PATCH] Make sure wayland surface is created for OpenGL, too. --- qt/src/EmuCanvasVulkan.cpp | 5 ----- qt/src/EmuMainWindow.cpp | 3 +++ 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/qt/src/EmuCanvasVulkan.cpp b/qt/src/EmuCanvasVulkan.cpp index 8bc279cf..db44f2cf 100644 --- a/qt/src/EmuCanvasVulkan.cpp +++ b/qt/src/EmuCanvasVulkan.cpp @@ -94,11 +94,6 @@ void EmuCanvasVulkan::createContext() if (platform == "wayland") { wayland_surface = std::make_unique(); - if (!main_window->isVisible()) - { - main_window->setVisible(true); - QGuiApplication::processEvents(); - } auto display = (wl_display *)pni->nativeResourceForWindow("display", window); auto surface = (wl_surface *)pni->nativeResourceForWindow("surface", main_window->windowHandle()); wayland_surface->attach(display, surface, { parent->x(), parent->y(), width(), height(), static_cast(devicePixelRatio()) }); diff --git a/qt/src/EmuMainWindow.cpp b/qt/src/EmuMainWindow.cpp index 76570640..11153771 100644 --- a/qt/src/EmuMainWindow.cpp +++ b/qt/src/EmuMainWindow.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include #include @@ -82,6 +83,8 @@ void EmuMainWindow::createCanvas() if (QGuiApplication::platformName() == "wayland" && app->config->display_driver != "qt") { auto central_widget = new QStackedWidget(); + setVisible(true); + QGuiApplication::processEvents(); if (app->config->display_driver == "vulkan") {