Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDL_FlushEvent(SDL_MOUSEMOTION) not removing events added by SDL_WarpMouseInWindow() #1328

Closed
SDLBugzilla opened this issue Feb 10, 2021 · 0 comments
Labels
invalid This doesn't seem right

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

Reported in version: 2.0.1
Reported for operating system, platform: FreeBSD, x86_64

Comments on the original bug report:

On 2014-01-27 17:31:18 +0000, Yamagi wrote:

Hi,
I noticed that I'm unable to flush SDL_MOUSEMOTION events added by SDL_WarpMouseInWindow(). Consider this code:

SDL_WarpMouseInWindow(NULL, xcenter, ycenter);
SDL_PumpEvents();
SDL_FlushEvent(SDL_MOUSEMOTION);

=> The events are still there, read from the queue next time when events are processed. I can reproduce this with SDL 2.0.1 on FreeBSD and Windows.

On 2014-01-27 20:54:22 +0000, Gabriel Jacobo wrote:

I couldn't reproduce this, I traced through SDL_FlushEvent and the SDL_MOUSEMOTION are correctly removed from the queue (Linux/X11 but the verification I made should be valid anyway).

You may be getting new motion events after calling SDL_FlushEvent because when you call SDL_PollEvent that in turn calls SDL_PumpEvents which can put new SDL_MOUSEMOTION events in the queue.

Anyway, I'm marking as invalid for now but feel free to re open if you have a test case that can reproduce this. You can also verify by logging the value of SDL_EventQ.count before and after SDL_FlushEvent does its work and see what you get.

@SDLBugzilla SDLBugzilla added bug invalid This doesn't seem right labels Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

1 participant