RFR: 8285217: [Android] Window's screen is not updated after native screen was disposed [v2]

Jose Pereda jpereda at openjdk.java.net
Wed May 4 16:16:27 UTC 2022


On Wed, 4 May 2022 16:03:20 GMT, Jose Pereda <jpereda at openjdk.org> wrote:

>> This PR updates the screen for each window even for the case where the old screen has been disposed but there is a new screen instance found for such window.
>> 
>> This is the case of Android, where the lifecycle of the application allows destroying the native screen when the app goes to the background, and providing a new native screen, in case it comes back to the foreground. Before this PR, the screen for the window wasn't updated after returning from the background, and if orientation changes happened, the dimensions were wrong.
>
> Jose Pereda has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Rollback change, move to new screen created via native if handler changes

You are right, the proposed change was intended only for Android but was touching shared code for all platforms.

Based on the comment "Note that if a window has moved to another screen...", and considering that this could apply to the Android case (the initial screen gets destroyed and a new screen is created when app resumes), I have now another solution that does the same but that is mostly on the Android side (`MonocleWindowManager::repaintFromNative` was only called from Android native anyway), with a small change in `MonocleWindow` though, as  `Window::notifyMoveToAnotherScreen` has protected access.

-------------

PR: https://git.openjdk.java.net/jfx/pull/778


More information about the openjfx-dev mailing list