Skip to content

Commit

Permalink
Optionally force delivery of TUIO pseudo touch events
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
arielmol committed Feb 12, 2016
1 parent 3fa7035 commit 2ee7541
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/plugins/generic/tuiotouch/qtuiohandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 2ee7541

Please sign in to comment.