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 3202

Summary: [PATCH] Fix renderer visibility on a window maximized directly from the minimized state
Product: SDL Reporter: id.zeta <id.zeta>
Component: videoAssignee: David Ludwig <dll>
Status: RESOLVED FIXED QA Contact: David Ludwig <dll>
Severity: normal    
Priority: P2 CC: dll
Version: HG 2.0   
Hardware: All   
OS: Windows 7   
Attachments: PATCH

Description id.zeta 2015-12-07 14:05:04 UTC
Created attachment 2332 [details]
PATCH

Some OS's eg. Windows 7 allows a window to be maximized directly from its "minimized onto Taskbar" state. Even SDL2 HG up to Revision 9946 overlooks this case and will then cause the renderer fail to become visible when the window is maximized from the minimized state.

This attached patch fixes the issue by taking the SDL_WINDOWEVENT_MAXIMIZED event into account in SDL_RendererEventWatchas() to un-hide the renderer as well as exclusively setting/clearing the SDL_WINDOW_MINIMIZED and SDL_WINDOW_MAXIMIZED flags in SDL_SendWindowEvent().
Comment 1 David Ludwig 2015-12-27 18:04:58 UTC
*** Bug 3213 has been marked as a duplicate of this bug. ***
Comment 2 David Ludwig 2015-12-27 18:08:12 UTC
I can confirm that this bug also occurs, as tested on one of my Windows 10 systems:

* in SDL 2.0.3 based Win32 apps
* in the latest SDL2 HG code, as of this writing (Revision 9966 / https://hg.libsdl.org/SDL/rev/cae9c97fabbd)
* on WinRT, using the latest SDL2 HG code

The patch that is listed does fix the bug for Win32 apps, but not WinRT apps.  I'll plan on looking into why it doesn't work on WinRT.
Comment 3 David Ludwig 2015-12-27 23:00:08 UTC
Fixed for Win32 via http://hg.libsdl.org/SDL/rev/0a420ec24b6a

This bug is also happening on WinRT.  I'll try working on a fix there in the next day or so.
Comment 4 David Ludwig 2015-12-28 23:34:57 UTC
Fixed via https://hg.libsdl.org/SDL/rev/0a420ec24b6a (Win32 fix) and https://hg.libsdl.org/SDL/rev/fa7c016ac2d3 (WinRT fix)

Many thanks for the patch, id.zeta!