From a9c357c40d29e9a7ea59ffa80214657ef58c7dbe Mon Sep 17 00:00:00 2001
From: Zhao Yuhang <2546789017@qq.com>
Date: 周一, 27 5月 2024 23:18:42 +0800
Subject: [PATCH] Fix typo

---
 src/core/contexts/win32windowcontext.cpp |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/core/contexts/win32windowcontext.cpp b/src/core/contexts/win32windowcontext.cpp
index 43d5cb6..3fa910e 100644
--- a/src/core/contexts/win32windowcontext.cpp
+++ b/src/core/contexts/win32windowcontext.cpp
@@ -81,6 +81,8 @@
 
     static void setInternalWindowFrameMargins(QWindow *window, const QMargins &margins) {
         const QVariant marginsVar = QVariant::fromValue(margins);
+
+        // TODO: Add comments
         window->setProperty("_q_windowsCustomMargins", marginsVar);
 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
         if (QPlatformWindow *platformWindow = window->handle()) {
@@ -829,6 +831,12 @@
         if (key == QStringLiteral("border-thickness")) {
             return m_windowId
                        ? int(getWindowFrameBorderThickness(reinterpret_cast<HWND>(m_windowId)))
+                       : 0;
+        }
+
+        if (key == QStringLiteral("title-bar-height")) {
+            return m_windowId
+                       ? int(getTitleBarHeight(reinterpret_cast<HWND>(m_windowId)))
                        : 0;
         }
         return AbstractWindowContext::windowAttribute(key);
@@ -1950,9 +1958,9 @@
             // that's also how most applications customize their title bars on Windows. It's
             // totally OK but since we want to preserve as much original frame as possible,
             // we can't use that solution.
-            const LRESULT hitTestResult = ::DefWindowProcW(hWnd, WM_NCCALCSIZE, wParam, lParam);
-            if ((hitTestResult != HTERROR) && (hitTestResult != HTNOWHERE)) {
-                *result = hitTestResult;
+            const LRESULT originalResult = ::DefWindowProcW(hWnd, WM_NCCALCSIZE, wParam, lParam);
+            if (originalResult != 0) {
+                *result = originalResult;
                 return true;
             }
             // Re-apply the original top from before the size of the default frame was

--
Gitblit v1.9.1