Skip to content

Commit b45c4a0

Browse files
HeikoKlarefedejeanne
authored andcommitted
[Win32] Enable monitor-specific scaling by default
The monitor-specific UI scaling on Windows is disabled by default and can be activated via a preference. This change inverts the default enablement: it enables the feature by default and allows to disable it via preference. The existing experimental preference is renamed to reset the configuration for every consumer. All information about the feature being experimental is removed.
1 parent 88e83a8 commit b45c4a0

File tree

6 files changed

+27
-29
lines changed

6 files changed

+27
-29
lines changed
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<component id="org.eclipse.ui.workbench" version="2">
3+
<resource path="eclipseui/org/eclipse/ui/IWorkbenchPreferenceConstants.java" type="org.eclipse.ui.IWorkbenchPreferenceConstants">
4+
<filter id="388194388">
5+
<message_arguments>
6+
<message_argument value="org.eclipse.ui.IWorkbenchPreferenceConstants"/>
7+
<message_argument value="RESCALING_AT_RUNTIME"/>
8+
<message_argument value="RESCALING_AT_RUNTIME"/>
9+
</message_arguments>
10+
</filter>
11+
</resource>
12+
</component>

Diff for: bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/IWorkbenchPreferenceConstants.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -722,11 +722,10 @@ public interface IWorkbenchPreferenceConstants {
722722

723723
/**
724724
* <p>
725-
* <strong>EXPERIMENTAL</strong>. Whether the UI adapts to DPI changes at
726-
* runtime. It only effects Windows.
725+
* Whether the UI adapts to DPI changes at runtime. It only affects Windows.
727726
* </p>
728727
*
729728
* @since 3.134
730729
*/
731-
String RESCALING_AT_RUNTIME = "RESCALING_AT_RUNTIME"; //$NON-NLS-1$
730+
String RESCALING_AT_RUNTIME = "monitorSpecificScaling"; //$NON-NLS-1$
732731
}

Diff for: bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/Workbench.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ private static void setRescaleAtRuntimePropertyFromPreference() {
702702
));
703703
} else {
704704
boolean rescaleAtRuntime = ConfigurationScope.INSTANCE.getNode(WorkbenchPlugin.PI_WORKBENCH)
705-
.getBoolean(IWorkbenchPreferenceConstants.RESCALING_AT_RUNTIME, false);
705+
.getBoolean(IWorkbenchPreferenceConstants.RESCALING_AT_RUNTIME, true);
706706
System.setProperty(SWT_RESCALE_AT_RUNTIME_PROPERTY, Boolean.toString(rescaleAtRuntime));
707707
}
708708
}

Diff for: bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/WorkbenchMessages.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ public class WorkbenchMessages extends NLS {
3636

3737
public static String HiDpiSettingsGroupTitle;
3838

39-
public static String RescaleAtRuntimeEnabled;
39+
public static String RescaleAtRuntimeDescription;
4040

41-
public static String RescaleAtRuntimeDisclaimer;
41+
public static String RescaleAtRuntimeEnabled;
4242

4343
public static String RescaleAtRuntimeSettingChangeWarningTitle;
4444

Diff for: bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/dialogs/ViewsPreferencePage.java

+8-21
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
import org.eclipse.jface.dialogs.MessageDialog;
5656
import org.eclipse.jface.fieldassist.ControlDecoration;
5757
import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
58-
import org.eclipse.jface.layout.GridDataFactory;
5958
import org.eclipse.jface.preference.IPreferenceStore;
6059
import org.eclipse.jface.preference.PreferencePage;
6160
import org.eclipse.jface.util.Util;
@@ -76,7 +75,6 @@
7675
import org.eclipse.swt.widgets.Composite;
7776
import org.eclipse.swt.widgets.Control;
7877
import org.eclipse.swt.widgets.Display;
79-
import org.eclipse.swt.widgets.Group;
8078
import org.eclipse.swt.widgets.Label;
8179
import org.eclipse.ui.IWorkbench;
8280
import org.eclipse.ui.IWorkbenchPreferenceConstants;
@@ -140,7 +138,7 @@ protected Control createContents(Composite parent) {
140138
layout.horizontalSpacing = 10;
141139
comp.setLayout(layout);
142140
createThemeIndependentComposits(comp);
143-
createHiDPISettingsGroup(comp);
141+
createRescaleAtRuntimeCheckButton(comp);
144142
return comp;
145143
}
146144

@@ -186,7 +184,7 @@ protected Control createContents(Composite parent) {
186184
createHideIconsForViewTabs(comp);
187185
createDependency(showFullTextForViewTabs, hideIconsForViewTabs);
188186

189-
createHiDPISettingsGroup(comp);
187+
createRescaleAtRuntimeCheckButton(comp);
190188

191189
if (currentTheme != null) {
192190
String colorsAndFontsThemeId = getColorAndFontThemeIdByThemeId(currentTheme.getId());
@@ -200,28 +198,17 @@ protected Control createContents(Composite parent) {
200198
return comp;
201199
}
202200

203-
private void createHiDPISettingsGroup(Composite parent) {
201+
private void createRescaleAtRuntimeCheckButton(Composite parent) {
204202
if (!OS.isWindows()) {
205203
return;
206204
}
207205
createLabel(parent, ""); //$NON-NLS-1$
208-
Group group = new Group(parent, SWT.LEFT);
209-
group.setText(WorkbenchMessages.HiDpiSettingsGroupTitle);
210-
211-
GridData gridData = new GridData(SWT.FILL, SWT.CENTER, true, false);
212-
gridData.horizontalSpan = ((GridLayout) parent.getLayout()).numColumns;
213-
group.setLayoutData(gridData);
214-
group.setFont(parent.getFont());
215-
GridLayout layout = new GridLayout(1, false);
216-
group.setLayout(layout);
217-
Label infoLabel = new Label(group, SWT.WRAP);
218-
infoLabel.setText(WorkbenchMessages.RescaleAtRuntimeDisclaimer);
219-
infoLabel.setLayoutData(GridDataFactory.defaultsFor(infoLabel).create());
220-
createLabel(group, ""); //$NON-NLS-1$
221206

222207
boolean initialStateRescaleAtRuntime = ConfigurationScope.INSTANCE.getNode(WorkbenchPlugin.PI_WORKBENCH)
223-
.getBoolean(IWorkbenchPreferenceConstants.RESCALING_AT_RUNTIME, false);
224-
rescaleAtRuntime = createCheckButton(group, WorkbenchMessages.RescaleAtRuntimeEnabled, initialStateRescaleAtRuntime);
208+
.getBoolean(IWorkbenchPreferenceConstants.RESCALING_AT_RUNTIME, true);
209+
rescaleAtRuntime = createCheckButton(parent, WorkbenchMessages.RescaleAtRuntimeEnabled,
210+
initialStateRescaleAtRuntime);
211+
rescaleAtRuntime.setToolTipText(WorkbenchMessages.RescaleAtRuntimeDescription);
225212
}
226213

227214
private void createThemeIndependentComposits(Composite comp) {
@@ -377,7 +364,7 @@ public boolean performOk() {
377364
IEclipsePreferences configurationScopeNode = ConfigurationScope.INSTANCE
378365
.getNode(WorkbenchPlugin.PI_WORKBENCH);
379366
boolean initialStateRescaleAtRuntime = configurationScopeNode
380-
.getBoolean(IWorkbenchPreferenceConstants.RESCALING_AT_RUNTIME, false);
367+
.getBoolean(IWorkbenchPreferenceConstants.RESCALING_AT_RUNTIME, true);
381368
isRescaleAtRuntimeChanged = initialStateRescaleAtRuntime != rescaleAtRuntime.getSelection();
382369
configurationScopeNode.putBoolean(IWorkbenchPreferenceConstants.RESCALING_AT_RUNTIME,
383370
rescaleAtRuntime.getSelection());

Diff for: bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/messages.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -503,8 +503,8 @@ ThemeChangeWarningTitle = Theme Changed
503503
RescaleAtRuntimeSettingChangeWarningTitle = DPI Setting Changed
504504
RescaleAtRuntimeSettingChangeWarningText = Restart for the DPI setting changes to take effect
505505
HiDpiSettingsGroupTitle = HiDPI settings
506-
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 is still in development and therefore considered experimental.
506+
RescaleAtRuntimeDescription = Activating this option will dynamically scale all windows according to the monitor they are currently in
507+
RescaleAtRuntimeEnabled = Use monitor-specific UI &scaling
508508
# --- Workbench -----
509509
WorkbenchPreference_openMode=Open mode
510510
WorkbenchPreference_doubleClick=D&ouble click

0 commit comments

Comments
 (0)