=> fbad0cc670fc12f135af2a60f4af2aa9bd93cf9c
[1mdiff --git a/src/app.c b/src/app.c[m [1mindex bf781c03..f8dc5697 100644[m [1m--- a/src/app.c[m [1m+++ b/src/app.c[m [36m@@ -122,6 +122,7 @@[m [mstruct Impl_App {[m uint32_t lastTickerTime;[m uint32_t elapsedSinceLastTicker;[m iBool isRunning;[m [32m+[m[32m iBool isRunningUnderWindowSystem;[m #if defined (LAGRANGE_ENABLE_IDLE_SLEEP)[m iBool isIdling;[m uint32_t lastEventTime;[m [36m@@ -626,6 +627,12 @@[m [mstatic iBool hasCommandLineOpenableScheme_(const iRangecc uri) {[m }[m [m static void init_App_(iApp *d, int argc, char **argv) {[m [32m+[m[32m#if defined (iPlatformLinux)[m [32m+[m[32m d->isRunningUnderWindowSystem = !iCmpStr(SDL_GetCurrentVideoDriver(), "x11") ||[m [32m+[m[32m !iCmpStr(SDL_GetCurrentVideoDriver(), "wayland");[m [32m+[m[32m#else[m [32m+[m[32m d->isRunningUnderWindowSystem = iTrue;[m [32m+[m[32m#endif[m init_CommandLine(&d->args, argc, argv);[m /* Where was the app started from? We ask SDL first because the command line alone is[m not a reliable source of this information, particularly when it comes to different[m [36m@@ -749,7 +756,8 @@[m [mstatic void init_App_(iApp *d, int argc, char **argv) {[m mulfv_I2(&d->initialWindowRect.size, desktopDPI_Win32());[m #endif[m #if defined (iPlatformLinux)[m [31m- /* Scale by the primary (?) monitor DPI. */ {[m [32m+[m[32m /* Scale by the primary (?) monitor DPI. */[m[41m [m [32m+[m[32m if (isRunningUnderWindowSystem_App()) {[m float vdpi;[m SDL_GetDisplayDPI(0, NULL, NULL, &vdpi);[m const float factor = vdpi / 96.0f;[m [36m@@ -1582,6 +1590,10 @@[m [menum iAppDeviceType deviceType_App(void) {[m #endif[m }[m [m [32m+[m[32miBool isRunningUnderWindowSystem_App(void) {[m [32m+[m[32m return app_.isRunningUnderWindowSystem;[m [32m+[m[32m}[m [32m+[m iGmCerts *certs_App(void) {[m return app_.certs;[m }[m [1mdiff --git a/src/app.h b/src/app.h[m [1mindex 5d1d42e1..55bec5a6 100644[m [1m--- a/src/app.h[m [1m+++ b/src/app.h[m [36m@@ -87,6 +87,8 @@[m [miBool isLandscape_App (void);[m iLocalDef iBool isPortrait_App (void) { return !isLandscape_App(); }[m enum iAppDeviceType deviceType_App (void);[m iLocalDef iBool isPortraitPhone_App (void) { return isPortrait_App() && deviceType_App() == phone_AppDeviceType; }[m [32m+[m[32miBool isRunningUnderWindowSystem_App (void);[m [32m+[m iGmCerts * certs_App (void);[m iVisited * visited_App (void);[m iBookmarks * bookmarks_App (void);[m [1mdiff --git a/src/ui/window.c b/src/ui/window.c[m [1mindex ebb4d1a8..f8391ed9 100644[m [1m--- a/src/ui/window.c[m [1m+++ b/src/ui/window.c[m [36m@@ -278,11 +278,14 @@[m [mstatic float displayScale_Window_(const iWindow *d) {[m iUnused(d);[m return desktopDPI_Win32();[m #else[m [31m- float vdpi = 0.0f;[m [31m- SDL_GetDisplayDPI(SDL_GetWindowDisplayIndex(d->win), NULL, NULL, &vdpi);[m [31m-// printf("DPI: %f\n", vdpi);[m [31m- const float factor = vdpi / baseDPI_Window / pixelRatio_Window_(d);[m [31m- return iMax(1.0f, factor);[m [32m+[m[32m if (isRunningUnderWindowSystem_App()) {[m [32m+[m[32m float vdpi = 0.0f;[m [32m+[m[32m SDL_GetDisplayDPI(SDL_GetWindowDisplayIndex(d->win), NULL, NULL, &vdpi);[m [32m+[m[32m// printf("DPI: %f\n", vdpi);[m [32m+[m[32m const float factor = vdpi / baseDPI_Window / pixelRatio_Window_(d);[m [32m+[m[32m return iMax(1.0f, factor);[m [32m+[m[32m }[m [32m+[m[32m return 1.0f;[m #endif[m }[m [m
text/gemini; charset=utf-8
This content has been proxied by September (ba2dc).