summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-09-19 09:12:39 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-09-27 20:44:31 +0200
commitd35de9e1b250ce46739dcb6afb9ae8a0247195c7 (patch)
treed8f804294564f450537e09db33bd756f776e518d /src/corelib
parente7272ee9bd0bba741e7f277e6dab72faa7ed0606 (diff)
Windows/MinGW: Fix posted events timer not stopping
Specify the type of the enum value SendPostedEventsWindowsTimerId to be UINT_PTR to work with the g++ interpretation of enumeration signedness and use the correct type for the returned timer id. Fixes: QTBUG-78491 Change-Id: I7b3f306d3f60da7a21500ece5243ac90854ccf1a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/kernel/qeventdispatcher_win.cpp7
-rw-r--r--src/corelib/kernel/qeventdispatcher_win_p.h3
2 files changed, 7 insertions, 3 deletions
diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp
index 685d765adb..8ff7637b7e 100644
--- a/src/corelib/kernel/qeventdispatcher_win.cpp
+++ b/src/corelib/kernel/qeventdispatcher_win.cpp
@@ -83,7 +83,10 @@ enum {
WM_QT_SOCKETNOTIFIER = WM_USER,
WM_QT_SENDPOSTEDEVENTS = WM_USER + 1,
WM_QT_ACTIVATENOTIFIERS = WM_USER + 2,
- SendPostedEventsWindowsTimerId = ~1u
+};
+
+enum : UINT_PTR {
+ SendPostedEventsWindowsTimerId = ~UINT_PTR(1)
};
class QEventDispatcherWin32Private;
@@ -278,7 +281,7 @@ LRESULT QT_WIN_CALLBACK qt_GetMessageHook(int code, WPARAM wp, LPARAM lp)
// no more input or timer events in the message queue, we can allow posted events to be sent normally now
if (d->sendPostedEventsWindowsTimerId != 0) {
// stop the timer to send posted events, since we now allow the WM_QT_SENDPOSTEDEVENTS message
- KillTimer(d->internalHwnd, d->sendPostedEventsWindowsTimerId);
+ KillTimer(d->internalHwnd, SendPostedEventsWindowsTimerId);
d->sendPostedEventsWindowsTimerId = 0;
}
(void) d->wakeUps.fetchAndStoreRelease(0);
diff --git a/src/corelib/kernel/qeventdispatcher_win_p.h b/src/corelib/kernel/qeventdispatcher_win_p.h
index dbad2a5450..a3a0cd1c2f 100644
--- a/src/corelib/kernel/qeventdispatcher_win_p.h
+++ b/src/corelib/kernel/qeventdispatcher_win_p.h
@@ -173,7 +173,8 @@ public:
// for controlling when to send posted events
QAtomicInt serialNumber;
- int lastSerialNumber, sendPostedEventsWindowsTimerId;
+ int lastSerialNumber;
+ UINT_PTR sendPostedEventsWindowsTimerId;
QAtomicInt wakeUps;
// timers