Bug 539376 - Splash screen flickers for 1-2 seconds while loading
1) Prevent rendering the splash screen as an empty grey shell before
loading image/progress bar.
2) The parent splash screen shell is always visible before image wrapper
was loaded, causing blank shell to be rendered (bug 427393). Hide the
shell until the splash wrapper is created.
Change-Id: I6cd3e608f9e5a5c95bc812341b88f4bd44d1f74f
Signed-off-by: Xi Yan <xixiyan@redhat.com>
diff --git a/bundles/org.eclipse.ui.ide.application/src/org/eclipse/ui/internal/ide/application/IDEApplication.java b/bundles/org.eclipse.ui.ide.application/src/org/eclipse/ui/internal/ide/application/IDEApplication.java
index 218d176..9bf93b8 100644
--- a/bundles/org.eclipse.ui.ide.application/src/org/eclipse/ui/internal/ide/application/IDEApplication.java
+++ b/bundles/org.eclipse.ui.ide.application/src/org/eclipse/ui/internal/ide/application/IDEApplication.java
@@ -295,13 +295,6 @@
if (instanceLoc.set(workspaceUrl, true)) {
launchData.writePersistedData();
writeWorkspaceVersion();
-
- // bug 455162, bug 427393: unhide the splash after the
- // workspace was selected to show the progress bar
- if (parentShellVisible && isValidShell(shell)) {
- shell.setVisible(true);
- shell.forceActive();
- }
return null;
}
} catch (IllegalStateException e) {
@@ -321,7 +314,7 @@
// by this point it has been determined that the workspace is
// already in use -- force the user to choose again
- MessageDialog dialog = new MessageDialog(shell, IDEWorkbenchMessages.IDEApplication_workspaceInUseTitle,
+ MessageDialog dialog = new MessageDialog(null, IDEWorkbenchMessages.IDEApplication_workspaceInUseTitle,
null, NLS.bind(IDEWorkbenchMessages.IDEApplication_workspaceInUseMessage, workspaceUrl.getFile()),
MessageDialog.ERROR, 1, IDEWorkbenchMessages.IDEApplication_workspaceInUse_Retry,
IDEWorkbenchMessages.IDEApplication_workspaceInUse_Choose);
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Workbench.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Workbench.java
index 31f32eb..6ddef27 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Workbench.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Workbench.java
@@ -561,7 +561,6 @@
public static int createAndRunWorkbench(final Display display, final WorkbenchAdvisor advisor) {
final int[] returnCode = new int[1];
Realm.runWithDefault(DisplayRealm.getRealm(display), () -> {
- spinEventQueueToUpdateSplash(display);
boolean showProgress = PrefUtil.getAPIPreferenceStore()
.getBoolean(IWorkbenchPreferenceConstants.SHOW_PROGRESS_ON_STARTUP);
@@ -599,9 +598,18 @@
// prime the splash nice and early
workbench.createSplashWrapper();
- spinEventQueueToUpdateSplash(display);
+ // Bug 539376, 427393, 455162: show the splash screen after
+ // the image is loaded. See IDEApplication#checkInstanceLocation
+ // where the splash shell got hidden to avoid empty shell
AbstractSplashHandler handler = getSplash();
-
+ if (handler != null) {
+ Shell splashShell = handler.getSplash();
+ if (splashShell != null && !splashShell.isDisposed()) {
+ splashShell.setVisible(true);
+ splashShell.forceActive();
+ }
+ }
+ spinEventQueueToUpdateSplash(display);
SynchronousBundleListener bundleListener = null;
if (handler != null && showProgress) {