Showing the changes to interface/src/Application.cpp (1 of 139 files). Show all
Unified · Split
| @@ -1451,6 +1451,34 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 1450 unmodified lines | |||
| 1451 | _overlays.init(); // do this before scripts load | 1451 | _overlays.init(); // do this before scripts load |
| 1452 | DependencyManager::set<ContextOverlayInterface>(); | 1452 | DependencyManager::set<ContextOverlayInterface>(); |
| 1453 | 1453 | ||
| 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 | |||
| 1454 | // Initialize the user interface and menu system | 1482 | // Initialize the user interface and menu system |
| 1455 | // Needs to happen AFTER the render engine initialization to access its configuration | 1483 | // Needs to happen AFTER the render engine initialization to access its configuration |
| 1456 | initializeUi(); | 1484 | initializeUi(); |
| @@ -1805,34 +1833,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 348 unmodified lines | |||
| 1805 | 1833 | ||
| 1806 | updateVerboseLogging(); | 1834 | updateVerboseLogging(); |
| 1807 | 1835 | ||
| 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 | |||
| 1836 | // Make sure we don't time out during slow operations at startup | 1836 | // Make sure we don't time out during slow operations at startup |
| 1837 | updateHeartbeat(); | 1837 | updateHeartbeat(); |
| 1838 | QTimer* settingsTimer = new QTimer(); | 1838 | QTimer* settingsTimer = new QTimer(); |
| @@ -3981,6 +3981,15 @@ static void dumpEventQueue(QThread* thread) { · 2142 unmodified lines | |||
| 3981 | } | 3981 | } |
| 3982 | #endif // DEBUG_EVENT_QUEUE | 3982 | #endif // DEBUG_EVENT_QUEUE |
| 3983 | 3983 | ||
| 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 | |||
| 3984 | bool Application::event(QEvent* event) { | 3993 | bool Application::event(QEvent* event) { |
| 3985 | 3994 | ||
| 3986 | if (_aboutToQuit) { | 3995 | if (_aboutToQuit) { |
| @@ -5472,6 +5481,13 @@ void Application::pauseUntilLoginDetermined() { · 1485 unmodified lines | |||
| 5472 | // disconnect domain handler. | 5481 | // disconnect domain handler. |
| 5473 | nodeList->getDomainHandler().disconnect(); | 5482 | nodeList->getDomainHandler().disconnect(); |
| 5474 | 5483 | ||
| 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 | } | ||
| 5475 | } | 5491 | } |
| 5476 | 5492 | ||
| 5477 | void Application::resumeAfterLoginDialogActionTaken() { | 5493 | void Application::resumeAfterLoginDialogActionTaken() { |
| @@ -5480,6 +5496,11 @@ void Application::resumeAfterLoginDialogActionTaken() { · 2 unmodified lines | |||
| 5480 | return; | 5496 | return; |
| 5481 | } | 5497 | } |
| 5482 | 5498 | ||
| 5499 | if (!_resumeAfterLoginDialogActionTaken_SafeToRun) { | ||
| 5500 | _resumeAfterLoginDialogActionTaken_WasPostponed = true; | ||
| 5501 | return; | ||
| 5502 | } | ||
| 5503 | |||
| 5483 | if (!isHMDMode() && getDesktopTabletBecomesToolbarSetting()) { | 5504 | if (!isHMDMode() && getDesktopTabletBecomesToolbarSetting()) { |
| 5484 | auto toolbar = DependencyManager::get<ToolbarScriptingInterface>()->getToolbar("com.highfidelity.interface.toolbar.system"); | 5505 | auto toolbar = DependencyManager::get<ToolbarScriptingInterface>()->getToolbar("com.highfidelity.interface.toolbar.system"); |
| 5485 | toolbar->writeProperty("visible", true); | 5506 | toolbar->writeProperty("visible", true); |
| @@ -9325,6 +9346,3 @@ void Application::toggleAwayMode(){ · 3839 unmodified lines | |||
| 9325 | 9346 | ||
| 9326 | 9347 | ||
| 9327 | #endif | 9348 | #endif |
| 9328 | |||
| 9329 | |||
| 9330 | #include "Application.moc" | ||