Skip to content

Commit

Permalink
tech: fix eclipse crash on macOS and Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
pikachugb committed Jun 6, 2023
1 parent f46d5b3 commit 9c99711
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ public void handleEvent(Event event) {

private void createAnimationThread(int gifSize) {
Display display = parent.getDisplay();
GC shellGC = new GC(this);
Color shellBackground = getBackground();

animateThread = new Thread() {
Expand Down Expand Up @@ -235,9 +234,12 @@ public void run() {
yPos = 0;
}

GC shellGC = new GC(LoadingComposite.this);

shellGC.fillRectangle(0, 0, point.x, point.y);
shellGC.drawImage(offScreenImage, xPos, yPos);

shellGC.dispose();
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,17 @@ private static Image createPlaceholderImage() {
private String getOctanePreloaderGifNameSuffix() {
IThemeEngine theme = (IThemeEngine) Display.getDefault().getData("org.eclipse.e4.ui.css.swt.theme");

if (theme.getActiveTheme().getLabel().equals("Dark")) {
return "_dark-128.gif";
} else {
return "_light-128.gif";
}
//The loading gif makes the Eclipse crash on macOS or Linux
//We'll force it to load a non-existing image, so it will always show "Loading..."
String os = System.getProperty("os.name").toLowerCase();
if (os != null && os.indexOf("win") >= 0) {
if (theme.getActiveTheme().getLabel().equals("Dark")) {
return "_dark-128.gif";
} else {
return "_light-128.gif";
}
} else {
return "";
}
}
}

0 comments on commit 9c99711

Please sign in to comment.