We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 5517 - Windows-specific: wrong window size after SDL_SetWindowResizable()
Summary: Windows-specific: wrong window size after SDL_SetWindowResizable()
Status: NEW
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: 2.0.14
Hardware: x86 Windows 8
: P2 minor
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-29 10:04 UTC by Ivan
Modified: 2021-01-29 10:06 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan 2021-01-29 10:04:27 UTC
Under Windows:
 1. Create a window without SDL_WINDOW_RESIZABLE flag 
 2. Call SDL_SetWindowResizable() to make it resizable.
 3. Try to resize it and get a SDL_WINDOWEVENT_SIZE_CHANGED with WRONG window size (width and height is decreased by 10).

This happens if no SDL_SetWindowSize() is called between 2 and 3. 
Because Windows needs to update window size via MoveWindow() when window's style (border type) is changed, otherwise it reports wrong client area.
Comment 1 Ivan 2021-01-29 10:06:46 UTC
I'd suggest to add MoveWindow() call after SetWindowLong() in WIN_SetWindowResizable() in SDL_windowswindow.c