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 875

Summary: Title bar unresponsive after video mode change
Product: SDL Reporter: Gabriel Gambetta <mystml>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: major    
Priority: P1    
Version: HG 1.2   
Hardware: x86   
OS: Windows (All)   
Attachments: Working but probably non-elegant patch

Description Gabriel Gambetta 2009-11-04 04:51:46 UTC
If you change the video mode while holding the mouse button down, and then click on the window, you can't move the mouse pointer over the title bar or the close window button.

It turns out WinMessage in SDL_Sysevents.c is using a static int mouse_pressed to keep track of whether it should call SetCapture() and ReleaseCapture(). Since it's static and initialized only once, it isn't cleared when the video mode changed, so there's a kind of one-off error and SetCapture() and ReleaseCapture() aren't being called when they should.

Here's a patch - I just made that int accessible from the outside and reset it to 0 in SDL_SetVideoMode, wrapped in #ifdef WIN32. Suggestions on how to make this more elegant are welcome.
Comment 1 Gabriel Gambetta 2009-11-04 04:52:39 UTC
Created attachment 443 [details]
Working but probably non-elegant patch
Comment 2 Sam Lantinga 2009-11-04 16:04:59 UTC
Yes, working but definitely not elegant.

Thanks! :)
Comment 3 Ryan C. Gordon 2011-12-30 01:25:52 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:23:32 UTC
This is fixed, thanks!
http://hg.libsdl.org/SDL/rev/760a3162e180