Yuhang Zhao
2025-03-04 1d08c8b1144a62887a2b73903eef4129dc9be207
src/core/contexts/win32windowcontext.cpp
@@ -916,19 +916,12 @@
        Q_UNUSED(oldAttribute)
        const auto hwnd = reinterpret_cast<HWND>(m_windowId);
        if (!hwnd) {
            return false;
        }
        Q_ASSERT(hwnd);
        const DynamicApis &apis = DynamicApis::instance();
        const auto &extendMargins = [this, &apis, hwnd]() {
            // For some unknown reason, the window background is totally black when the host object
            // is a QWidget. And extending the window frame into the client area seems to fix it
            // magically.
            // We don't need the following *HACK* for QtQuick windows.
            if (!m_host->isWidgetType()) {
                return;
            }
            // For some unknown reason, the window background is totally black and extending
            // the window frame into the client area seems to fix it magically.
            // After many times of trying, we found that the Acrylic/Mica/Mica Alt background
            // only appears on the native Win32 window's background, so naturally we want to
            // extend the window frame into the whole client area to be able to let the special
@@ -957,6 +950,7 @@
        const auto &effectBugWorkaround = [this, hwnd]() {
            // We don't need the following *HACK* for QWidget windows.
            // Completely based on actual experiments, root reason is totally unknown.
            if (m_host->isWidgetType()) {
                return;
            }