-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Android: Fix white bar by enabling immersive fullscreen (API 30+) #13628
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Android: Fix white bar by enabling immersive fullscreen (API 30+) #13628
Conversation
…ller (API 30+) Problem ------- After upgrading to Qt 6.10 / NDK 27, Android started reserving system UI space again (navigation/status bars), leaving a visible white strip outside the Qt window. Previous builds implicitly/explicitly hid bars, but no immersive flags were applied in the current tree. Cause ----- Qt now defaults to edge-to-edge without hiding system bars. Since we weren’t requesting immersive mode, Android kept the nav/status areas visible, appearing as white gaps on tablets. Fix --- Use the modern WindowInsetsController API (API 30+) to enter immersive mode and allow swipe-to-reveal of system bars: - Added goImmersive(): * getWindow().setDecorFitsSystemWindows(false) * insetsController.hide(Type.statusBars | Type.navigationBars) * setSystemBarsBehavior(BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE) - Call goImmersive() from onCreate() and onWindowFocusChanged(true) Notes ----- - This change only applies on API 30+ (guarded by Build.VERSION.SDK_INT). Older devices keep current behavior (no legacy flags added in this commit). - No theme or color changes included; this strictly restores full screen usage by hiding system bars on Android 11+. Result ------ QGC launches fully immersive on API 30+ devices (no white bars at top or bottom). Users can swipe from the edge to transiently reveal system bars, per Android guidelines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes the white bar issue that appeared on Android tablets after upgrading to Qt 6.10 and NDK 27 by implementing true immersive fullscreen mode using Android's WindowInsetsController API (Android 11+).
Key Changes:
- Added
goImmersive()method that hides status and navigation bars using the modern WindowInsetsController API - Integrated immersive mode into the activity lifecycle by calling it in
onCreate()andonWindowFocusChanged()
|
Looking at Qt source I think there's a built in Qt way to do this because it has the same code you added in QtDisplayManager.java |
|
@HTRamsey yep it seems just using built in way working too. |
|
Could you check if this does anything? |
|
@HTRamsey Yep using flags also solve it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.
|
Sorry can you try one more thing: just do this |
|
@HTRamsey yep this one also works |
Android: Fix white bar by enabling immersive fullscreen (API 30+)
After upgrading to Qt 6.10 / NDK 27, Android stopped applying immersive
flags, causing visible white bars (system nav/status areas) below the Qt window on tablets.
This patch restores true fullscreen behavior on Android 11+ using the
WindowInsetsController API.
Changes:
Result: QGroundControl launches in proper immersive fullscreen mode on

Android.
Test: Samsung s7 fe and samsung a63
Further: on Samsung a63 test there is a white gap in the camera area I dont know its on purpose or not but this commit fix the issue on the tablet
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.