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 2172

Summary: Window loses maximized state when activated
Product: SDL Reporter: norfanin
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.0   
Hardware: All   
OS: Windows (All)   

Description norfanin 2013-10-22 13:54:01 UTC
Changeset 357bccc72a1c [1] introduced a new issue that yanks a window out of its maximized state when activated. For example switching to another window with the taskbar and back to the SDL window. The call stack looks like this.

WIN_RaiseWindow      [src\video\windows\sdl_windowswindow.c @ 406]
SDL_RaiseWindow      [src\video\sdl_video.c @ 1769]
SDL_OnWindowRestored [src\video\sdl_video.c @ 2079]
SDL_SendWindowEvent  [src\events\sdl_windowevents.c @ 144]

WIN_RaiseWindow now calls WIN_RestoreWindow which has the effect of removing the maximized state.

I have to activate it twice sometimes to get this effect. Don't know why.

1: http://hg.libsdl.org/SDL/rev/357bccc72a1c
Comment 1 norfanin 2013-10-22 13:56:11 UTC
I forgot the WindowProc call in the call stack before SDL_SendWindowEvent.

WIN_WindowProc   [src\video\windows\sdl_windowsevents.c @ 349]
Comment 2 Sam Lantinga 2013-11-08 22:13:14 UTC
Fixed, thanks!
http://hg.libsdl.org/SDL/rev/94ed2e31a603