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 1309

Summary: Don't grab focus during ResizeWindow on Win32 when SDL window is reparented
Product: SDL Reporter: burkheart
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P1 CC: icculus
Version: HG 1.2   
Hardware: x86   
OS: Windows 7   

Description burkheart 2011-09-24 07:42:49 UTC
When reparenting the SDL Window in a Win32 window (using SetParent) then stealing the focus during resizing from the parent window is causing problems.

Assume you are dragging a corner of the parent window and consequently the parent window is sending resize events to the SDL child window. The SDL child window will eventually call DIB_ResizeWindow which has a call to SetForegroundWindow and is stealing the focus from the parent window. The switch in focus stops the resizing dragging process in the parent window. Basically making it nearly impossible to resize the parent window by dragging along the edges and corners.

Solution, add a condition to avoid this when reparenting:
if (GetParent(SDL_Window) == NULL) SetForegroundWindow(SDL_Window);
Comment 1 Sam Lantinga 2011-12-29 01:51:09 UTC
Do you have a patch to fix this issue?
Comment 2 Ryan C. Gordon 2011-12-30 01:18:20 UTC
(In reply to comment #1)
> Do you have a patch to fix this issue?

I think it was a one-liner in his comment.  :)

--ryan.
Comment 3 Ryan C. Gordon 2011-12-30 01:25:47 UTC
Bumping priority on a few bugs that I would like examined more closely before 1.2.15 is finalized. This is not a promise that a bug will be fixed. We may close it with WONTFIX or WORKSFORME or something, but I just want to make sure attention is paid.

--ryan.
Comment 4 Sam Lantinga 2011-12-30 03:29:58 UTC
Fixed, thanks!
http://hg.libsdl.org/SDL/rev/36f33f295c97