[1mdiff --git a/src/ui/window.c b/src/ui/window.c[m
[1mindex e1266357..bda645f7 100644[m
[1m--- a/src/ui/window.c[m
[1m+++ b/src/ui/window.c[m
[36m@@ -63,9 +63,6 @@[m [mSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */[m
#include "stb_image.h"[m
#include "stb_image_resize.h"[m
[m
[31m-#include <stdlib.h>[m
[31m-#include <string.h>[m
[31m-[m
static iWindow *theWindow_ = NULL;[m
[m
#if defined (iPlatformApple) || defined (iPlatformLinux)[m
[36m@@ -1317,24 +1314,23 @@[m [mstatic float pixelRatio_Window_(const iWindow *d) {[m
#endif[m
[m
static float displayScale_Window_(const iWindow *d) {[m
[31m- char* LAGRANGE_OVERRIDE_DPI = getenv("LAGRANGE_OVERRIDE_DPI");[m
[31m-[m
[31m- /* If LAGRANGE_OVERRIDE_DPI is not set, or is an empty string, ignore it. */[m
[31m- if ((LAGRANGE_OVERRIDE_DPI != NULL) && (strnlen(LAGRANGE_OVERRIDE_DPI, 1) > 0)) {[m
[31m- /* This if the user has set the env var, but it is not an int, atoi */[m
[32m+[m[32m /* The environment variable LAGRANGE_OVERRIDE_DPI can be used to override the automatic[m
[32m+[m[32m display DPI detection. If not set, or is an empty string, ignore it.[m
[32m+[m[32m Note: the same value used for all displays. */[m
[32m+[m[32m const char *LAGRANGE_OVERRIDE_DPI = getenv("LAGRANGE_OVERRIDE_DPI");[m
[32m+[m[32m if (LAGRANGE_OVERRIDE_DPI && *LAGRANGE_OVERRIDE_DPI) {[m
[32m+[m[32m /* If the user has set the env var, but it is not an int, atoi */[m
/* will return 0, in which case we just guess and return 96 DPI. */[m
[31m- int env_dpi = atoi(LAGRANGE_OVERRIDE_DPI);[m
[31m-[m
[31m- if (env_dpi == 0) {[m
[31m- fprintf(stderr, "WARNING: failed to parse LAGRANGE_OVERRIDE_DPI='%s', ignoring it\n", LAGRANGE_OVERRIDE_DPI);[m
[31m- /* To avoid showing the window multiple times, overwrite[m
[31m- * LAGRANGE_OVERRIDE_DPI with the empty string. */[m
[31m- setenv("LAGRANGE_OVERRIDE_DPI", "", 1);[m
[31m- } else {[m
[31m- return ((float) env_dpi) / baseDPI_Window;[m
[32m+[m[32m const int envDpi = atoi(LAGRANGE_OVERRIDE_DPI);[m
[32m+[m[32m if (envDpi > 0) {[m
[32m+[m[32m return ((float) envDpi) / baseDPI_Window;[m
}[m
[32m+[m[32m fprintf(stderr, "[Window] WARNING: failed to parse LAGRANGE_OVERRIDE_DPI='%s', "[m
[32m+[m[32m "ignoring it\n", LAGRANGE_OVERRIDE_DPI);[m
[32m+[m[32m /* To avoid showing the warning multiple times, overwrite[m
[32m+[m[32m LAGRANGE_OVERRIDE_DPI with the empty string. */[m
[32m+[m[32m setenv("LAGRANGE_OVERRIDE_DPI", "", 1);[m
}[m
[31m-[m
#if defined (iPlatformApple)[m
iUnused(d);[m
/* Apple UI sizes are fixed and only scaled by pixel ratio. */[m
text/plain
This content has been proxied by September (ba2dc).