Skip to content

Commit

Permalink
Future-proof workaround for flipped splash screen in macOS Sonoma
Browse files Browse the repository at this point in the history
The workaround should keep working even when macOS major version moves
beyond 14.

Follow-up on #1355.
  • Loading branch information
sratz authored and elsazac committed Mar 20, 2024
1 parent 00c1e5f commit 7088586
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -854,7 +854,7 @@ private static Image loadSplashScreenImage(Display display, String splashLoc) {
if (splashLoc != null) {
try (InputStream input = new BufferedInputStream(new FileInputStream(splashLoc))) {
background = getImage(display, input);
} catch (SWTException | IOException e) {
} catch (SWTException | IOException | NumberFormatException e) {
StatusManager.getManager().handle(StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, e));
}
}
Expand All @@ -870,7 +870,7 @@ private static Image getImage(Display display, InputStream input) {
* (https://github.com/eclipse-platform/eclipse.platform.swt/issues/772) ,Splash
* Screen gets flipped.As a workaround the image is flipped and returned.
*/
if (System.getProperty("os.version").startsWith("14")) { //$NON-NLS-1$ //$NON-NLS-2$
if (Integer.parseInt(System.getProperty("os.version").split(".")[0]) >= 14) { //$NON-NLS-1$ //$NON-NLS-2$
GC gc = new GC(image);
Transform tr = new Transform(display);
tr.setElements(1, 0, 0, -1, 0, 0);
Expand Down

0 comments on commit 7088586

Please sign in to comment.