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 5120 - Window that is minimized and then shown is missing minimized flag but still minimized.
Summary: Window that is minimized and then shown is missing minimized flag but still m...
Status: NEW
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: x86_64 Windows 10
: P2 minor
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-02 22:18 UTC by Erik Soma
Modified: 2020-05-02 22:18 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 Erik Soma 2020-05-02 22:18:14 UTC
Steps to reproduce:
 - create a window with default flags
 - minimize the window (SDL_WINDOW_MINIMIZED is correctly set)
 - hide the window (SDL_WINDOW_MINIMIZED is still set)
 - show the window
 - check SDL_WINDOW_MINIMIZED, it is not set, but the OS window is still minimized

SDL_ShowWindow causes SDL_SendWindowEvent(..., SDL_WINDOWEVENT_SHOWN, ...) which removes the SDL_WINDOW_MINIMIZED flag. This behavior was added in changeset 12730. The commit message is "Windows are not in a minimized state when they are shown", but this is not the case at least in Windows (I don't have another platform with GUI to test the behavior there). However, given the order of SDL_FinishWindowCreation it doesn't seem likely this is the case on other platforms either (otherwise passing SDL_WINDOW_MINIMIZED to SDL_CreateWindow would appear to do nothing?). From an API perspective it seems surprising that the intent would be for SDL_ShowWindow to also restore the minimized window (though I suppose not from a natural language perspective, but it would mean there is no way to un-hide a window without also restoring it).

I was unable to find another bug report that prompted this change. So perhaps I'm missing some context, but reverting 12730 fixed the issue for me.