Browse Source

WIP: fix for the rotate -> unpause bug

pull/2938/head
Allison Cunha 4 months ago
committed by crueter
parent
commit
81e2df61bd
  1. 12
      src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt

12
src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt

@ -1511,7 +1511,9 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
emulationState.newSurface(holder.surface)
} else {
emulationState.newSurface(holder.surface)
// Surface changed due to rotation/config change
// Only update surface reference, don't trigger state changes
emulationState.updateSurfaceReference(holder.surface)
}
}
@ -1842,6 +1844,14 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
}
}
@Synchronized
fun updateSurfaceReference(surface: Surface?) {
this.surface = surface
if (this.surface != null && state == State.RUNNING) {
NativeLibrary.surfaceChanged(this.surface)
}
}
@Synchronized
fun clearSurface() {
if (surface == null) {

Loading…
Cancel
Save