From f20be6ab9508e0929783cfd0a2d357b0b74001de Mon Sep 17 00:00:00 2001 From: RH Date: Sat, 27 Apr 2024 05:09:52 +1000 Subject: [PATCH] Ensure the window size is correct (#1855) --- core/platform/GLViewImpl.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/platform/GLViewImpl.cpp b/core/platform/GLViewImpl.cpp index 9d290b16ad..9b8deec6f1 100644 --- a/core/platform/GLViewImpl.cpp +++ b/core/platform/GLViewImpl.cpp @@ -498,6 +498,13 @@ bool GLViewImpl::initWithRect(std::string_view viewName, const ax::Rect& rect, f return false; } + int actualWidth, actualHeight; + glfwGetWindowSize(_mainWindow, &actualWidth, &actualHeight); + if (static_cast(windowSize.width) != actualWidth || static_cast(windowSize.height) != actualHeight) + { + windowSize.set(static_cast(actualWidth), static_cast(actualHeight)); + } + #if defined(AX_USE_METAL) int fbWidth, fbHeight; glfwGetFramebufferSize(_mainWindow, &fbWidth, &fbHeight);