Skip to content

Commit 3587081

Browse files
committed
Activate monitor-specific scaling before Display instantiation
Monitor-specific scaling needs to be activated before the display that is supposed to run in that mode is created. Currently, the scaling is activated in the Workbench based on an according preference after the Display has already been created. This change moves the evaluation of the experimental preference and the according initialization of monitor-specific scaling to before the Display is created inside the Workbench. In addition, the disclaimer is cleaned up from the statement about Edge, which is now already been enabled by default.
1 parent 871538d commit 3587081

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,6 @@ public static int createAndRunWorkbench(final Display display, final WorkbenchAd
588588
int orientation = store.getInt(IPreferenceConstants.LAYOUT_DIRECTION);
589589
Window.setDefaultOrientation(orientation);
590590
}
591-
setRescaleAtRuntimePropertyFromPreference();
592591
if (obj instanceof E4Application) {
593592
E4Application e4app = (E4Application) obj;
594593
E4Workbench e4Workbench = e4app.createE4Workbench(getApplicationContext(), display);
@@ -684,9 +683,9 @@ public void update() {
684683

685684
private static void setRescaleAtRuntimePropertyFromPreference() {
686685
if (System.getProperty(SWT_RESCALE_AT_RUNTIME_PROPERTY) != null) {
687-
WorkbenchPlugin.log(StatusUtil.newStatus(IStatus.WARNING, SWT_RESCALE_AT_RUNTIME_PROPERTY
688-
+ " is configured (e.g., via the INI), but the according preference should be preferred instead.", //$NON-NLS-1$
689-
new RuntimeException()));
686+
WorkbenchPlugin.log(Status.warning(SWT_RESCALE_AT_RUNTIME_PROPERTY
687+
+ " is configured (e.g., via the INI), but the according preference should be preferred instead." //$NON-NLS-1$
688+
));
690689
} else {
691690
boolean rescaleAtRuntime = PrefUtil.getAPIPreferenceStore()
692691
.getBoolean(IWorkbenchPreferenceConstants.RESCALING_AT_RUNTIME);
@@ -758,6 +757,8 @@ public static Display createDisplay() {
758757
Display.setAppName(applicationName);
759758
}
760759

760+
setRescaleAtRuntimePropertyFromPreference();
761+
761762
// create the display
762763
Display newDisplay = Display.getCurrent();
763764
if (newDisplay == null) {

bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/messages.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ RescaleAtRuntimeSettingChangeWarningTitle = DPI Setting Changed
504504
RescaleAtRuntimeSettingChangeWarningText = Restart for the DPI setting changes to take effect
505505
HiDpiSettingsGroupTitle = HiDPI settings
506506
RescaleAtRuntimeEnabled = Monitor-specific UI &scaling
507-
RescaleAtRuntimeDisclaimer = EXPERIMENTAL! Activating this option will dynamically scale all windows according to the monitor they are currently in. It will also set the default browser to Edge in order to provide the appropriate scaling of content displayed in a browser. This feature is still in development and therefore considered experimental.
507+
RescaleAtRuntimeDisclaimer = EXPERIMENTAL! Activating this option will dynamically scale all windows according to the monitor they are currently in. It is still in development and therefore considered experimental.
508508
# --- Workbench -----
509509
WorkbenchPreference_openMode=Open mode
510510
WorkbenchPreference_doubleClick=D&ouble click

0 commit comments

Comments
 (0)