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);