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