diff --git a/resources/cmake/bootstrap_deps.cmake b/resources/cmake/bootstrap_deps.cmake index d6031b8..e62c47c 100644 --- a/resources/cmake/bootstrap_deps.cmake +++ b/resources/cmake/bootstrap_deps.cmake @@ -77,6 +77,10 @@ set(JSON_Install OFF CACHE BOOL "" FORCE) # FetchContent declarations # ============================================================================ include(FetchContent) +# CMake 4.x rejects cmake_minimum_required < 3.5 declared by glew-cmake 2.2.0. +# The in-place patch below runs too late (after FetchContent_MakeAvailable has +# already configured glew), so raise the floor for all fetched deps up front. +set(CMAKE_POLICY_VERSION_MINIMUM 3.5) set(THIRDPARTY_DIR "${CMAKE_SOURCE_DIR}/thirdparty") message(STATUS "[Installer] Fetching dependencies...") diff --git a/src/window/renderer.cc b/src/window/renderer.cc index b948295..b7f45dd 100644 --- a/src/window/renderer.cc +++ b/src/window/renderer.cc @@ -51,6 +51,8 @@ #include #ifdef _WIN32 #include +#define GLFW_EXPOSE_NATIVE_WIN32 +#include #endif using namespace ImGui; @@ -433,6 +435,17 @@ void SpawnRendererThread(GLFWwindow* window, const char* glsl_version, std::shar if (!hasShown) { glfwShowWindow(window); +#ifdef _WIN32 + // Nudge the outer rect so DWM recomposites the borderless frame; otherwise the + // frame changed while hidden is composited stale on 100% scale displays. + HWND hWnd = glfwGetWin32Window(window); + RECT rect{}; + GetWindowRect(hWnd, &rect); + const int w = rect.right - rect.left; + const int h = rect.bottom - rect.top; + SetWindowPos(hWnd, NULL, 0, 0, w + 1, h, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); + SetWindowPos(hWnd, NULL, 0, 0, w, h, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); +#endif hasShown = true; }