Make sure window is visible before creating wayland vulkan context.

This commit is contained in:
BearOso 2023-07-16 13:20:43 -05:00
parent 3f0f246028
commit 6d71430806
1 changed files with 5 additions and 0 deletions

View File

@ -94,6 +94,11 @@ void EmuCanvasVulkan::createContext()
if (platform == "wayland")
{
wayland_surface = std::make_unique<WaylandSurface>();
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<int>(devicePixelRatio()) });