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 - Don't grab focus during ResizeWindow on Win32 when SDL window is reparented
Summary: Don't grab focus during ResizeWindow on Win32 when SDL window is reparented
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 1.2
Hardware: x86 Windows 7
: P1 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-24 07:42 UTC by burkheart
Modified: 2011-12-30 03:29 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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