diff options
author | Morten Johan Sørvig <morten.sorvig@digia.com> | 2014-11-22 15:10:34 +0100 |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@theqtcompany.com> | 2015-08-13 18:33:03 +0000 |
commit | e5d54c8af778782da13322ddaf1b385c87d51f5e (patch) | |
tree | b351b62bfaf63d66677ad4b661a826af11373c19 /src/gui/kernel/qwindowsysteminterface.cpp | |
parent | a50db99d1590c05d4dd1a9f2b58a10e6ade55d7d (diff) |
Propagate event accepted state to platform plugins
Add en "eventAccepted" field to WindowSystemEvent,
where the event subclasses can record the event
acceptance status. Make handleWindowSystemEvent()
return the accepted status.
This works for synchronous event processing only. If
the event is placed on the QPA event queue then there
is no way to return the accepted state immediately.
In the latter case handleWindowSystemEvent() always
returns "true".
Change-Id: I081aecc54f43588d42d3aaeec7f8458f06937601
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
Diffstat (limited to 'src/gui/kernel/qwindowsysteminterface.cpp')
-rw-r--r-- | src/gui/kernel/qwindowsysteminterface.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp index 3ab2f59661..8c429150a8 100644 --- a/src/gui/kernel/qwindowsysteminterface.cpp +++ b/src/gui/kernel/qwindowsysteminterface.cpp @@ -441,10 +441,12 @@ void QWindowSystemInterfacePrivate::removeWindowSystemEvent(WindowSystemEvent *e windowSystemEventQueue.remove(event); } -void QWindowSystemInterfacePrivate::handleWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent *ev) +bool QWindowSystemInterfacePrivate::handleWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent *ev) { + bool accepted = true; if (synchronousWindowSystemEvents) { QGuiApplicationPrivate::processWindowSystemEvent(ev); + accepted = ev->eventAccepted; delete ev; } else { windowSystemEventQueue.append(ev); @@ -452,6 +454,7 @@ void QWindowSystemInterfacePrivate::handleWindowSystemEvent(QWindowSystemInterfa if (dispatcher) dispatcher->wakeUp(); } + return accepted; } void QWindowSystemInterface::registerTouchDevice(QTouchDevice *device) |