diff options
author | BogDan Vatra <bogdan@kdab.com> | 2016-02-15 15:07:53 +0200 |
---|---|---|
committer | BogDan Vatra <bogdan@kdab.com> | 2016-02-19 11:42:05 +0000 |
commit | aa85ebc266ea7415a883094ea735f549552ff5ac (patch) | |
tree | 54242b80731b80baa84558adc8ed10f6b514e60d /src | |
parent | 7906255ef2412168dc94768ec7f73ee41b159804 (diff) |
Android: Fix immersive mode
The activity exits immersive mode when displaying a dialog. To fix the
problem we must use onWindowFocusChanged to update updateFullScreen
every time when we've gotten the focus.
Task-number: QTBUG-38759
Change-Id: I9f11a82dba484dbec6daba7cbf116f16fe2ba372
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java index ac77de0bab..4cce86e8bb 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java @@ -92,6 +92,7 @@ public class QtActivityDelegate private Method m_super_onConfigurationChanged = null; private Method m_super_onActivityResult = null; private Method m_super_dispatchGenericMotionEvent = null; + private Method m_super_onWindowFocusChanged = null; private static final String NATIVE_LIBRARIES_KEY = "native.libraries"; private static final String BUNDLED_LIBRARIES_KEY = "bundled.libraries"; @@ -520,6 +521,7 @@ public class QtActivityDelegate m_super_onKeyUp = m_activity.getClass().getMethod("super_onKeyUp", Integer.TYPE, KeyEvent.class); m_super_onConfigurationChanged = m_activity.getClass().getMethod("super_onConfigurationChanged", Configuration.class); m_super_onActivityResult = m_activity.getClass().getMethod("super_onActivityResult", Integer.TYPE, Integer.TYPE, Intent.class); + m_super_onWindowFocusChanged = m_activity.getClass().getMethod("super_onWindowFocusChanged", Boolean.TYPE); if (Build.VERSION.SDK_INT >= 12) { try { m_super_dispatchGenericMotionEvent = m_activity.getClass().getMethod("super_dispatchGenericMotionEvent", MotionEvent.class); @@ -943,6 +945,16 @@ public class QtActivityDelegate } } + public void onWindowFocusChanged(boolean hasFocus) { + try { + m_super_onWindowFocusChanged.invoke(m_activity, hasFocus); + } catch (Exception e) { + e.printStackTrace(); + } + if (hasFocus) + updateFullScreen(); + } + public void onConfigurationChanged(Configuration configuration) { try { |