summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwindowsysteminterface_p.h
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@digia.com>2014-11-22 15:10:34 +0100
committerMorten Johan Sørvig <morten.sorvig@theqtcompany.com>2015-08-13 18:33:03 +0000
commite5d54c8af778782da13322ddaf1b385c87d51f5e (patch)
treeb351b62bfaf63d66677ad4b661a826af11373c19 /src/gui/kernel/qwindowsysteminterface_p.h
parenta50db99d1590c05d4dd1a9f2b58a10e6ade55d7d (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_p.h')
-rw-r--r--src/gui/kernel/qwindowsysteminterface_p.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/kernel/qwindowsysteminterface_p.h b/src/gui/kernel/qwindowsysteminterface_p.h
index cbc3bad7cd..cc0ca6bf81 100644
--- a/src/gui/kernel/qwindowsysteminterface_p.h
+++ b/src/gui/kernel/qwindowsysteminterface_p.h
@@ -101,7 +101,7 @@ public:
};
explicit WindowSystemEvent(EventType t)
- : type(t), flags(0) { }
+ : type(t), flags(0), eventAccepted(true) { }
virtual ~WindowSystemEvent() { }
bool synthetic() const { return flags & Synthetic; }
@@ -109,6 +109,7 @@ public:
EventType type;
int flags;
+ bool eventAccepted;
};
class CloseEvent : public WindowSystemEvent {
@@ -480,7 +481,7 @@ public:
static WindowSystemEvent *getNonUserInputWindowSystemEvent();
static WindowSystemEvent *peekWindowSystemEvent(EventType t);
static void removeWindowSystemEvent(WindowSystemEvent *event);
- static void handleWindowSystemEvent(WindowSystemEvent *ev);
+ static bool handleWindowSystemEvent(WindowSystemEvent *ev);
static QElapsedTimer eventTime;
static bool synchronousWindowSystemEvents;