Bug 295278

Summary: QEventLoop goes to sleep even if events are in the queue
Product: [Unmaintained] Necessitas Reporter: cd
Component: Android Qt4Assignee: BogDan Vatra <bogdan>
Status: RESOLVED FIXED    
Severity: major    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In: alpha4
Sentry Crash Report:
Attachments: Fix (HACK) for QEventDispatcherUNIX on Android

Description cd 2012-03-03 22:19:15 UTC
Created attachment 69262 [details]
Fix (HACK) for QEventDispatcherUNIX on Android

QEventDispatcherUNIX only sends wakeup-tokens to the pipe if the atomic wakeUps-variable is not set to 1. Somehow the atomic access seems to fail sometimes which results in "stuck" events. These are delivered only together with the next event - most probably a mouse touch event.

The test cases in android-qt/tests/auto/qatomicint seem to work, however the tests in  android-qt/tests/auto/qeventloop fail horribly.

The attached patch fixes the problem (and the tests), but increases battery usage because of unnecessary wakeups.
Comment 1 BogDan Vatra 2012-05-26 17:21:57 UTC
Git commit 717ab0d3bc52758ed5238e6f2170a7144e37587a by BogDan Vatra.
Committed on 26/05/2012 at 19:21.
Pushed by vatra into branch 'alpha4'.

Prevent QEventLoop to go to sleep if events are in the queue

Fix qeventloop test.
FIXED-IN: alpha4

M  +5    -11   src/corelib/kernel/qeventdispatcher_unix.cpp
M  +0    -1    src/corelib/kernel/qeventdispatcher_unix_p.h
M  +1    -1    tests/auto/qeventloop/tst_qeventloop.cpp

http://commits.kde.org/android-qt/717ab0d3bc52758ed5238e6f2170a7144e37587a
Comment 2 BogDan Vatra 2012-05-26 17:21:57 UTC
Git commit 717ab0d3bc52758ed5238e6f2170a7144e37587a by BogDan Vatra.
Committed on 26/05/2012 at 19:21.
Pushed by vatra into branch 'alpha4'.

Prevent QEventLoop to go to sleep if events are in the queue

Fix qeventloop test.
FIXED-IN: alpha4

M  +5    -11   src/corelib/kernel/qeventdispatcher_unix.cpp
M  +0    -1    src/corelib/kernel/qeventdispatcher_unix_p.h
M  +1    -1    tests/auto/qeventloop/tst_qeventloop.cpp

http://commits.kde.org/android-qt/717ab0d3bc52758ed5238e6f2170a7144e37587a