Always release surfaces when application is suspended or hidden.
It is needed to recreate surfaces and to redraw when application is resumed because on some devices when the application is suspended Android destroys the surfaces. Change-Id: I8934e94af038b4ecf116d93aea223ad040b0bff1 Task-number: QTBUG-45019 Reviewed-by: BogDan Vatra <bogdan@kde.org> Reviewed-by: Sergey Galin <s.galin@2gis.ru>
This commit is contained in:
parent
d3277bdf02
commit
1bd07b0293
@ -106,7 +106,6 @@ void QAndroidPlatformForeignWindow::setVisible(bool visible)
|
||||
void QAndroidPlatformForeignWindow::applicationStateChanged(Qt::ApplicationState state)
|
||||
{
|
||||
if (state <= Qt::ApplicationHidden
|
||||
&& QtAndroid::blockEventLoopsWhenSuspended()
|
||||
&& m_surfaceId != -1) {
|
||||
QtAndroid::destroySurface(m_surfaceId);
|
||||
m_surfaceId = -1;
|
||||
|
@ -156,7 +156,7 @@ bool QAndroidPlatformOpenGLWindow::checkNativeSurface(EGLConfig config)
|
||||
void QAndroidPlatformOpenGLWindow::applicationStateChanged(Qt::ApplicationState state)
|
||||
{
|
||||
QAndroidPlatformWindow::applicationStateChanged(state);
|
||||
if (state <= Qt::ApplicationHidden && QtAndroid::blockEventLoopsWhenSuspended()) {
|
||||
if (state <= Qt::ApplicationHidden) {
|
||||
lockSurface();
|
||||
if (m_nativeSurfaceId != -1) {
|
||||
QtAndroid::destroySurface(m_nativeSurfaceId);
|
||||
|
@ -256,7 +256,7 @@ void QAndroidPlatformScreen::applicationStateChanged(Qt::ApplicationState state)
|
||||
foreach (QAndroidPlatformWindow *w, m_windowStack)
|
||||
w->applicationStateChanged(state);
|
||||
|
||||
if (state <= Qt::ApplicationHidden && QtAndroid::blockEventLoopsWhenSuspended()) {
|
||||
if (state <= Qt::ApplicationHidden) {
|
||||
lockSurface();
|
||||
QtAndroid::destroySurface(m_id);
|
||||
m_id = -1;
|
||||
|
Loading…
Reference in New Issue
Block a user