summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.cpp
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@digia.com>2013-08-27 17:49:40 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-28 17:00:15 +0200
commite94c22165559b7d81ee255d328d39b5252d16132 (patch)
treeb327a1bebf92a98c3516d802b44277c08280516b /src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.cpp
parentfd871694e74debc1bde5a7a19c6a5b94f3069bb2 (diff)
Android: added ApplicationState capability.
The application state is tied to the QtActivity lifecycle. Mapping of states between Android and Qt is as follows: onResume --> ApplicationActive onPause --> ApplicationInactive onStop --> ApplicationSuspended Change-Id: Iefef08d6c7a7fde28fba1f4886882458cda6a0c0 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Diffstat (limited to 'src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.cpp')
-rw-r--r--src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.cpp b/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.cpp
index 5362906e0e..d20bab7c5b 100644
--- a/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.cpp
+++ b/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.cpp
@@ -121,6 +121,12 @@ void QAndroidOpenGLPlatformWindow::raise()
void QAndroidOpenGLPlatformWindow::setVisible(bool visible)
{
QEglFSWindow::setVisible(visible);
+
+ // The Android Activity is activated before Qt is initialized, causing the application state to
+ // never be set to 'active'. We explicitly set this state when the first window becomes visible.
+ if (visible)
+ QtAndroid::setApplicationActive();
+
QWindowSystemInterface::handleExposeEvent(window(), QRegion(geometry())); // Expose event
QWindowSystemInterface::flushWindowSystemEvents();
}