From 014f16731e63ad51c6b98288dff77b6a4c27df21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Hrdli=C4=8Dka?= Date: Wed, 24 Feb 2021 21:04:42 +0100 Subject: [PATCH] win_ui: remove redundant resizing code the resize handler already takes care of resizing the render window and status bar, so there is no need to do it after each `ResizeWindowByClientArea` call --- src/win/win_ui.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/src/win/win_ui.c b/src/win/win_ui.c index 6328d1d63..d13a01b5e 100644 --- a/src/win/win_ui.c +++ b/src/win/win_ui.c @@ -611,16 +611,9 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) temp_x = unscaled_size_x; temp_y = unscaled_size_y; } - /* Main Window. */ + ResizeWindowByClientArea(hwnd, temp_x, temp_y + sbar_height); - /* Render window. */ - MoveWindow(hwndRender, 0, 0, temp_x, temp_y, TRUE); - GetWindowRect(hwndRender, &rect); - - /* Status bar. */ - MoveWindow(hwndSBAR, 0, rect.bottom, temp_x, 17, TRUE); - if (mouse_capture) { ClipCursor(&rect); } @@ -1478,8 +1471,6 @@ plat_pause(int p) void plat_resize(int x, int y) { - RECT r; - /* First, see if we should resize the UI window. */ if (!vid_resize) { @@ -1489,15 +1480,6 @@ plat_resize(int x, int y) y = MulDiv(y, dpi, 96); } ResizeWindowByClientArea(hwndMain, x, y + sbar_height); - - MoveWindow(hwndRender, 0, 0, x, y, TRUE); - GetWindowRect(hwndRender, &r); - - MoveWindow(hwndSBAR, 0, y, x, 17, TRUE); - - if (mouse_capture) { - ClipCursor(&r); - } } }