Merge pull request #1629 from Guldoman/PR_remove_default_scale_detection

Remove DPI detection for default `SCALE`
This commit is contained in:
Takase 2023-09-30 22:54:04 +08:00 committed by GitHub
commit f996f7a968
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 14 deletions

View File

@ -5,7 +5,7 @@ MOD_VERSION_MINOR = 0
MOD_VERSION_PATCH = 0 MOD_VERSION_PATCH = 0
MOD_VERSION_STRING = string.format("%d.%d.%d", MOD_VERSION_MAJOR, MOD_VERSION_MINOR, MOD_VERSION_PATCH) MOD_VERSION_STRING = string.format("%d.%d.%d", MOD_VERSION_MAJOR, MOD_VERSION_MINOR, MOD_VERSION_PATCH)
SCALE = tonumber(os.getenv("LITE_SCALE") or os.getenv("GDK_SCALE") or os.getenv("QT_SCALE_FACTOR")) or SCALE SCALE = tonumber(os.getenv("LITE_SCALE") or os.getenv("GDK_SCALE") or os.getenv("QT_SCALE_FACTOR")) or 1
PATHSEP = package.config:sub(1, 1) PATHSEP = package.config:sub(1, 1)
EXEDIR = EXEFILE:match("^(.+)[/\\][^/\\]+$") EXEDIR = EXEFILE:match("^(.+)[/\\][^/\\]+$")

View File

@ -20,16 +20,6 @@
static SDL_Window *window; static SDL_Window *window;
static double get_scale(void) {
#ifndef __APPLE__
float dpi;
if (SDL_GetDisplayDPI(0, NULL, &dpi, NULL) == 0)
return dpi / 96.0;
#endif
return 1.0;
}
static void get_exe_filename(char *buf, int sz) { static void get_exe_filename(char *buf, int sz) {
#if _WIN32 #if _WIN32
int len; int len;
@ -203,9 +193,6 @@ init_lua:
lua_pushstring(L, LITE_ARCH_TUPLE); lua_pushstring(L, LITE_ARCH_TUPLE);
lua_setglobal(L, "ARCH"); lua_setglobal(L, "ARCH");
lua_pushnumber(L, get_scale());
lua_setglobal(L, "SCALE");
char exename[2048]; char exename[2048];
get_exe_filename(exename, sizeof(exename)); get_exe_filename(exename, sizeof(exename));
if (*exename) { if (*exename) {