1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-23 23:32:26 +00:00

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

View File

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