From f899ab7c34035bc3746112b6459bd15a4a181dd4 Mon Sep 17 00:00:00 2001 From: Colin Kinloch Date: Wed, 17 Jan 2024 01:09:56 +0000 Subject: [PATCH] Vulkan: Check for 0 size before wayland resize Fixes "Launching games directly with the --title-id argument doesn't work in Wayland" (#999) --- src/gui/canvas/VulkanCanvas.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gui/canvas/VulkanCanvas.cpp b/src/gui/canvas/VulkanCanvas.cpp index eb56b3c4..8b0c8506 100644 --- a/src/gui/canvas/VulkanCanvas.cpp +++ b/src/gui/canvas/VulkanCanvas.cpp @@ -66,6 +66,10 @@ void VulkanCanvas::OnPaint(wxPaintEvent& event) void VulkanCanvas::OnResize(wxSizeEvent& event) { + const wxSize size = GetSize(); + if (size.GetWidth() == 0 || size.GetHeight() == 0) + return; + #if BOOST_OS_LINUX && HAS_WAYLAND if(m_subsurface) { @@ -73,9 +77,6 @@ void VulkanCanvas::OnResize(wxSizeEvent& event) m_subsurface->setSize(sRect.GetX(), sRect.GetY(), sRect.GetWidth(), sRect.GetHeight()); } #endif - const wxSize size = GetSize(); - if (size.GetWidth() == 0 || size.GetHeight() == 0) - return; const wxRect refreshRect(size); RefreshRect(refreshRect, false);