@@ -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