Sine Striker
2024-05-08 5778d4540f0b522946c84c8ba601456f2d440f78
Fix a mistake
1个文件已修改
9 ■■■■■ 已修改文件
src/core/contexts/win32windowcontext.cpp 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/core/contexts/win32windowcontext.cpp
@@ -1389,6 +1389,7 @@
                                    // until the menu returns
                                    iconButtonClickTime = ::GetTickCount64();
                                    *result = ::DefWindowProcW(hWnd, message, wParam, lParam);
                                    iconButtonClickTime = 0;
                                    if (iconButtonClickLevel & IconButtonTriggersClose) {
                                        ::PostMessageW(hWnd, WM_SYSCOMMAND, SC_CLOSE, 0);
                                    }
@@ -2105,7 +2106,10 @@
                const POINT nativeLocalPos = getNativePosFromMouse();
                const QPoint qtScenePos =
                    QHighDpi::fromNativeLocalPosition(point2qpoint(nativeLocalPos), m_windowHandle);
                if (isInTitleBarDraggableArea(qtScenePos)) {
                WindowAgentBase::SystemButton sysButtonType = WindowAgentBase::Unknown;
                if (isInTitleBarDraggableArea(qtScenePos) ||
                    (isInSystemButtons(qtScenePos, &sysButtonType) &&
                     sysButtonType == WindowAgentBase::WindowIcon)) {
                    shouldShowSystemMenu = true;
                    nativeGlobalPos = nativeLocalPos;
                    ::ClientToScreen(hWnd, &nativeGlobalPos);
@@ -2209,7 +2213,6 @@
                ::UnhookWindowsHookEx(mouseHook);
                // Emulate the Windows icon button's behavior
                static uint32_t doubleClickTime = ::GetDoubleClickTime();
                if (!res && mouseClickPos.has_value()) {
                    POINT nativeLocalPos = mouseClickPos.value();
                    ::ScreenToClient(hWnd, &nativeLocalPos);
@@ -2219,7 +2222,7 @@
                    if (isInSystemButtons(qtScenePos, &sysButtonType) &&
                        sysButtonType == WindowAgentBase::WindowIcon) {
                        iconButtonClickLevel |= IconButtonClicked;
                        if (::GetTickCount64() - iconButtonClickTime <= doubleClickTime) {
                        if (::GetTickCount64() - iconButtonClickTime <= ::GetDoubleClickTime()) {
                            iconButtonClickLevel |= IconButtonTriggersClose;
                        }
                    }