We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 5325

Summary: Android 10, gesture control, minimize app - not expected behavior
Product: SDL Reporter: Vortelio <vortelio>
Component: *don't know*Assignee: Ryan C. Gordon <icculus>
Status: RESOLVED INVALID QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: sylvain.becker
Version: HG 2.1   
Hardware: All   
OS: Android (All)   

Description Vortelio 2020-10-22 06:48:47 UTC
There is no way to reliably catch the loss of window focus.

With the classic navigation of three buttons, if minimize the app, the following order is performed:

onPause ()
onWindowFocusChanged ()
nativeFocusChanged (false)
handleNativeState ()
nativePause ()

If gesture control is activated, the order is as follows:

onPause ()
handleNativeState ()
nativePause ()
onWindowFocusChanged ()
nativeFocusChanged (false)
Comment 1 Sylvain 2020-10-22 09:30:06 UTC
You get loss of focus with the SDL_WINDOWEVENT_FOCUS_LOST, you don't need to use the java side.

But java onWindowFocusChanged() should give you the focus.