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 - Title bar unresponsive after video mode change
Summary: Title bar unresponsive after video mode change
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 1.2
Hardware: x86 Windows (All)
: P1 major
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-04 04:51 UTC by Gabriel Gambetta
Modified: 2011-12-30 03:23 UTC (History)
0 users

See Also:


Attachments
Working but probably non-elegant patch (1.80 KB, patch)
2009-11-04 04:52 UTC, Gabriel Gambetta
Details | Diff

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