From cb39c0a4ab368466d52816690587db81dad198f9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jaakko=20Kera=CC=88nen?= jaakko.keranen@iki.fi
Date: Sat, 17 Apr 2021 14:39:26 +0300
Subject: [PATCH 1/1] Window: Cleanup
src/ui/window.c | 32 ++++++++++++++------------------
1 file changed, 14 insertions(+), 18 deletions(-)
diff --git a/src/ui/window.c b/src/ui/window.c
index e1266357..bda645f7 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -63,9 +63,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
#include "stb_image.h"
#include "stb_image_resize.h"
-#include <stdlib.h>
-#include <string.h>
static iWindow *theWindow_ = NULL;
#if defined (iPlatformApple) || defined (iPlatformLinux)
@@ -1317,24 +1314,23 @@ static float pixelRatio_Window_(const iWindow *d) {
#endif
static float displayScale_Window_(const iWindow *d) {
/* This if the user has set the env var, but it is not an int, atoi */
display DPI detection. If not set, or is an empty string, ignore it.
Note: the same value used for all displays. */
/* If the user has set the env var, but it is not an int, atoi */
/* will return 0, in which case we just guess and return 96 DPI. */
int env_dpi = atoi(LAGRANGE_OVERRIDE_DPI);
if (env_dpi == 0) {
fprintf(stderr, "WARNING: failed to parse LAGRANGE_OVERRIDE_DPI='%s', ignoring it\n", LAGRANGE_OVERRIDE_DPI);
/* To avoid showing the window multiple times, overwrite
* LAGRANGE_OVERRIDE_DPI with the empty string. */
setenv("LAGRANGE_OVERRIDE_DPI", "", 1);
} else {
return ((float) env_dpi) / baseDPI_Window;
const int envDpi = atoi(LAGRANGE_OVERRIDE_DPI);
if (envDpi > 0) {
return ((float) envDpi) / baseDPI_Window;
}
fprintf(stderr, "[Window] WARNING: failed to parse LAGRANGE_OVERRIDE_DPI='%s', "
"ignoring it\n", LAGRANGE_OVERRIDE_DPI);
/* To avoid showing the warning multiple times, overwrite
LAGRANGE_OVERRIDE_DPI with the empty string. */
setenv("LAGRANGE_OVERRIDE_DPI", "", 1);
}
#if defined (iPlatformApple)
iUnused(d);
/* Apple UI sizes are fixed and only scaled by pixel ratio. */
--
2.25.1
text/plain
This content has been proxied by September (ba2dc).