Skip to content

Commit e4b9312

Browse files
committed
show a warning in the console about the hidpi option
1 parent fcdc872 commit e4b9312

File tree

2 files changed

+27
-9
lines changed

2 files changed

+27
-9
lines changed

app/src/processing/app/Base.java

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -161,15 +161,6 @@ static private void createAndShowGUI(String[] args) {
161161
// call after Platform.init() because we need the settings folder
162162
Console.startup();
163163

164-
/*
165-
// working on https://github.com/processing/processing4/issues/231
166-
// and https://github.com/processing/processing4/issues/226
167-
System.out.println("retina is " + Toolkit.isRetina());
168-
System.out.println("system zoom " + Platform.getSystemZoom());
169-
System.out.println("java2d param is " + System.getProperty("sun.java2d.uiScale.enabled"));
170-
System.out.println("toolkit res is " + java.awt.Toolkit.getDefaultToolkit().getScreenResolution());
171-
*/
172-
173164
// Set the debug flag based on a file being present in the settings folder
174165
File debugFile = getSettingsFile("debug");
175166

@@ -241,6 +232,7 @@ static private void createAndShowGUI(String[] args) {
241232
SingleInstance.startServer(base);
242233

243234
handleWelcomeScreen(base);
235+
handleCrustyDisplay();
244236
//checkDriverBug(); // that was 2017, right?
245237

246238
} catch (Throwable t) {
@@ -337,6 +329,31 @@ static private void checkDriverBug() {
337329
*/
338330

339331

332+
/**
333+
* Temporary workaround as we try to sort out
334+
* https://github.com/processing/processing4/issues/231
335+
* and https://github.com/processing/processing4/issues/226
336+
*/
337+
static private void handleCrustyDisplay() {
338+
/*
339+
System.out.println("retina is " + Toolkit.isRetina());
340+
System.out.println("system zoom " + Platform.getSystemZoom());
341+
System.out.println("java2d param is " + System.getProperty("sun.java2d.uiScale.enabled"));
342+
System.out.println("toolkit res is " + java.awt.Toolkit.getDefaultToolkit().getScreenResolution());
343+
*/
344+
if (Platform.isWindows()) { // only an issue on Windows
345+
if (!Toolkit.isRetina() && !Splash.getDisableHiDPI()) {
346+
int res = java.awt.Toolkit.getDefaultToolkit().getScreenResolution();
347+
if (res % 96 != 0) {
348+
// fractional dpi scaling on a low-res screen
349+
System.out.println("If the editor cursor is in the wrong place or the interface is blocky or fuzzy,");
350+
System.out.println("open Preferences and select the “Disable HiDPI Scaling” option to fix it.");
351+
}
352+
}
353+
}
354+
}
355+
356+
340357
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
341358

342359

todo.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ X option to disable the Windows startup setting for scaling
8585
X need to have a better workaround
8686
o detect 150% scaling and disable the flag, otherwise set it?
8787
X can't be detected reliably
88+
_ show a warning in the console for screen issues?
8889

8990

9091
before release

0 commit comments

Comments
 (0)