Fix splash screen transparency on Linux - #4847
Merged
cwisniew merged 2 commits intoJun 28, 2024
Merged
Conversation
JavaFX initialization is no longer the implicit responsibility of `SplashScreen` but is instead done explicitly in `MapTool.main()`. The `CreateVersionedInstallSplash` JavaFX application is no more, with tis vital functionality now merged into `SplashScreen`.
The problem is that while `JFrame` supports per-pixel transparency, and `JFXPanel` also supports transparency, `JFXPanel` refuses to be transparent if used in a transparent `JFrame`. But we don't need a `JFXPanel` here since we're just displaying an image, so it has been replaced with a `JPanel` that does exactly that and no more. It was also necessary to be a bit more particular in how `SplashScreen` is initialized. We must get the screen dimensions _after_ `setUndecorated()` and `setType()`, and must call `setLocationRelativeTo(null)` after setting the windw bounds. The reasons are not entirely clear, but may be related to weaknesses in window transparency for multi-monitor setups on X. `SplashScreen` is also not responsible for setting its own visibility. The caller decides when to do that now. We can also greatly limit the portion of `SplashScreen` that needs to run on the JavaFX thread now that we only use JavaFX for generating the image.
cwisniew
approved these changes
Jun 28, 2024
kwvanderlinde
deleted the
bugfix/4819-splash-screen-transparency-on-linux
branch
June 28, 2024 16:52
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Identify the Bug or Feature request
Fixes #4819
Description of the Change
The
SplashScreenhas been refactored to be entirely Swing-based instead of relying onJFXPanel, since combining a transparentJFXPanelwith a transparentJFramedoes not work properly on X. JavaFX is still used to generate the splash image, but the image is displayed in a regularJPanel.Possible Drawbacks
I could only verify the changes on a few configurations: Windows 11 (still works), Linux Mint 21.3 with Cinnamon (fixed), and OpenSuse Tumbleweed with KDE Plasma 6.0 (fixed). Would be good to at least get a Mac test as well.
Documentation Notes
N/A
Release Notes
This change is