From 5adf9adb0e8321e21e50cba65764f7e5fd0d8a78 Mon Sep 17 00:00:00 2001 From: Bradley Austin Davis Date: Tue, 2 Feb 2016 12:00:17 -0800 Subject: [PATCH 1/2] Make mirror rectaqngle move with mirror controls --- interface/src/Application.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index ab5edec527..883b082d0e 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1362,6 +1362,9 @@ void Application::paintGL() { renderArgs._renderMode = RenderArgs::MIRROR_RENDER_MODE; renderArgs._blitFramebuffer = DependencyManager::get()->getSelfieFramebuffer(); + auto inputs = AvatarInputs::getInstance(); + _mirrorViewRect.moveTo(inputs->x(), inputs->y()); + renderRearViewMirror(&renderArgs, _mirrorViewRect); renderArgs._blitFramebuffer.reset(); From 2c26b32341fa53453aa6bacf4aed4557c53e960f Mon Sep 17 00:00:00 2001 From: Bradley Austin Davis Date: Tue, 2 Feb 2016 12:00:58 -0800 Subject: [PATCH 2/2] Make QML based tool-windows close properly --- libraries/ui/src/QmlWindowClass.cpp | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/libraries/ui/src/QmlWindowClass.cpp b/libraries/ui/src/QmlWindowClass.cpp index 3874b85a12..0e834fa379 100644 --- a/libraries/ui/src/QmlWindowClass.cpp +++ b/libraries/ui/src/QmlWindowClass.cpp @@ -220,18 +220,7 @@ QmlWindowClass::QmlWindowClass(QObject* qmlWindow) } QmlWindowClass::~QmlWindowClass() { - if (_qmlWindow) { - if (_toolWindow) { - auto offscreenUi = DependencyManager::get(); - auto toolWindow = offscreenUi->getToolWindow(); - auto invokeResult = QMetaObject::invokeMethod(toolWindow, "removeTabForUrl", Qt::QueuedConnection, - Q_ARG(QVariant, _source)); - Q_ASSERT(invokeResult); - } else { - _qmlWindow->deleteLater(); - } - _qmlWindow = nullptr; - } + close(); } void QmlWindowClass::registerObject(const QString& name, QObject* object) { @@ -331,14 +320,18 @@ void QmlWindowClass::setTitle(const QString& title) { } void QmlWindowClass::close() { - DependencyManager::get()->executeOnUiThread([this] { - if (_qmlWindow) { - _qmlWindow->setProperty("destroyOnInvisible", true); - _qmlWindow->setProperty("visible", false); + if (_qmlWindow) { + if (_toolWindow) { + auto offscreenUi = DependencyManager::get(); + auto toolWindow = offscreenUi->getToolWindow(); + auto invokeResult = QMetaObject::invokeMethod(toolWindow, "removeTabForUrl", Qt::QueuedConnection, + Q_ARG(QVariant, _source)); + Q_ASSERT(invokeResult); + } else { _qmlWindow->deleteLater(); - _qmlWindow = nullptr; } - }); + _qmlWindow = nullptr; + } } void QmlWindowClass::hasClosed() {