Showing the changes to interface/src/Application.cpp (1 of 15 files). Show all
Unified · Split
| @@ -1437,6 +1437,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 1436 unmodified lines | |||
| 1437 | entityPacketSender->setMyAvatar(myAvatar.get()); | 1437 | entityPacketSender->setMyAvatar(myAvatar.get()); |
| 1438 | 1438 | ||
| 1439 | connect(this, &Application::applicationStateChanged, this, &Application::activeChanged); | 1439 | connect(this, &Application::applicationStateChanged, this, &Application::activeChanged); |
| 1440 | connect(_window, SIGNAL(windowMinimizedChanged(bool)), this, SLOT(windowMinimizedChanged(bool))); | ||
| 1440 | qCDebug(interfaceapp, "Startup time: %4.2f seconds.", (double)startupTimer.elapsed() / 1000.0); | 1441 | qCDebug(interfaceapp, "Startup time: %4.2f seconds.", (double)startupTimer.elapsed() / 1000.0); |
| 1441 | 1442 | ||
| 1442 | auto textureCache = DependencyManager::get<TextureCache>(); | 1443 | auto textureCache = DependencyManager::get<TextureCache>(); |
| @@ -2090,7 +2091,7 @@ void Application::initializeUi() { · 647 unmodified lines | |||
| 2090 | 2091 | ||
| 2091 | void Application::paintGL() { | 2092 | void Application::paintGL() { |
| 2092 | // Some plugins process message events, allowing paintGL to be called reentrantly. | 2093 | // Some plugins process message events, allowing paintGL to be called reentrantly. |
| 2093 | if (_inPaint || _aboutToQuit) { | 2094 | if (_inPaint || _aboutToQuit || _window->isMinimized()) { |
| 2094 | return; | 2095 | return; |
| 2095 | } | 2096 | } |
| 2096 | 2097 | ||
| @@ -6502,6 +6503,14 @@ void Application::activeChanged(Qt::ApplicationState state) { · 4405 unmodified lines | |||
| 6502 | } | 6503 | } |
| 6503 | } | 6504 | } |
| 6504 | 6505 | ||
| 6506 | void Application::windowMinimizedChanged(bool minimized) { | ||
| 6507 | if (!minimized && !getActiveDisplayPlugin()->isActive()) { | ||
| 6508 | getActiveDisplayPlugin()->activate(); | ||
| 6509 | } else if (minimized && getActiveDisplayPlugin()->isActive()) { | ||
| 6510 | getActiveDisplayPlugin()->deactivate(); | ||
| 6511 | } | ||
| 6512 | } | ||
| 6513 | |||
| 6505 | void Application::postLambdaEvent(std::function<void()> f) { | 6514 | void Application::postLambdaEvent(std::function<void()> f) { |
| 6506 | if (this->thread() == QThread::currentThread()) { | 6515 | if (this->thread() == QThread::currentThread()) { |
| 6507 | f(); | 6516 | f(); |