Make the old behavior that the UI shrinks if the window is small optional. New hidden setting [General]/ShrinkIfWindowSmall

This commit is contained in:
Henrik Rydgård committed 2025-11-06 23:44:55 +01:00
1 parent cfe807baed
commit 9155de3358
3 files changed
+6

No files matched your search

+1
View File
@@ -331,6 +331,7 @@ static const ConfigSetting generalSettings[] = {
ConfigSetting("WindowY", SETTING(g_Config, iWindowY), -1, CfgFlag::DEFAULT),
ConfigSetting("WindowWidth", SETTING(g_Config, iWindowWidth), 0, CfgFlag::DEFAULT), // 0 will be automatically reset later (need to do the AdjustWindowRect dance).
ConfigSetting("WindowHeight", SETTING(g_Config, iWindowHeight), 0, CfgFlag::DEFAULT),
ConfigSetting("ShrinkIfWindowSmall", SETTING(g_Config, bShrinkIfWindowSmall), false, CfgFlag::DEFAULT),
#endif
ConfigSetting("PauseWhenMinimized", SETTING(g_Config, bPauseWhenMinimized), false, CfgFlag::PER_GAME),
+1
View File
@@ -194,6 +194,7 @@ public:
bool bDisableHTTPS;
bool bShrinkIfWindowSmall;
bool bSeparateSASThread;
int iIOTimingMethod;
int iLockedCPUSpeed;
+4
View File
@@ -1645,6 +1645,10 @@ bool Native_IsWindowHidden() {
}
static bool IsWindowSmall(int pixelWidth, int pixelHeight) {
if (!g_Config.bShrinkIfWindowSmall) {
return false;
}
// Can't take this from config as it will not be set if windows is maximized.
int w = (int)(pixelWidth * g_display.dpi_scale_real_x);
int h = (int)(pixelHeight * g_display.dpi_scale_real_y);