From 7553a0521356d0b28bacb8c8d07a25e4ba26097e Mon Sep 17 00:00:00 2001 From: Maurice Kalinowski Date: Fri, 22 Apr 2016 11:02:13 +0200 Subject: winrt: Disable camera deactivation automation in debug mode Camera control reacts to an application becoming inactive and turns off the camera. However, when debugging or watching internals inside an IDE this feature breaks the state of the application as the IDE gets focus and hence camera is turned off. Change-Id: I6f80476592c0faa32e9da11401f699c6211d226a Reviewed-by: Oliver Wolff --- src/plugins/winrt/qwinrtcameracontrol.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/winrt/qwinrtcameracontrol.cpp b/src/plugins/winrt/qwinrtcameracontrol.cpp index b6068594a..effddafe3 100644 --- a/src/plugins/winrt/qwinrtcameracontrol.cpp +++ b/src/plugins/winrt/qwinrtcameracontrol.cpp @@ -823,6 +823,9 @@ void QWinRTCameraControl::onBufferRequested() void QWinRTCameraControl::onApplicationStateChanged(Qt::ApplicationState state) { qCDebug(lcMMCamera) << __FUNCTION__ << state; +#ifdef _DEBUG + return; +#else // !_DEBUG Q_D(QWinRTCameraControl); static QCamera::State savedState = d->state; switch (state) { @@ -838,6 +841,7 @@ void QWinRTCameraControl::onApplicationStateChanged(Qt::ApplicationState state) default: break; } +#endif // _DEBUG } HRESULT QWinRTCameraControl::initialize() -- cgit v1.2.1