|
135 | 135 | import org.eclipse.jface.util.IPropertyChangeListener;
|
136 | 136 | import org.eclipse.jface.util.OpenStrategy;
|
137 | 137 | import org.eclipse.jface.util.SafeRunnable;
|
| 138 | +import org.eclipse.jface.util.Util; |
138 | 139 | import org.eclipse.jface.viewers.ISelection;
|
139 | 140 | import org.eclipse.jface.window.IShellProvider;
|
140 | 141 | import org.eclipse.jface.window.Window;
|
|
145 | 146 | import org.eclipse.swt.custom.BusyIndicator;
|
146 | 147 | import org.eclipse.swt.graphics.DeviceData;
|
147 | 148 | import org.eclipse.swt.graphics.FontData;
|
| 149 | +import org.eclipse.swt.graphics.GC; |
148 | 150 | import org.eclipse.swt.graphics.Image;
|
149 | 151 | import org.eclipse.swt.graphics.Point;
|
150 | 152 | import org.eclipse.swt.graphics.Rectangle;
|
| 153 | +import org.eclipse.swt.graphics.Transform; |
151 | 154 | import org.eclipse.swt.widgets.Display;
|
152 | 155 | import org.eclipse.swt.widgets.Listener;
|
153 | 156 | import org.eclipse.swt.widgets.Monitor;
|
@@ -850,14 +853,36 @@ private static Image loadSplashScreenImage(Display display, String splashLoc) {
|
850 | 853 | Image background = null;
|
851 | 854 | if (splashLoc != null) {
|
852 | 855 | try (InputStream input = new BufferedInputStream(new FileInputStream(splashLoc))) {
|
853 |
| - background = new Image(display, input); |
| 856 | + background = getImage(display, input); |
854 | 857 | } catch (SWTException | IOException e) {
|
855 | 858 | StatusManager.getManager().handle(StatusUtil.newStatus(WorkbenchPlugin.PI_WORKBENCH, e));
|
856 | 859 | }
|
857 | 860 | }
|
858 | 861 | return background;
|
859 | 862 | }
|
860 | 863 |
|
| 864 | + private static Image getImage(Display display, InputStream input) { |
| 865 | + Image image = new Image(display, input); |
| 866 | + |
| 867 | + if (Util.isMac()) { |
| 868 | + /* |
| 869 | + * Due to a bug in MacOS Sonoma |
| 870 | + * (https://github.com/eclipse-platform/eclipse.platform.swt/issues/772) ,Splash |
| 871 | + * Screen gets flipped.As a workaround the image is flipped and returned. |
| 872 | + */ |
| 873 | + if (System.getProperty("os.version").startsWith("14")) { //$NON-NLS-1$ //$NON-NLS-2$ |
| 874 | + GC gc = new GC(image); |
| 875 | + Transform tr = new Transform(display); |
| 876 | + tr.setElements(1, 0, 0, -1, 0, 0); |
| 877 | + gc.setTransform(tr); |
| 878 | + gc.drawImage(image, 0, -(image.getBounds().height)); |
| 879 | + tr.dispose(); |
| 880 | + gc.dispose(); |
| 881 | + } |
| 882 | + } |
| 883 | + return image; |
| 884 | + } |
| 885 | + |
861 | 886 | /**
|
862 | 887 | * Return the splash handler for this application. If none is specifically
|
863 | 888 | * provided the default Eclipse implementation is returned.
|
|
0 commit comments