From 6f6128cae70561757dd87ce6ed5f9f8efda71848 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Mon, 12 Jun 2023 00:12:02 -0500 Subject: [PATCH] GUI: fix Wayland scaling factor detection when full-screen is on --- src/gui/gui.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index dd315ddf..673db6f1 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -3535,7 +3535,8 @@ bool FurnaceGUI::loop() { // update config x/y/w/h values based on scrMax state if (updateWindow) { logV("updateWindow is true"); - if (!scrMax) { + if (!scrMax && !fullScreen) { + logV("updating scrConf"); scrConfX=scrX; scrConfY=scrY; scrConfW=scrW; @@ -6257,11 +6258,17 @@ bool FurnaceGUI::init() { // special consideration for Wayland if (settings.dpiScale<0.5f) { if (strcmp(videoBackend,"wayland")==0) { - if (scrW<1) { + int realW=scrW; + int realH=scrH; + + SDL_GetWindowSize(sdlWin,&realW,&realH); + + if (realW<1) { logW("screen width is zero!\n"); dpiScale=1.0; } else { - dpiScale=(double)canvasW/(double)scrW; + dpiScale=(double)canvasW/(double)realW; + logV("we're on Wayland... scaling factor: %f",dpiScale); } } }