Sine Striker
2024-11-21 c3ef42dad254f6d04cab521c9ae619a46bb84f7a
Fix #151 and a crash bug related to sub frameless window
6个文件已修改
38 ■■■■ 已修改文件
share/qmake/QWKCore.pri.in 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
share/qmake/QWKQuick.pri.in 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
share/qmake/QWKWidgets.pri.in 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/core/contexts/win32windowcontext.cpp 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/quick/quickwindowagent.cpp 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/widgets/widgetwindowagent.cpp 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
share/qmake/QWKCore.pri.in
@@ -12,7 +12,7 @@
        $$QMAKE_QWK_INSTALL_PREFIX/$$QMAKE_QWK_INSTALL_INCDIR/QWindowKit
    # Shared link directory
    LIBS += \
    QMAKE_QWK_LIB_PATHS += \
        "-L$$QMAKE_QWK_INSTALL_PREFIX/$$QMAKE_QWK_INSTALL_LIBDIR"
    
    CONFIG(debug, debug|release) {
@@ -21,5 +21,7 @@
        LIBS += -l@QMAKE_QWK_CORE_NAME_RELEASE@
    }
    LIBS = $$QMAKE_QWK_LIB_PATHS $$LIBS
    @QMAKE_QWK_CORE_STATIC_MACRO@
}
share/qmake/QWKQuick.pri.in
@@ -4,10 +4,12 @@
    include($$PWD/QWKCore.pri)
    CONFIG(debug, debug|release) {
        LIBS += -l@QMAKE_QWK_QUICK_NAME_DEBUG@
        LIBS = -l@QMAKE_QWK_QUICK_NAME_DEBUG@ $$LIBS
    } else {
        LIBS += -l@QMAKE_QWK_QUICK_NAME_RELEASE@
        LIBS = -l@QMAKE_QWK_QUICK_NAME_RELEASE@ $$LIBS
    }
    LIBS = $$QMAKE_QWK_LIB_PATHS $$LIBS
    @QMAKE_QWK_QUICK_STATIC_MACRO@
}
share/qmake/QWKWidgets.pri.in
@@ -4,10 +4,12 @@
    include($$PWD/QWKCore.pri)
    CONFIG(debug, debug|release) {
        LIBS += -l@QMAKE_QWK_WIDGETS_NAME_DEBUG@
        LIBS = -l@QMAKE_QWK_WIDGETS_NAME_DEBUG@ $$LIBS
    } else {
        LIBS += -l@QMAKE_QWK_WIDGETS_NAME_RELEASE@
        LIBS = -l@QMAKE_QWK_WIDGETS_NAME_RELEASE@ $$LIBS
    }
    LIBS = $$QMAKE_QWK_LIB_PATHS $$LIBS
    @QMAKE_QWK_WIDGETS_STATIC_MACRO@
}
src/core/contexts/win32windowcontext.cpp
@@ -827,6 +827,10 @@
            return isSystemBorderEnabled() && !isWin11OrGreater();
        }
        if (key == QStringLiteral("windows-system-border-enabled")) {
            return isSystemBorderEnabled();
        }
        if (key == QStringLiteral("border-thickness")) {
            return m_windowId
                       ? int(getWindowFrameBorderThickness(reinterpret_cast<HWND>(m_windowId)))
@@ -845,16 +849,10 @@
        lastHitTestResult = WindowPart::Outside;
        lastHitTestResultRaw = HTNOWHERE;
        if (!isSystemBorderEnabled()) {
            m_delegate->setWindowFlags(m_host, m_delegate->getWindowFlags(m_host) |
                                                   Qt::FramelessWindowHint);
        }
        // If the original window id is valid, remove all resources related
        if (oldWinId) {
            removeManagedWindow(reinterpret_cast<HWND>(oldWinId));
        }
        if (!winId) {
            return;
        }
src/quick/quickwindowagent.cpp
@@ -50,6 +50,12 @@
#if defined(Q_OS_WINDOWS) && QWINDOWKIT_CONFIG(ENABLE_WINDOWS_SYSTEM_BORDERS)
        d->setupWindows10BorderWorkaround();
#endif
#ifdef Q_OS_WINDOWS
        if (!windowAttribute(QStringLiteral("windows-system-border-enabled")).toBool()) {
            window->setFlag(Qt::FramelessWindowHint);
        }
#endif
        return true;
    }
src/widgets/widgetwindowagent.cpp
@@ -64,6 +64,12 @@
#if defined(Q_OS_WINDOWS) && QWINDOWKIT_CONFIG(ENABLE_WINDOWS_SYSTEM_BORDERS)
        d->setupWindows10BorderWorkaround();
#endif
#ifdef Q_OS_WINDOWS
        if (!windowAttribute(QStringLiteral("windows-system-border-enabled")).toBool()) {
            w->setWindowFlag(Qt::FramelessWindowHint);
        }
#endif
        return true;
    }