From 3587081342bd7e3980412a9bca360d5588112e64 Mon Sep 17 00:00:00 2001 From: Heiko Klare Date: Wed, 15 Jan 2025 14:15:21 +0100 Subject: [PATCH] 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. --- .../eclipseui/org/eclipse/ui/internal/Workbench.java | 9 +++++---- .../org/eclipse/ui/internal/messages.properties | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/Workbench.java b/bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/Workbench.java index 82241789428..21961d1d76e 100644 --- a/bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/Workbench.java +++ b/bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/Workbench.java @@ -588,7 +588,6 @@ public static int createAndRunWorkbench(final Display display, final WorkbenchAd int orientation = store.getInt(IPreferenceConstants.LAYOUT_DIRECTION); Window.setDefaultOrientation(orientation); } - setRescaleAtRuntimePropertyFromPreference(); if (obj instanceof E4Application) { E4Application e4app = (E4Application) obj; E4Workbench e4Workbench = e4app.createE4Workbench(getApplicationContext(), display); @@ -684,9 +683,9 @@ public void update() { private static void setRescaleAtRuntimePropertyFromPreference() { if (System.getProperty(SWT_RESCALE_AT_RUNTIME_PROPERTY) != null) { - WorkbenchPlugin.log(StatusUtil.newStatus(IStatus.WARNING, SWT_RESCALE_AT_RUNTIME_PROPERTY - + " is configured (e.g., via the INI), but the according preference should be preferred instead.", //$NON-NLS-1$ - new RuntimeException())); + WorkbenchPlugin.log(Status.warning(SWT_RESCALE_AT_RUNTIME_PROPERTY + + " is configured (e.g., via the INI), but the according preference should be preferred instead." //$NON-NLS-1$ + )); } else { boolean rescaleAtRuntime = PrefUtil.getAPIPreferenceStore() .getBoolean(IWorkbenchPreferenceConstants.RESCALING_AT_RUNTIME); @@ -758,6 +757,8 @@ public static Display createDisplay() { Display.setAppName(applicationName); } + setRescaleAtRuntimePropertyFromPreference(); + // create the display Display newDisplay = Display.getCurrent(); if (newDisplay == null) { diff --git a/bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/messages.properties b/bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/messages.properties index 08c857e04ff..ead0040533a 100644 --- a/bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/messages.properties +++ b/bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/messages.properties @@ -504,7 +504,7 @@ RescaleAtRuntimeSettingChangeWarningTitle = DPI Setting Changed RescaleAtRuntimeSettingChangeWarningText = Restart for the DPI setting changes to take effect HiDpiSettingsGroupTitle = HiDPI settings RescaleAtRuntimeEnabled = Monitor-specific UI &scaling -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. +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. # --- Workbench ----- WorkbenchPreference_openMode=Open mode WorkbenchPreference_doubleClick=D&ouble click