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 3528 - SDL_WINDOWEVENT_LEAVE event is repeated continously
Summary: SDL_WINDOWEVENT_LEAVE event is repeated continously
Status: RESOLVED INVALID
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: 2.0.5
Hardware: x86_64 Windows 8
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-18 15:46 UTC by axel mattauch
Modified: 2016-12-23 01:02 UTC (History)
1 user (show)

See Also:


Attachments
Simple test program to understow the window events in SDL2 (3.85 KB, text/x-csrc)
2016-12-18 15:46 UTC, axel mattauch
Details

Note You need to log in before you can comment on or make changes to this bug.
Description axel mattauch 2016-12-18 15:46:46 UTC
Created attachment 2654 [details]
Simple test program to understow the window events in SDL2

See simple test program attached 
(derivated from http://wiki.libsdl.org/SDL_WindowEvent?highlight=%28%5CbCategoryStruct%5Cb%29%7C%28CategoryEvents%29 )

After moving the mouse inside the window one single  SDL_WINDOWEVENT_ENTER is issued, but moving then the mouse outside the window lead to repetitive SDL_WINDOWEVENT_LEAVE events, even if the mouse is steady.
Comment 1 Philipp Wiesemann 2016-12-21 19:41:02 UTC
In the attached test program, the return value of SDL_PollEvent() is not checked to see if there is a new event at all. This might lead to processing the same event several times.
Comment 2 axel mattauch 2016-12-22 13:55:10 UTC
The use of the int return value is clearly indicated in the Wiki.
I understood falsely that a NULL event is 'no more event'.
Bug is in my test program.

I apologize for the disturbance.
Comment 3 Sam Lantinga 2016-12-23 01:02:40 UTC
No worries, I'm glad you figured it out.