Yuhang Zhao
2023-12-06 0287f19b3eabf6b6632d51c0288e6cf0be2c5e69
src/core/contexts/win32windowcontext.cpp
@@ -443,11 +443,17 @@
        static WindowsNativeEventFilter *instance;
        static inline void install() {
            if (instance) {
                return;
            }
            instance = new WindowsNativeEventFilter();
            installNativeEventFilter(instance);
        }
        static inline void uninstall() {
            if (!instance) {
                return;
            }
            removeNativeEventFilter(instance);
            delete instance;
            instance = nullptr;
@@ -539,7 +545,7 @@
        return ::CallWindowProcW(g_qtWindowProc, hWnd, message, wParam, lParam);
    }
    Win32WindowContext::Win32WindowContext(QObject *host, WindowItemDelegate *delegate)
    Win32WindowContext::Win32WindowContext(const QObject *host, const WindowItemDelegate *delegate)
        : AbstractWindowContext(host, delegate) {
    }
@@ -576,9 +582,7 @@
        ::SetWindowLongPtrW(hWnd, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(QWKHookedWndProc));
        // Install global native event filter
        if (!WindowsNativeEventFilter::instance) {
            WindowsNativeEventFilter::install();
        }
        WindowsNativeEventFilter::install();
        // Cache window ID
        windowId = winId;