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 661 - Resize event overflowing the event queue
Summary: Resize event overflowing the event queue
Status: RESOLVED INVALID
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: 2.0.0
Hardware: x86 Windows Vista
: P2 major
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-01 14:50 UTC by Will
Modified: 2009-01-03 12:33 UTC (History)
0 users

See Also:


Attachments
A patch (435 bytes, patch)
2009-01-01 19:57 UTC, Will
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Will 2009-01-01 14:50:05 UTC
I noticed that when I resize a window that resize events don't get reported until I release the mouse (It should be reported as I'm resizing). When this happens I receive all the resize events stored in the queue but miss the ones that were generated after the queue was full. By the way this is a window with OpenGL enabled (I didn't get the chance to test a regular window yet)

Thanks
  --Bill
Comment 1 Will 2009-01-01 19:57:19 UTC
Created attachment 287 [details]
A patch

This patch fixes this bug by removing unnecessary window resize events.
Comment 2 Will 2009-01-01 20:03:42 UTC
I added a patch based on how SDL-1.2 handles the issue in "SDL_resize.c" line #58:

	/* Pull out all old resize events */
	SDL_PeepEvents(events, sizeof(events)/sizeof(events[0]),
		SDL_GETEVENT, SDL_VIDEORESIZEMASK);

Due to changes in SDL-1.3 "SDL_FilterEvents()" is used instead.
Comment 3 Will 2009-01-01 20:53:21 UTC
(In reply to comment #1)
> Created an attachment (id=287) [details]
> A patch
> 
> This patch fixes this bug by removing unnecessary window resize events.
> 

Ah crud, My patch somehow kills mouse events.

DO NOT APPLY THIS PATCH!
Comment 4 Will 2009-01-01 21:35:08 UTC
(In reply to comment #3)
> Ah crud, My patch somehow kills mouse events.
> 
> DO NOT APPLY THIS PATCH!
> 

Man I must be having a bad night!

Short version:
The patch that I thought was bad is probably fine (please test it!)

Long version:
OK so it turns out that I have the same problem before the patch is applied. Given that I was using the official build before my patched version, the problem is probably in my MinGW/MSYS build environment. So the mouse problem was not caused by the patch and it should be fine!

Sorry about that and all these self reply's and thanks!
    --Bill
Comment 5 Will 2009-01-01 21:48:04 UTC
(In reply to comment #1)
> Created an attachment (id=287) [details]
> A patch
> 
> This patch fixes this bug by removing unnecessary window resize events.
> 

Whoops, the file to be patched is src/video/win32/SDL_win32events.c
Comment 6 Will 2009-01-03 12:31:34 UTC
This bug is now bug #666