From aefd414ce2418bee5d6dacf9092f7a3949f02af8 Mon Sep 17 00:00:00 2001 From: Alex Trotsenko Date: Fri, 18 Sep 2020 19:10:35 +0300 Subject: QWinEventNotifier: unlink from event dispatcher Instead of multiplexing all notifications into a single Qt event for the event dispatcher, we can send 'WinEventAct' event directly for each notifier which activated. This trick improves the performance (esp. on a large number of events) and allows us to remove notifiers handling from the event dispatcher completely. As an alternative to sending Qt events, use of Windows' APC queue in conjunction with waking up the Qt event loop from within the Windows thread pool has been considered. However, that would lead to signal emission asynchronous to the Qt event loop's operation, which is not acceptable. Thanks to Oswald Buddenhagen for the proposed idea. [ChangeLog][QtCore][QAbstractEventDispatcher] The {un}registerEventNotifier() member functions have been removed. QWinEventNotifier is no longer needed to be registered in the event dispatcher. Change-Id: I140892fb909eaae0eabf2e07ebabcab78c43841c Reviewed-by: Oswald Buddenhagen --- src/corelib/kernel/qeventdispatcher_win_p.h | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'src/corelib/kernel/qeventdispatcher_win_p.h') diff --git a/src/corelib/kernel/qeventdispatcher_win_p.h b/src/corelib/kernel/qeventdispatcher_win_p.h index a5c063e062..4637185563 100644 --- a/src/corelib/kernel/qeventdispatcher_win_p.h +++ b/src/corelib/kernel/qeventdispatcher_win_p.h @@ -60,7 +60,6 @@ QT_BEGIN_NAMESPACE -class QWinEventNotifier; class QEventDispatcherWin32Private; // forward declaration @@ -86,10 +85,6 @@ public: bool unregisterTimers(QObject *object) override; QList registeredTimers(QObject *object) const override; - bool registerEventNotifier(QWinEventNotifier *notifier) override; - void unregisterEventNotifier(QWinEventNotifier *notifier) override; - void activateEventNotifiers(); - int remainingTime(int timerId) override; void wakeUp() override; @@ -106,7 +101,6 @@ protected: QEventDispatcherWin32(QEventDispatcherWin32Private &dd, QObject *parent = nullptr); virtual void sendPostedEvents(); void doUnregisterSocketNotifier(QSocketNotifier *notifier); - void doUnregisterEventNotifier(QWinEventNotifier *notifier); private: friend LRESULT QT_WIN_CALLBACK qt_internal_proc(HWND hwnd, UINT message, WPARAM wp, LPARAM lp); @@ -156,7 +150,6 @@ class Q_CORE_EXPORT QEventDispatcherWin32Private : public QAbstractEventDispatch public: QEventDispatcherWin32Private(); ~QEventDispatcherWin32Private(); - static QEventDispatcherWin32Private *get(QEventDispatcherWin32 *q) { return q->d_func(); } QAtomicInt interrupt; @@ -186,12 +179,6 @@ public: bool closingDown = false; - bool winEventNotifierListModified = false; - QAtomicInt activateEventNotifiersPosted; - QList winEventNotifierList; - void postActivateEventNotifiers(); - void activateEventNotifier(QWinEventNotifier * wen); - QList queuedUserInputEvents; QList queuedSocketEvents; }; -- cgit v1.2.3