w32_common: Scale window when moving to display with different DPI

For applications that are DPI aware WM_DPICHANGED message contains
suggested size and position of window
This commit is contained in:
Piotr Gasior 2020-05-07 21:13:51 +02:00 committed by James Ross-Gowan
parent 8bce6d0b89
commit 5676e5ba39
1 changed files with 5 additions and 0 deletions

View File

@ -1115,6 +1115,11 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam,
break; break;
case WM_DPICHANGED: case WM_DPICHANGED:
update_display_info(w32); update_display_info(w32);
RECT *rc = (RECT*)lParam;
w32->windowrc = *rc;
subtract_window_borders(w32, w32->window, &w32->windowrc);
update_window_state(w32);
break; break;
case WM_CLOSE: case WM_CLOSE:
// Don't destroy the window yet to not lose wakeup events. // Don't destroy the window yet to not lose wakeup events.