fix: swap buffers error (#2347)

This commit is contained in:
NickVs2015
2026-03-16 08:03:20 +03:00
committed by GitHub
parent 477afb9d85
commit 67bd880cdf
3 changed files with 18 additions and 4 deletions
+7 -3
View File
@@ -21,10 +21,14 @@ Window {
function onStateChanged() {
if (Qt.platform.os === "android") {
if (Qt.application.state === Qt.ApplicationActive) {
root.visible = true
refreshTimer.restart()
} else if (Qt.application.state === Qt.ApplicationSuspended ||
Qt.application.state === Qt.ApplicationInactive) {
console.log("QML: Application going to background, state:", Qt.application.state)
} else if (Qt.application.state === Qt.ApplicationSuspended) {
// Hide window to stop the Qt render loop and prevent
// eglSwapBuffers from being called on a lost EGL context.
// NOTE: Do NOT hide on ApplicationInactive — that fires on any
// focus change (IME, notifications) and would blank the screen.
root.visible = false
}
}
}