From: Toni Wilen Date: Mon, 8 Jan 2024 18:35:33 +0000 (+0200) Subject: Include also DPI when selecting default GUI size X-Git-Tag: 5200~76 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=f3165322d09c667f01bd9f3f1c4e648d7040aaaa;p=francis%2Fwinuae.git Include also DPI when selecting default GUI size --- diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index 73e7d512..36ef5a32 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -12974,8 +12974,12 @@ static void getguidefaultsize(int *wp, int *hp) { int w = GetSystemMetrics(SM_CXVIRTUALSCREEN); int h = GetSystemMetrics(SM_CYVIRTUALSCREEN); + int dpi = getdpiformonitor(NULL); - if (w >= 1600 && h >= 1024) { + int ww = MulDiv(1600, dpi, 96); + int wh = MulDiv(1024, dpi, 96); + + if (w >= ww && h >= wh) { *wp = GUI_INTERNAL_WIDTH_NEW; *hp = GUI_INTERNAL_HEIGHT_NEW; } else {