summaryrefslogtreecommitdiff
path: root/src/ui/window.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/window.c')
-rw-r--r--src/ui/window.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ui/window.c b/src/ui/window.c
index 0bbe588c..9f12cabf 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -263,6 +263,10 @@ static float pixelRatio_Window_(const iWindow *d) {
263# define baseDPI_Window 96.0f 263# define baseDPI_Window 96.0f
264#endif 264#endif
265 265
266#if defined (iPlatformAndroidMobile)
267float displayDensity_Android(void);
268#endif
269
266static float displayScale_Window_(const iWindow *d) { 270static float displayScale_Window_(const iWindow *d) {
267 /* The environment variable LAGRANGE_OVERRIDE_DPI can be used to override the automatic 271 /* The environment variable LAGRANGE_OVERRIDE_DPI can be used to override the automatic
268 display DPI detection. If not set, or is an empty string, ignore it. 272 display DPI detection. If not set, or is an empty string, ignore it.
@@ -289,6 +293,8 @@ static float displayScale_Window_(const iWindow *d) {
289#elif defined (iPlatformMsys) 293#elif defined (iPlatformMsys)
290 iUnused(d); 294 iUnused(d);
291 return desktopDPI_Win32(); 295 return desktopDPI_Win32();
296#elif defined (iPlatformAndroidMobile)
297 return displayDensity_Android();
292#else 298#else
293 if (isRunningUnderWindowSystem_App()) { 299 if (isRunningUnderWindowSystem_App()) {
294 float vdpi = 0.0f; 300 float vdpi = 0.0f;
@@ -457,7 +463,7 @@ void init_Window(iWindow *d, enum iWindowType type, iRect rect, uint32_t flags)
457 d->mouseGrab = NULL; 463 d->mouseGrab = NULL;
458 d->focus = NULL; 464 d->focus = NULL;
459 d->pendingCursor = NULL; 465 d->pendingCursor = NULL;
460 d->isExposed = iFalse; 466 d->isExposed = (deviceType_App() != desktop_AppDeviceType);
461 d->isMinimized = iFalse; 467 d->isMinimized = iFalse;
462 d->isInvalidated = iFalse; /* set when posting event, to avoid repeated events */ 468 d->isInvalidated = iFalse; /* set when posting event, to avoid repeated events */
463 d->isMouseInside = iTrue; 469 d->isMouseInside = iTrue;
@@ -541,6 +547,8 @@ void init_MainWindow(iMainWindow *d, iRect rect) {
541 SDL_SetHint(SDL_HINT_RENDER_DRIVER, "metal"); 547 SDL_SetHint(SDL_HINT_RENDER_DRIVER, "metal");
542 flags |= SDL_WINDOW_METAL; 548 flags |= SDL_WINDOW_METAL;
543 d->base.isExposed = iTrue; 549 d->base.isExposed = iTrue;
550#elif defined (iPlatformAndroidMobile)
551 d->base.isExposed = iTrue;
544#else 552#else
545 if (!forceSoftwareRender_App()) { 553 if (!forceSoftwareRender_App()) {
546 flags |= SDL_WINDOW_OPENGL; 554 flags |= SDL_WINDOW_OPENGL;