summaryrefslogtreecommitdiff
path: root/src/app.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-02-02 15:01:01 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-02-02 15:01:56 +0200
commit5dac1beb7bd29604142988961d69ac2c17be1f86 (patch)
tree23d49ed659464a7e46c649a4ee6bde9faba27091 /src/app.c
parent6d885dee5e3a9fc7316c901542eec21e39ae1f12 (diff)
Linux: Use SDL to query display monitor DPI value
IssueID #133
Diffstat (limited to 'src/app.c')
-rw-r--r--src/app.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/app.c b/src/app.c
index f44fdf4f..a2d80bf2 100644
--- a/src/app.c
+++ b/src/app.c
@@ -374,6 +374,14 @@ static void init_App_(iApp *d, int argc, char **argv) {
374 /* Must scale by UI scaling factor. */ 374 /* Must scale by UI scaling factor. */
375 mulfv_I2(&d->initialWindowRect.size, desktopDPI_Win32()); 375 mulfv_I2(&d->initialWindowRect.size, desktopDPI_Win32());
376#endif 376#endif
377#if defined (iPlatformLinux)
378 /* Scale by the primary (?) monitor DPI. */ {
379 float vdpi;
380 SDL_GetDisplayDPI(0, NULL, NULL, &vdpi);
381 const float factor = vdpi / 96.0f;
382 mulfv_I2(&d->initialWindowRect.size, iMax(factor, 1.0f));
383 }
384#endif
377 init_Prefs(&d->prefs); 385 init_Prefs(&d->prefs);
378 setCStr_String(&d->prefs.downloadDir, downloadDir_App_); 386 setCStr_String(&d->prefs.downloadDir, downloadDir_App_);
379 d->isRunning = iFalse; 387 d->isRunning = iFalse;