Improve smallwindow detection, code cleanup.

This commit is contained in:
Henrik Rydgård committed 2017-01-17 17:21:00 +07:00
1 parent d91f82604d
commit 0be02f6de0
5 files changed
+45 -30

No files matched your search

+1 -10
View File
@@ -204,15 +204,6 @@ namespace MainWindow
rcOuter.top = g_Config.iWindowY;
}
static bool IsWindowSmall() {
// Can't take this from config as it will not be set if windows is maximized.
RECT rc;
GetWindowRect(hwndMain, &rc);
int width = (int)((rc.right - rc.left) * g_dpi_scale);
int height = (int)((rc.bottom - rc.top) * g_dpi_scale);
return g_Config.IsPortrait() ? (height < 480 + 80) : (width < 480 + 80);
}
void SetWindowSize(int zoom) {
AssertCurrentThreadName("Main");
RECT rc, rcOuter;
@@ -281,7 +272,7 @@ namespace MainWindow
PSP_CoreParameter().pixelHeight = height;
}
if (UpdateScreenScale(width, height, IsWindowSmall())) {
if (UpdateScreenScale(width, height)) {
NativeMessageReceived("gpu resized", "");
}