History

Merge branch 'master' into notify-sound-inject

Vladyslav Stelmakhovskyi committed 9 years ago

Commit 06406ef2 parents 023d03d 50456f715 files · +816 −562Browse files

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

Unified · Split

interface/src/Application.cpp+10−1
@@ -1437,6 +1437,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 1436 unmodified lines
14371437 entityPacketSender->setMyAvatar(myAvatar.get());
14381438
14391439 connect(this, &Application::applicationStateChanged, this, &Application::activeChanged);
1440+ connect(_window, SIGNAL(windowMinimizedChanged(bool)), this, SLOT(windowMinimizedChanged(bool)));
14401441 qCDebug(interfaceapp, "Startup time: %4.2f seconds.", (double)startupTimer.elapsed() / 1000.0);
14411442
14421443 auto textureCache = DependencyManager::get<TextureCache>();
@@ -2090,7 +2091,7 @@ void Application::initializeUi() { · 647 unmodified lines
20902091
20912092 void Application::paintGL() {
20922093 // Some plugins process message events, allowing paintGL to be called reentrantly.
2093− if (_inPaint || _aboutToQuit) {
2094+ if (_inPaint || _aboutToQuit || _window->isMinimized()) {
20942095 return;
20952096 }
20962097
@@ -6502,6 +6503,14 @@ void Application::activeChanged(Qt::ApplicationState state) { · 4405 unmodified lines
65026503 }
65036504 }
65046505
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+
65056514 void Application::postLambdaEvent(std::function<void()> f) {
65066515 if (this->thread() == QThread::currentThread()) {
65076516 f();