From f01164481c423b496d899532154914fbecebef35 Mon Sep 17 00:00:00 2001
From: Sine Striker <trueful@163.com>
Date: 周六, 24 2月 2024 04:13:51 +0800
Subject: [PATCH] minor tweaks

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

diff --git a/src/core/contexts/win32windowcontext.cpp b/src/core/contexts/win32windowcontext.cpp
index 841273a..9a0d786 100644
--- a/src/core/contexts/win32windowcontext.cpp
+++ b/src/core/contexts/win32windowcontext.cpp
@@ -10,10 +10,12 @@
 #include <QtCore/QScopeGuard>
 #include <QtCore/QTimer>
 #include <QtCore/QDateTime>
+#include <QtCore/QAbstractEventDispatcher>
 #include <QtGui/QGuiApplication>
 #include <QtGui/QPainter>
 #include <QtGui/QPalette>
 
+#include <QtGui/qpa/qwindowsysteminterface.h>
 #include <QtGui/private/qhighdpiscaling_p.h>
 #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
 #  include <QtGui/private/qguiapplication_p.h>
@@ -441,9 +443,12 @@
         return false;
     }
 
-    static inline bool forwardFilteredEvents(QWindow *window, HWND hWnd, UINT message,
-                                             WPARAM wParam, LPARAM lParam, LRESULT *result) {
+    static inline bool forwardFilteredEvent(QWindow *window, HWND hWnd, UINT message, WPARAM wParam,
+                                            LPARAM lParam, LRESULT *result) {
         MSG msg = createMessageBlock(hWnd, message, wParam, lParam);
+
+        // https://github.com/qt/qtbase/blob/e26a87f1ecc40bc8c6aa5b889fce67410a57a702/src/plugins/platforms/windows/qwindowscontext.cpp#L1025
+        // Do exact the same as what Qt Windows plugin does.
 
         // Run the native event filters. QTBUG-67095: Exclude input messages which are sent
         // by QEventDispatcherWin32::processEvents()
@@ -590,7 +595,7 @@
             // Forward the event to user-defined native event filters, there may be some messages
             // that need to be processed by the user.
             std::ignore =
-                forwardFilteredEvents(ctx->window(), hWnd, message, wParam, lParam, &result);
+                forwardFilteredEvent(ctx->window(), hWnd, message, wParam, lParam, &result);
             return result;
         }
 

--
Gitblit v1.9.1