diff options
author | Ariel Molina <ariel@edis.mx> | 2016-02-10 12:47:29 -0600 |
---|---|---|
committer | Ariel Molina R <ariel@edis.mx> | 2016-02-12 04:08:43 +0000 |
commit | 2ee75416169ba9cda8a021b119c4c217599d03b9 (patch) | |
tree | 376ce19aa08ae84055a2df101441b696327a2ecc /src/plugins | |
parent | 3fa7035b53a30b9aaa8566045ed157898bdcd06b (diff) |
Optionally force delivery of TUIO pseudo touch events
TUIO is not a standard "device" as the first application takes
exclusive ownership, this patch makes it deliver the events to the root
window when the app is not focused, allowing for interactive
application development on simulators running on the same desktop.
To force delivery set the environment variable
QT_TUIOTOUCH_DELIVER_WITHOUT_FOCUS to 1
Change-Id: I157f59982a1b2025ef8efdf709fe40c78339c1b4
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/generic/tuiotouch/qtuiohandler.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/plugins/generic/tuiotouch/qtuiohandler.cpp b/src/plugins/generic/tuiotouch/qtuiohandler.cpp index 7ed268c2d4..4b4d08441f 100644 --- a/src/plugins/generic/tuiotouch/qtuiohandler.cpp +++ b/src/plugins/generic/tuiotouch/qtuiohandler.cpp @@ -321,6 +321,14 @@ void QTuioHandler::process2DCurFseq(const QOscMessage &message) Q_UNUSED(message); // TODO: do we need to do anything with the frame id? QWindow *win = QGuiApplication::focusWindow(); + // With TUIO the first application takes exclusive ownership of the "device" + // we cannot attach more than one application to the same port anyway. + // Forcing delivery makes it easy to use simulators in the same machine + // and forget about headaches about unfocused TUIO windows. + static bool forceDelivery = qEnvironmentVariableIsSet("QT_TUIOTOUCH_DELIVER_WITHOUT_FOCUS"); + if (!win && QGuiApplication::topLevelWindows().length() > 0 && forceDelivery) + win = QGuiApplication::topLevelWindows().at(0); + if (!win) return; |