History

Merge remote-tracking branch 'upstream/master' into stencil2

SamGondelman committed 7 years ago

Commit 06fbc842 parents e7d12dc 2a7ef5c139 files · +5776 −1853Browse files

Showing the changes to interface/src/Application.cpp (1 of 139 files). Show all

Unified · Split

interface/src/Application.cpp+49−31
@@ -1451,6 +1451,34 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 1450 unmodified lines
14511451 _overlays.init(); // do this before scripts load
14521452 DependencyManager::set<ContextOverlayInterface>();
14531453
1454+ auto offscreenUi = getOffscreenUI();
1455+ connect(offscreenUi.data(), &OffscreenUi::desktopReady, []() {
1456+ // Now that we've loaded the menu and thus switched to the previous display plugin
1457+ // we can unlock the desktop repositioning code, since all the positions will be
1458+ // relative to the desktop size for this plugin
1459+ auto offscreenUi = getOffscreenUI();
1460+ auto desktop = offscreenUi->getDesktop();
1461+ if (desktop) {
1462+ desktop->setProperty("repositionLocked", false);
1463+ }
1464+ });
1465+
1466+ connect(offscreenUi.data(), &OffscreenUi::keyboardFocusActive, [this]() {
1467+#if !defined(Q_OS_ANDROID) && !defined(DISABLE_QML)
1468+ // Do not show login dialog if requested not to on the command line
1469+ QString hifiNoLoginCommandLineKey = QString("--").append(HIFI_NO_LOGIN_COMMAND_LINE_KEY);
1470+ int index = arguments().indexOf(hifiNoLoginCommandLineKey);
1471+ if (index != -1) {
1472+ resumeAfterLoginDialogActionTaken();
1473+ return;
1474+ }
1475+
1476+ showLoginScreen();
1477+#else
1478+ resumeAfterLoginDialogActionTaken();
1479+#endif
1480+ });
1481+
14541482 // Initialize the user interface and menu system
14551483 // Needs to happen AFTER the render engine initialization to access its configuration
14561484 initializeUi();
@@ -1805,34 +1833,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 348 unmodified lines
18051833
18061834 updateVerboseLogging();
18071835
1808− // Now that we've loaded the menu and thus switched to the previous display plugin
1809− // we can unlock the desktop repositioning code, since all the positions will be
1810− // relative to the desktop size for this plugin
1811− auto offscreenUi = getOffscreenUI();
1812− connect(offscreenUi.data(), &OffscreenUi::desktopReady, []() {
1813− auto offscreenUi = getOffscreenUI();
1814− auto desktop = offscreenUi->getDesktop();
1815− if (desktop) {
1816− desktop->setProperty("repositionLocked", false);
1817− }
1818− });
1819−
1820− connect(offscreenUi.data(), &OffscreenUi::keyboardFocusActive, [this]() {
1821−#if !defined(Q_OS_ANDROID) && !defined(DISABLE_QML)
1822− // Do not show login dialog if requested not to on the command line
1823− QString hifiNoLoginCommandLineKey = QString("--").append(HIFI_NO_LOGIN_COMMAND_LINE_KEY);
1824− int index = arguments().indexOf(hifiNoLoginCommandLineKey);
1825− if (index != -1) {
1826− resumeAfterLoginDialogActionTaken();
1827− return;
1828− }
1829−
1830− showLoginScreen();
1831−#else
1832− resumeAfterLoginDialogActionTaken();
1833−#endif
1834− });
1835−
18361836 // Make sure we don't time out during slow operations at startup
18371837 updateHeartbeat();
18381838 QTimer* settingsTimer = new QTimer();
@@ -3981,6 +3981,15 @@ static void dumpEventQueue(QThread* thread) { · 2142 unmodified lines
39813981 }
39823982 #endif // DEBUG_EVENT_QUEUE
39833983
3984+bool Application::notify(QObject * object, QEvent * event) {
3985+ if (thread() == QThread::currentThread()) {
3986+ PROFILE_RANGE_IF_LONGER(app, "notify", 2)
3987+ return QApplication::notify(object, event);
3988+ }
3989+
3990+ return QApplication::notify(object, event);
3991+}
3992+
39843993 bool Application::event(QEvent* event) {
39853994
39863995 if (_aboutToQuit) {
@@ -5472,6 +5481,13 @@ void Application::pauseUntilLoginDetermined() { · 1485 unmodified lines
54725481 // disconnect domain handler.
54735482 nodeList->getDomainHandler().disconnect();
54745483
5484+ // From now on, it's permissible to call resumeAfterLoginDialogActionTaken()
5485+ _resumeAfterLoginDialogActionTaken_SafeToRun = true;
5486+
5487+ if (_resumeAfterLoginDialogActionTaken_WasPostponed) {
5488+ // resumeAfterLoginDialogActionTaken() was already called, but it aborted. Now it's safe to call it again.
5489+ resumeAfterLoginDialogActionTaken();
5490+ }
54755491 }
54765492
54775493 void Application::resumeAfterLoginDialogActionTaken() {
@@ -5480,6 +5496,11 @@ void Application::resumeAfterLoginDialogActionTaken() { · 2 unmodified lines
54805496 return;
54815497 }
54825498
5499+ if (!_resumeAfterLoginDialogActionTaken_SafeToRun) {
5500+ _resumeAfterLoginDialogActionTaken_WasPostponed = true;
5501+ return;
5502+ }
5503+
54835504 if (!isHMDMode() && getDesktopTabletBecomesToolbarSetting()) {
54845505 auto toolbar = DependencyManager::get<ToolbarScriptingInterface>()->getToolbar("com.highfidelity.interface.toolbar.system");
54855506 toolbar->writeProperty("visible", true);
@@ -9325,6 +9346,3 @@ void Application::toggleAwayMode(){ · 3839 unmodified lines
93259346
93269347
93279348 #endif
9328−
9329−
9330−#include "Application.moc"