Sat, 05 Jan 2019 22:46:52 +0100Android: un-needed check of "isPausing" and minor typos
Sylvain Becker [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 [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 [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 [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 [Fri, 17 Aug 2018 22:37:16 +0100] rev 12502
riscos: Fix returning from full-screen to 16M colour modes

Fri, 04 Jan 2019 23:39:27 +0100Android: fixed immediate transition to pause and resume.
Sylvain Becker [Fri, 04 Jan 2019 23:39:27 +0100] rev 12501
Android: fixed immediate transition to pause and resume.

"Pause" transition will add events:
SDL_WINDOWEVENT_ENTER
SDL_WINDOWEVENT_FOCUS_LOST
SDL_WINDOWEVENT_MINIMIZED
SDL_APP_WILL ENTER BACKGROUND
SDL_APP_DID ENTER BACKGROUND

"Resume" transition will add events:
SDL_APP_WILL ENTER FOREGROUND
SDL_APP_DID ENTER FOREGROUND
SDL_WINDOWEVENT_FOCUS_GAINED
SDL_WINDOWEVENT_RESTORED

If Android application doesn't empty the event loop in between, it enters in
"paused" state when SDL_WINDOWEVENT_RESTORED is fetched.

See bug 3250 for pratical case.

Fri, 04 Jan 2019 23:11:21 +0100Android: make Android_PumpEvents() more readable
Sylvain Becker [Fri, 04 Jan 2019 23:11:21 +0100] rev 12500
Android: make Android_PumpEvents() more readable
No behavior change in this commit.

Thu, 03 Jan 2019 23:22:50 +0100Android: concurrency issue with egl_surface EGL_BAD_SURFACE - (bug 4142)
Sylvain Becker [Thu, 03 Jan 2019 23:22:50 +0100] rev 12499
Android: concurrency issue with egl_surface EGL_BAD_SURFACE - (bug 4142)

Occurs when application goes to background:
- Java activity is destroying SurfaceView holder and "egl_surface" (in onNativeSurfaceDestroyed())
- While native thread is in Android_GLES_SwapWindow(), prepared to call SDL_EGL_SwapBuffers()

The error is "call to eglSwapBuffers failed, reporting an error of EGL_BAD_SURFACE"

It an be reproduced easily by adding a SDL_Delay(100) at the begining of SDL_EGL_SwapBuffers(),
and putting the application into background.

Thu, 03 Jan 2019 20:18:29 +0100Android: use Mutex instead of Semphore for bug 4142
Sylvain Becker [Thu, 03 Jan 2019 20:18:29 +0100] rev 12498
Android: use Mutex instead of Semphore for bug 4142

Thu, 03 Jan 2019 16:22:33 +0100Android: prevent the error message from SDL_EGL_CreateSurface() to be masked.
Sylvain Becker [Thu, 03 Jan 2019 16:22:33 +0100] rev 12497
Android: prevent the error message from SDL_EGL_CreateSurface() to be masked.