Skip to content

Commit 727dfdb

Browse files
Defer the error dialog until workbench is initalized
1 parent 1165ccd commit 727dfdb

File tree

1 file changed

+11
-5
lines changed
  • bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal

1 file changed

+11
-5
lines changed

bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/Workbench.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ public void update() {
694694
return returnCode[0];
695695
}
696696

697-
private static void setRescaleAtRuntimePropertyFromPreference() {
697+
private static boolean setRescaleAtRuntimePropertyFromPreference() {
698698
if (System.getProperty(SWT_RESCALE_AT_RUNTIME_PROPERTY) != null) {
699699
WorkbenchPlugin.log(Status.warning(SWT_RESCALE_AT_RUNTIME_PROPERTY
700700
+ " is configured (e.g., via the INI), but the according preference should be preferred instead." //$NON-NLS-1$
@@ -707,10 +707,9 @@ private static void setRescaleAtRuntimePropertyFromPreference() {
707707

708708
if (DPIUtil.isMonitorSpecificScalingActive() && !DPIUtil.isSetupCompatibleToMonitorSpecificScaling()) {
709709
System.setProperty(SWT_RESCALE_AT_RUNTIME_PROPERTY, Boolean.toString(false));
710-
MessageDialog.openError(new Shell(Display.getDefault()),
711-
WorkbenchMessages.RescaleAtRuntimeIncompatibilityTitle,
712-
NLS.bind(WorkbenchMessages.RescaleAtRuntimeIncompatibilityDescription));
710+
return true;
713711
}
712+
return false;
714713
}
715714

716715
private static void setSearchContribution(MApplication app, boolean enabled) {
@@ -778,7 +777,7 @@ public static Display createDisplay() {
778777
Display.setAppName(applicationName);
779778
}
780779

781-
setRescaleAtRuntimePropertyFromPreference();
780+
boolean isIncompatibleAutoScaleValue = setRescaleAtRuntimePropertyFromPreference();
782781

783782
// create the display
784783
Display newDisplay = Display.getCurrent();
@@ -797,6 +796,13 @@ public static Display createDisplay() {
797796
}
798797
}
799798

799+
if (isIncompatibleAutoScaleValue) {
800+
newDisplay.asyncExec(() -> {
801+
MessageDialog.openError(null,
802+
WorkbenchMessages.RescaleAtRuntimeIncompatibilityTitle,
803+
NLS.bind(WorkbenchMessages.RescaleAtRuntimeIncompatibilityDescription));
804+
});
805+
}
800806
// workaround for 1GEZ9UR and 1GF07HN
801807
newDisplay.setWarnings(false);
802808

0 commit comments

Comments
 (0)