Skip to content

Commit bc03db3

Browse files
committed
fix compilation error for old qt versions
fixes: #161
1 parent 5f3f1b3 commit bc03db3

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.19)
22

3-
project(QWindowKit VERSION 1.3.1.0 LANGUAGES CXX)
3+
project(QWindowKit VERSION 1.3.2.0 LANGUAGES CXX)
44

55
# ----------------------------------
66
# Build Options

src/core/contexts/win32windowcontext.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2021,13 +2021,17 @@ namespace QWK {
20212021
// and align it with the upper-left corner of our new client area".
20222022
const auto clientRect = wParam ? &(reinterpret_cast<LPNCCALCSIZE_PARAMS>(lParam))->rgrc[0]
20232023
: reinterpret_cast<LPRECT>(lParam);
2024-
[[maybe_unused]] const auto& d3dFlickerReducer = qScopeGuard([this]() {
2024+
[[maybe_unused]] const auto& flickerReducer = qScopeGuard([this]() {
20252025
// When we receive this message, it means the window size has changed
20262026
// already, and it seems this message always come before any client
20272027
// area size notifications (eg. WM_WINDOWPOSCHANGED and WM_SIZE). Let
2028-
// D3D paint immediately to let user see the latest result as soon as
2029-
// possible.
2030-
if (m_windowHandle && m_windowHandle->surfaceType() == QSurface::Direct3DSurface
2028+
// D3D/VK paint immediately to let user see the latest result as soon
2029+
// as possible.
2030+
const auto& isTargetSurface = [](const QSurface::SurfaceType st){
2031+
return st != QSurface::RasterSurface && st != QSurface::OpenGLSurface
2032+
&& st != QSurface::RasterGLSurface && st != QSurface::OpenVGSurface;
2033+
};
2034+
if (m_windowHandle && isTargetSurface(m_windowHandle->surfaceType())
20312035
&& isDwmCompositionEnabled() && DynamicApis::instance().pDwmFlush) {
20322036
DynamicApis::instance().pDwmFlush();
20332037
}

0 commit comments

Comments
 (0)