fix: black screen resume / pause (#2400)

This commit is contained in:
NickVs2015
2026-03-24 17:13:31 +03:00
committed by GitHub
parent 4103c5bbcf
commit 36b1a863bf
7 changed files with 58 additions and 7 deletions

View File

@@ -343,12 +343,22 @@ class AmneziaActivity : QtActivity() {
resumeHandler.removeCallbacksAndMessages(null)
openFileDeliveryScheduled = false
Log.d(TAG, "Pause Amnezia activity")
// Notify Qt to stop rendering before the EGL surface is disconnected
mainScope.launch {
qtInitialized.await()
QtAndroidController.onActivityPaused()
}
}
override fun onResume() {
super.onResume()
isActivityResumed = true
Log.d(TAG, "Resume Amnezia activity")
// Notify Qt to resume rendering after surface reconnects
mainScope.launch {
qtInitialized.await()
QtAndroidController.onActivityResumed()
}
if (pendingOpenFileUri != null && !openFileDeliveryScheduled) {
val uri = pendingOpenFileUri!!

View File

@@ -31,4 +31,7 @@ object QtAndroidController {
external fun onImeInsetsChanged(heightDp: Int)
external fun onSystemBarsInsetsChanged(navBarHeightDp: Int, statusBarHeightDp: Int)
external fun onActivityPaused()
external fun onActivityResumed()
}