summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qwineventnotifier.cpp
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2017-10-06 13:09:57 +0200
committerAndré Hartmann <aha_1980@gmx.de>2017-10-15 16:14:04 +0000
commitb5f2bf1a71d926b9bb04101b49a11fd641aad14f (patch)
tree664a311cc457f10d94f6cdb82500b0a32c33f5a5 /src/corelib/kernel/qwineventnotifier.cpp
parent1a039e89beecacaaf55c65e4e4cad5eaf94bb1a0 (diff)
Fix QWinEventNotifier for auto-reset events
Auto-reset events are automatically reset to non-signaled when we get notified about the signaled state. This implies that we cannot check the event state again in activateEventNotifiers. Instead, store the signaled state in a QAtomicInt and test and decrement that. This amends commit 85403d0a. Task-number: QTBUG-63555 Change-Id: I0adee3d2929783f98d91060f9106c8b5266d72fa Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'src/corelib/kernel/qwineventnotifier.cpp')
-rw-r--r--src/corelib/kernel/qwineventnotifier.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/corelib/kernel/qwineventnotifier.cpp b/src/corelib/kernel/qwineventnotifier.cpp
index 6bfa6ca729..362111a2c8 100644
--- a/src/corelib/kernel/qwineventnotifier.cpp
+++ b/src/corelib/kernel/qwineventnotifier.cpp
@@ -157,6 +157,7 @@ void QWinEventNotifier::setHandle(HANDLE hEvent)
Q_D(QWinEventNotifier);
setEnabled(false);
d->handleToEvent = hEvent;
+ d->signaledCount = 0;
}
/*!
@@ -254,6 +255,7 @@ static void CALLBACK wfsoCallback(void *context, BOOLEAN /*ignore*/)
QAbstractEventDispatcher *eventDispatcher = nd->threadData->eventDispatcher.load();
QEventDispatcherWin32Private *edp = QEventDispatcherWin32Private::get(
static_cast<QEventDispatcherWin32 *>(eventDispatcher));
+ ++nd->signaledCount;
SetEvent(edp->winEventNotifierActivatedEvent);
}