show a warning in the console about the hidpi option

This commit is contained in:
Ben Fry
2022-01-15 07:05:50 -05:00
parent fcdc872379
commit e4b9312650
2 changed files with 27 additions and 9 deletions

View File

@@ -161,15 +161,6 @@ public class Base {
// call after Platform.init() because we need the settings folder
Console.startup();
/*
// working on https://github.com/processing/processing4/issues/231
// and https://github.com/processing/processing4/issues/226
System.out.println("retina is " + Toolkit.isRetina());
System.out.println("system zoom " + Platform.getSystemZoom());
System.out.println("java2d param is " + System.getProperty("sun.java2d.uiScale.enabled"));
System.out.println("toolkit res is " + java.awt.Toolkit.getDefaultToolkit().getScreenResolution());
*/
// Set the debug flag based on a file being present in the settings folder
File debugFile = getSettingsFile("debug");
@@ -241,6 +232,7 @@ public class Base {
SingleInstance.startServer(base);
handleWelcomeScreen(base);
handleCrustyDisplay();
//checkDriverBug(); // that was 2017, right?
} catch (Throwable t) {
@@ -337,6 +329,31 @@ public class Base {
*/
/**
* Temporary workaround as we try to sort out
* https://github.com/processing/processing4/issues/231
* and https://github.com/processing/processing4/issues/226
*/
static private void handleCrustyDisplay() {
/*
System.out.println("retina is " + Toolkit.isRetina());
System.out.println("system zoom " + Platform.getSystemZoom());
System.out.println("java2d param is " + System.getProperty("sun.java2d.uiScale.enabled"));
System.out.println("toolkit res is " + java.awt.Toolkit.getDefaultToolkit().getScreenResolution());
*/
if (Platform.isWindows()) { // only an issue on Windows
if (!Toolkit.isRetina() && !Splash.getDisableHiDPI()) {
int res = java.awt.Toolkit.getDefaultToolkit().getScreenResolution();
if (res % 96 != 0) {
// fractional dpi scaling on a low-res screen
System.out.println("If the editor cursor is in the wrong place or the interface is blocky or fuzzy,");
System.out.println("open Preferences and select the “Disable HiDPI Scaling” option to fix it.");
}
}
}
}
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

View File

@@ -85,6 +85,7 @@ X option to disable the Windows startup setting for scaling
X need to have a better workaround
o detect 150% scaling and disable the flag, otherwise set it?
X can't be detected reliably
_ show a warning in the console for screen issues?
before release