mirror of
https://github.com/yawut/SDL.git
synced 2026-09-13 03:26:04 -05:00
Fixes #2022, do not resume on Android when surfaceChanged
If the app is in landscape mode and the user presses the power button, a pause is followed immediately by a surfaceChanged event because the lock screen is shown in portrait mode. This triggers a "false" resume. So, we just pause and resume following the onWindowFocusChanged events. Also, wait for SDL_APP_WILLENTERBACKGROUND and SDL_APP_DIDENTERBACKGROUND before blocking the event pump.
This commit is contained in:
@@ -695,11 +695,6 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
|
||||
SDLActivity.mSDLThread = new Thread(new SDLMain(), "SDLThread");
|
||||
enableSensor(Sensor.TYPE_ACCELEROMETER, true);
|
||||
SDLActivity.mSDLThread.start();
|
||||
} else {
|
||||
// The app already exists, we resume via handleResume
|
||||
// Multiple sequential calls to surfaceChanged are handled internally by handleResume
|
||||
|
||||
SDLActivity.handleResume();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user