Mon, 07 Jan 2019 17:06:50 +0100Android: don't allow multiple instance of SDLActivity
Sylvain Becker <sylvain.becker@gmail.com> [Mon, 07 Jan 2019 17:06:50 +0100] rev 12511
Android: don't allow multiple instance of SDLActivity

Default launch mode (standard) allows multiple instances of the SDLActivity.
( https://developer.android.com/guide/topics/manifest/activity-element#lmode )

Not sure this is intended in SDL as this doesn't work. There are static
variables in Java, in C code which make this impossible (allow one android_window) and
also Audio print errors.

There is also some code added in onDestroy as if it would be able to
re-initialize: https://hg.libsdl.org/SDL/rev/56e9c709db7e

Bug Android activity life-cycle seems to show there is not transition to get out
of onDestroy()
https://developer.android.com/reference/android/app/Activity#ActivityLifecycle

( can be tested with "adb shell am start my.package.org/.MainActivity"
and "adb shell am start -n my.package.org/.MainActivity" )

Send me a message if there are real use-case for this !

Mon, 07 Jan 2019 11:35:31 +0100Android: some robustness when quitting application from onDestroy()
Sylvain Becker <sylvain.becker@gmail.com> [Mon, 07 Jan 2019 11:35:31 +0100] rev 12510
Android: some robustness when quitting application from onDestroy()

Make sure there is not pending Pause accumulated, so the the application doesn't
remain paused and stucked in onDestroy().

Can be tested by adding:
SDLActivity.nativePause();
SDLActivity.nativePause();
mSingleton.finish();

Sun, 06 Jan 2019 20:25:54 +0100Android: better fix for bug 3186. Run those commands from SDL thread.
Sylvain Becker <sylvain.becker@gmail.com> [Sun, 06 Jan 2019 20:25:54 +0100] rev 12509
Android: better fix for bug 3186. Run those commands from SDL thread.

Sun, 06 Jan 2019 17:35:42 +0100Android: allow multiple calls to nativeResume()
Sylvain Becker <sylvain.becker@gmail.com> [Sun, 06 Jan 2019 17:35:42 +0100] rev 12508
Android: allow multiple calls to nativeResume()

Doesn't seem to happen manually, but symetrical to the pause handling.

Can be tested by adding:

mNextNativeState = SDLActivity.NativeState.PAUSED;
handleNativeState();
mNextNativeState = SDLActivity.NativeState.RESUMED;
handleNativeState();
mNextNativeState = SDLActivity.NativeState.PAUSED;
handleNativeState();
mNextNativeState = SDLActivity.NativeState.RESUMED;
handleNativeState();

Before, it ends in 'paused' state.
Now, it ends in 'resumed' state.

Sat, 05 Jan 2019 22:49:50 +0100Android: remove SURFACE_TYPE_GPU, deprecated in API level 5.
Sylvain Becker <sylvain.becker@gmail.com> [Sat, 05 Jan 2019 22:49:50 +0100] rev 12507
Android: remove SURFACE_TYPE_GPU, deprecated in API level 5.

https://developer.android.com/reference/android/view/SurfaceHolder

This constant was deprecated in API level 5. this is ignored, this value is set automatically when needed.

Sat, 05 Jan 2019 22:46:52 +0100Android: un-needed check of "isPausing" and minor typos
Sylvain Becker <sylvain.becker@gmail.com> [Sat, 05 Jan 2019 22:46:52 +0100] rev 12506
Android: un-needed check of "isPausing" and minor typos

Sat, 05 Jan 2019 22:27:25 +0100Android: fix wrong state after immediate sequence pause() / resume() / pause()
Sylvain Becker <sylvain.becker@gmail.com> [Sat, 05 Jan 2019 22:27:25 +0100] rev 12505
Android: fix wrong state after immediate sequence pause() / resume() / pause()

It may happen to have the sequence pause()/resume()/pause(), before polling
any events.

Before, it ends in 'resumed' state because as the check is greedy.
Now, always increase the Pause semaphore, and stop at each pause.
It ends in 'paused' state.

Related to bug 3250: set up a reconfiguration of SurfaceView holder.
Turn the screen off manually before the app starts
(repro rate is not 100%..)

Fri, 04 Jan 2019 22:09:38 -0800Fixed bug 4255 - SDL_GetGlobalMouseState() returns incorrect Y on secondary display
Sam Lantinga <slouken@libsdl.org> [Fri, 04 Jan 2019 22:09:38 -0800] rev 12504
Fixed bug 4255 - SDL_GetGlobalMouseState() returns incorrect Y on secondary display

Julian Raschke

I use an open Mac laptop with an additional external monitor. The coordinate spaces from SDL_GetGlobalMouseState() and SDL_GetWindowPosition() match on the primary display, but not on the secondary display.

Cocoa window coordinates are vertically flipped in relation to the primary display:

https://github.com/spurious/SDL-mirror/blob/release-2.0.8/src/video/cocoa/SDL_cocoawindow.m#L219-L222

However, Cocoa_GetGlobalMouseState inverts the cursor Y coordinate per-display:

https://github.com/spurious/SDL-mirror/blob/release-2.0.8/src/video/cocoa/SDL_cocoamouse.m#L320-L323

Suggested fix: Replace the for-loop with this simpler calculation:

*x = (int) cocoaLocation.x;
*y = (int) (CGDisplayPixelsHigh(kCGDirectMainDisplay) - cocoaLocation.y);

Fri, 04 Jan 2019 22:01:14 -0800Updated copyright for 2019
Sam Lantinga <slouken@libsdl.org> [Fri, 04 Jan 2019 22:01:14 -0800] rev 12503
Updated copyright for 2019

Fri, 17 Aug 2018 22:37:16 +0100riscos: Fix returning from full-screen to 16M colour modes SDL-1.2
Cameron Cawley <ccawley2011@gmail.com> [Fri, 17 Aug 2018 22:37:16 +0100] rev 12502
riscos: Fix returning from full-screen to 16M colour modes