Zhao Yuhang
2025-02-09 bc03db3759e0d8644e626adcbda066ccb2c30062
fix compilation error for old qt versions

fixes: #161
2个文件已修改
14 ■■■■■ 已修改文件
CMakeLists.txt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/core/contexts/win32windowcontext.cpp 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.19)
project(QWindowKit VERSION 1.3.1.0 LANGUAGES CXX)
project(QWindowKit VERSION 1.3.2.0 LANGUAGES CXX)
# ----------------------------------
# Build Options
src/core/contexts/win32windowcontext.cpp
@@ -2021,13 +2021,17 @@
        // and align it with the upper-left corner of our new client area".
        const auto clientRect = wParam ? &(reinterpret_cast<LPNCCALCSIZE_PARAMS>(lParam))->rgrc[0]
                                       : reinterpret_cast<LPRECT>(lParam);
        [[maybe_unused]] const auto& d3dFlickerReducer = qScopeGuard([this]() {
        [[maybe_unused]] const auto& flickerReducer = qScopeGuard([this]() {
            // When we receive this message, it means the window size has changed
            // already, and it seems this message always come before any client
            // area size notifications (eg. WM_WINDOWPOSCHANGED and WM_SIZE). Let
            // D3D paint immediately to let user see the latest result as soon as
            // possible.
            if (m_windowHandle && m_windowHandle->surfaceType() == QSurface::Direct3DSurface
            // D3D/VK paint immediately to let user see the latest result as soon
            // as possible.
            const auto& isTargetSurface = [](const QSurface::SurfaceType st){
                return st != QSurface::RasterSurface && st != QSurface::OpenGLSurface
                       && st != QSurface::RasterGLSurface && st != QSurface::OpenVGSurface;
            };
            if (m_windowHandle && isTargetSurface(m_windowHandle->surfaceType())
                && isDwmCompositionEnabled() && DynamicApis::instance().pDwmFlush) {
                DynamicApis::instance().pDwmFlush();
            }