Skip to content

Commit 9c2195b

Browse files
committed
Add warning in preferences dialog
Add a warning about flickering effects caused by the Edge browser under Preferences > General > Appearance.
1 parent 69f6e45 commit 9c2195b

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ public class WorkbenchMessages extends NLS {
7676

7777
public static String StatusUtil_errorOccurred;
7878

79+
public static String EdgeBrowserDisclaimer;
80+
7981
// ==============================================================================
8082
// Workbench Actions
8183
// ==============================================================================

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

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,16 @@
2020
package org.eclipse.ui.internal.dialogs;
2121

2222
import static org.eclipse.jface.viewers.LabelProvider.createTextProvider;
23+
import static org.eclipse.swt.events.SelectionListener.widgetSelectedAdapter;
2324
import static org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants.ATT_COLOR_AND_FONT_ID;
2425
import static org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants.ATT_OS_VERSION;
2526
import static org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants.ATT_THEME_ASSOCIATION;
2627
import static org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants.ATT_THEME_ID;
2728

29+
import java.awt.Desktop;
30+
import java.io.IOException;
31+
import java.net.URI;
32+
import java.net.URISyntaxException;
2833
import java.text.Collator;
2934
import java.util.ArrayList;
3035
import java.util.HashMap;
@@ -77,6 +82,7 @@
7782
import org.eclipse.swt.widgets.Display;
7883
import org.eclipse.swt.widgets.Group;
7984
import org.eclipse.swt.widgets.Label;
85+
import org.eclipse.swt.widgets.Link;
8086
import org.eclipse.ui.IWorkbench;
8187
import org.eclipse.ui.IWorkbenchPreferenceConstants;
8288
import org.eclipse.ui.IWorkbenchPreferencePage;
@@ -213,16 +219,27 @@ private void createHiDPISettingsGroup(Composite parent) {
213219
group.setFont(parent.getFont());
214220
GridLayout layout = new GridLayout(1, false);
215221
group.setLayout(layout);
216-
Label infoLabel = new Label(group, SWT.WRAP);
217-
infoLabel.setText(WorkbenchMessages.RescaleAtRuntimeDisclaimer);
222+
Link infoLabel = new Link(group, SWT.WRAP);
223+
infoLabel.setText(WorkbenchMessages.RescaleAtRuntimeDisclaimer + System.lineSeparator() + System.lineSeparator()
224+
+ WorkbenchMessages.EdgeBrowserDisclaimer);
218225
infoLabel.setLayoutData(GridDataFactory.defaultsFor(infoLabel).create());
226+
infoLabel.addSelectionListener(widgetSelectedAdapter(c -> openURL(c.text)));
227+
219228
createLabel(group, ""); //$NON-NLS-1$
220229

221230
boolean initialStateRescaleAtRuntime = PrefUtil.getAPIPreferenceStore()
222231
.getBoolean(IWorkbenchPreferenceConstants.RESCALING_AT_RUNTIME);
223232
rescaleAtRuntime = createCheckButton(group, WorkbenchMessages.RescaleAtRuntimeEnabled, initialStateRescaleAtRuntime);
224233
}
225234

235+
private void openURL(String url) {
236+
try {
237+
Desktop.getDesktop().browse(new URI(url));
238+
} catch (IOException | URISyntaxException e) {
239+
WorkbenchPlugin.log(e);
240+
}
241+
}
242+
226243
private void createThemeIndependentComposits(Composite comp) {
227244
createUseRoundTabs(comp);
228245
createColoredLabelsPref(comp);

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,8 @@ 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 = Dynamically scale all windows according to the monitor they are currently in.
508+
EdgeBrowserDisclaimer = WARNING! This will also set the default browser to Edge, which is known to cause flickering in some cases and may cause seizures (see <a href="https://github.com/eclipse-platform/eclipse.platform.swt/issues/1122">this issue</a> for details).
508509
# --- Workbench -----
509510
WorkbenchPreference_openMode=Open mode
510511
WorkbenchPreference_doubleClick=D&ouble click

0 commit comments

Comments
 (0)