diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c index aa29da157..e2b95ad4e 100644 --- a/src/video/windows/SDL_windowsevents.c +++ b/src/video/windows/SDL_windowsevents.c @@ -1548,7 +1548,14 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) data->scaling_dpi = newDPI; /* Send a SDL_WINDOWEVENT_SIZE_CHANGED saying that the client size (in dpi-scaled points) is unchanged. - Renderers need to get this to know that the framebuffer size changed. */ + Renderers need to get this to know that the framebuffer size changed. + + We clear the window size to force the event to be delivered, but what we really + want for SDL3 is a new event to notify that the DPI changed and then watch for + that in the renderer directly. + */ + data->window->w = 0; + data->window->h = 0; SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_SIZE_CHANGED, data->window->w, data->window->h); } diff --git a/src/video/windows/SDL_windowswindow.c b/src/video/windows/SDL_windowswindow.c index 58f7b9809..eb536bbe4 100644 --- a/src/video/windows/SDL_windowswindow.c +++ b/src/video/windows/SDL_windowswindow.c @@ -932,11 +932,6 @@ WIN_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_Log("WIN_SetWindowFullscreen: %d", (int)fullscreen); #endif - /* Clear the window size, to force SDL_SendWindowEvent to send a SDL_WINDOWEVENT_RESIZED - event in WM_WINDOWPOSCHANGED. */ - data->window->w = 0; - data->window->h = 0; - if (SDL_ShouldAllowTopmost() && (window->flags & SDL_WINDOW_ALWAYS_ON_TOP)) { top = HWND_TOPMOST; } else {