diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2012-11-20 16:53:27 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-11-21 16:36:50 +0100 |
commit | 9b49c0561e0b13caeee462d931dc22008e3c4587 (patch) | |
tree | 14570f24b14a56ea8565ac86a1eb219cf7a97649 /src/gui/kernel/qwindowsysteminterface_p.h | |
parent | 31c6d554458b27c88f432c2b9c37baacf5e4b454 (diff) |
Handle QEventLoop::ExcludeUserInputEvents in QWindowSystemInterface.
Add a flag indicating user input events to the event type and
leave those events in the queue if
QEventLoop::ExcludeUserInputEvents is set.
Task-number: QTBUG-27595
Change-Id: Ib41b826ef3be19253cd582d9894dd7c87953711f
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'src/gui/kernel/qwindowsysteminterface_p.h')
-rw-r--r-- | src/gui/kernel/qwindowsysteminterface_p.h | 58 |
1 files changed, 34 insertions, 24 deletions
diff --git a/src/gui/kernel/qwindowsysteminterface_p.h b/src/gui/kernel/qwindowsysteminterface_p.h index b174fd0ca2..e8d2a85dd9 100644 --- a/src/gui/kernel/qwindowsysteminterface_p.h +++ b/src/gui/kernel/qwindowsysteminterface_p.h @@ -66,30 +66,31 @@ QT_BEGIN_NAMESPACE class Q_GUI_EXPORT QWindowSystemInterfacePrivate { public: enum EventType { - Close, - GeometryChange, - Enter, - Leave, - ActivatedWindow, - WindowStateChanged, - Mouse, - FrameStrutMouse, - Wheel, - Key, - Touch, - ScreenOrientation, - ScreenGeometry, - ScreenAvailableGeometry, - ScreenLogicalDotsPerInch, - ScreenRefreshRate, - ThemeChange, - Expose, - FileOpen, - Tablet, - TabletEnterProximity, - TabletLeaveProximity, - PlatformPanel, - ContextMenu + UserInputEvent = 0x100, + Close = UserInputEvent | 0x01, + GeometryChange = 0x02, + Enter = UserInputEvent | 0x03, + Leave = UserInputEvent | 0x04, + ActivatedWindow = 0x05, + WindowStateChanged = 0x06, + Mouse = UserInputEvent | 0x07, + FrameStrutMouse = UserInputEvent | 0x08, + Wheel = UserInputEvent | 0x09, + Key = UserInputEvent | 0x0a, + Touch = UserInputEvent | 0x0b, + ScreenOrientation = 0x0c, + ScreenGeometry = 0x0d, + ScreenAvailableGeometry = 0x0e, + ScreenLogicalDotsPerInch = 0x0f, + ScreenRefreshRate = 0x10, + ThemeChange = 0x11, + Expose = 0x12, + FileOpen = UserInputEvent | 0x13, + Tablet = UserInputEvent | 0x14, + TabletEnterProximity = UserInputEvent | 0x15, + TabletLeaveProximity = UserInputEvent | 0x16, + PlatformPanel = UserInputEvent | 0x17, + ContextMenu = UserInputEvent | 0x18 }; class WindowSystemEvent { @@ -374,6 +375,14 @@ public: { const QMutexLocker locker(&mutex); impl.prepend(e); } WindowSystemEvent *takeFirstOrReturnNull() { const QMutexLocker locker(&mutex); return impl.empty() ? 0 : impl.takeFirst(); } + WindowSystemEvent *takeFirstNonUserInputOrReturnNull() + { + const QMutexLocker locker(&mutex); + for (int i = 0; i < impl.size(); ++i) + if (!(impl.at(i)->type & QWindowSystemInterfacePrivate::UserInputEvent)) + return impl.takeAt(i); + return 0; + } void append(WindowSystemEvent *e) { const QMutexLocker locker(&mutex); impl.append(e); } int count() const @@ -405,6 +414,7 @@ public: static int windowSystemEventsQueued(); static WindowSystemEvent *getWindowSystemEvent(); + static WindowSystemEvent *getNonUserInputWindowSystemEvent(); static WindowSystemEvent *peekWindowSystemEvent(EventType t); static void removeWindowSystemEvent(WindowSystemEvent *event); static void handleWindowSystemEvent(WindowSystemEvent *ev); |