summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/window.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/ui/window.c b/src/ui/window.c
index 8df92706..f8123a17 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -685,7 +685,12 @@ static float pixelRatio_Window_(const iWindow *d) {
685#if defined (iPlatformMsys) 685#if defined (iPlatformMsys)
686 iUnused(d); 686 iUnused(d);
687 return desktopDPI_Win32(); 687 return desktopDPI_Win32();
688#else 688#elif defined (iPlatformLinux)
689 float vdpi = 0.0f;
690 SDL_GetDisplayDPI(SDL_GetWindowDisplayIndex(d->win), NULL, NULL, &vdpi);
691 const float factor = vdpi / 96.0f;
692 return iMax(1.0f, factor);
693#else
689 int dx, x; 694 int dx, x;
690 SDL_GetRendererOutputSize(d->render, &dx, NULL); 695 SDL_GetRendererOutputSize(d->render, &dx, NULL);
691 SDL_GetWindowSize(d->win, &x, NULL); 696 SDL_GetWindowSize(d->win, &x, NULL);
@@ -764,6 +769,7 @@ void init_Window(iWindow *d, iRect rect) {
764 useExecutableIconResource_SDLWindow(d->win); 769 useExecutableIconResource_SDLWindow(d->win);
765#endif 770#endif
766#if defined (iPlatformLinux) 771#if defined (iPlatformLinux)
772 SDL_SetWindowMinimumSize(d->win, minSize.x * d->pixelRatio, minSize.y * d->pixelRatio);
767 /* Load the window icon. */ { 773 /* Load the window icon. */ {
768 int w, h, num; 774 int w, h, num;
769 const iBlock *icon = &imageLagrange64_Embedded; 775 const iBlock *icon = &imageLagrange64_Embedded;
@@ -1033,7 +1039,7 @@ iInt2 rootSize_Window(const iWindow *d) {
1033} 1039}
1034 1040
1035iInt2 coord_Window(const iWindow *d, int x, int y) { 1041iInt2 coord_Window(const iWindow *d, int x, int y) {
1036#if defined (iPlatformMsys) 1042#if defined (iPlatformMsys) || defined (iPlatformLinux)
1037 /* On Windows, surface coordinates are in pixels. */ 1043 /* On Windows, surface coordinates are in pixels. */
1038 return init_I2(x, y); 1044 return init_I2(x, y);
1039#else 1045#else