aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/platform/MSWindowsEventQueueBuffer.cpp
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2020-07-21 06:15:04 -0400
committerLibravatarUnit 193 <unit193@unit193.net>2020-07-21 06:15:04 -0400
commitfbc30002ab3438356c0476e70c4577a0310d52c0 (patch)
tree62b4c241ad0b2a65b0e430b9f7710ed944d30fb1 /src/lib/platform/MSWindowsEventQueueBuffer.cpp
parentdff8b887edf10407f22aaab9d147948cd5491f0a (diff)
New upstream version 2.3.3+dfsg.upstream/2.3.3+dfsg
Diffstat (limited to 'src/lib/platform/MSWindowsEventQueueBuffer.cpp')
-rw-r--r--src/lib/platform/MSWindowsEventQueueBuffer.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/lib/platform/MSWindowsEventQueueBuffer.cpp b/src/lib/platform/MSWindowsEventQueueBuffer.cpp
index f6de157..3111367 100644
--- a/src/lib/platform/MSWindowsEventQueueBuffer.cpp
+++ b/src/lib/platform/MSWindowsEventQueueBuffer.cpp
@@ -21,6 +21,7 @@
#include "arch/win32/ArchMiscWindows.h"
#include "mt/Thread.h"
#include "base/IEventQueue.h"
+#include <VersionHelpers.h>
//
// EventQueueTimer
@@ -48,6 +49,15 @@ MSWindowsEventQueueBuffer::MSWindowsEventQueueBuffer(IEventQueue* events) :
// make sure this thread has a message queue
MSG dummy;
PeekMessage(&dummy, NULL, WM_USER, WM_USER, PM_NOREMOVE);
+
+ m_os_supported_message_types = QS_ALLINPUT;
+ if (!IsWindows8OrGreater())
+ {
+ // don't use QS_POINTER, QS_TOUCH
+ // because they can cause GetQueueStatus() to always return 0 and we miss events
+ // since those flags are confusing Windows 7. See QTBUG-29097 for related info
+ m_os_supported_message_types &= ~(QS_TOUCH | QS_POINTER);
+ }
}
MSWindowsEventQueueBuffer::~MSWindowsEventQueueBuffer()
@@ -79,7 +89,7 @@ MSWindowsEventQueueBuffer::waitForEvent(double timeout)
// cancellation but that's okay because we're run in the main
// thread and we never cancel that thread.
HANDLE dummy[1];
- MsgWaitForMultipleObjects(0, dummy, FALSE, t, QS_ALLINPUT);
+ MsgWaitForMultipleObjects(0, dummy, FALSE, t, m_os_supported_message_types);
}
IEventQueueBuffer::Type
@@ -128,9 +138,7 @@ MSWindowsEventQueueBuffer::addEvent(UInt32 dataID)
bool
MSWindowsEventQueueBuffer::isEmpty() const
{
- // don't use QS_POINTER, QS_TOUCH, or any meta-flags that include them (like QS_ALLINPUT)
- // because they can cause GetQueueStatus() to always return 0 and we miss events
- return (HIWORD(GetQueueStatus(QS_POSTMESSAGE)) == 0);
+ return (HIWORD(GetQueueStatus(m_os_supported_message_types)) == 0);
}
EventQueueTimer*