Showing the changes to interface/src/Application.cpp (1 of 4 files). Show all
Unified · Split
| @@ -1429,6 +1429,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 1428 unmodified lines | ||
| 1429 | 1429 | entityPacketSender->setMyAvatar(myAvatar.get()); |
| 1430 | 1430 | |
| 1431 | 1431 | connect(this, &Application::applicationStateChanged, this, &Application::activeChanged); |
| 1432 | + connect(_window, SIGNAL(windowMinimizedChanged(bool)), this, SLOT(windowMinimizedChanged(bool))); | |
| 1432 | 1433 | qCDebug(interfaceapp, "Startup time: %4.2f seconds.", (double)startupTimer.elapsed() / 1000.0); |
| 1433 | 1434 | |
| 1434 | 1435 | auto textureCache = DependencyManager::get<TextureCache>(); |
| @@ -6476,6 +6477,15 @@ void Application::activeChanged(Qt::ApplicationState state) { · 5041 unmodified lines | ||
| 6476 | 6477 | } |
| 6477 | 6478 | } |
| 6478 | 6479 | |
| 6480 | +void Application::windowMinimizedChanged(bool minimized) { | |
| 6481 | + if (!minimized && !getActiveDisplayPlugin()->isActive()) { | |
| 6482 | + getActiveDisplayPlugin()->activate(); | |
| 6483 | + } else if (minimized && getActiveDisplayPlugin()->isActive()) { | |
| 6484 | + getActiveDisplayPlugin()->deactivate(); | |
| 6485 | + } | |
| 6486 | +} | |
| 6487 | + | |
| 6488 | + | |
| 6479 | 6489 | void Application::postLambdaEvent(std::function<void()> f) { |
| 6480 | 6490 | if (this->thread() == QThread::currentThread()) { |
| 6481 | 6491 | f(); |