SDL_MOUSEMOTION event bug in Windows but not Linux

In my main event loop, my program uses SDL_PollEvent() and if there are
device input event types, it sends it back as a new event with
SDL_PushEvent(). Later, the input handling sections of my code picks up
any input events and uses them accordingly–the keyboard section
SDL_PeepEvents() keyboard events, then the mouse section does the same,
and then joystick.

I know this setup is bad, if for instance, the user is pounding away at
the keyboard, but the keyboard handling code isn’t being called. And
thus, none of the keyboard events are being processed.

Here’s the problem though: After a couple mouse movements typically the
program continues but no more mouse events are registered. If I stop
moving the mouse, wait, and move it again, usually it will register some
more but even sooner stall again. I ALSO noticed that pressing or just
holding down a mouse button while moving the mouse prevents the stalling
entirely. But I highly doubt anyone would want to use my program if
they had to hold down a mouse button the whole time :).

Anyhow, this only does this in Windows and not Linux. I haven’t had the
chance to test in Mac OSX. I compile with gcc-3.4 (on both Windows and
Linux). I’ve tried the Windows binary on two different WinXP systems.
I thought I was all up to date on my SDL drivers, but looking at the SDL
website I notice version 1.2.12, whereas I was running 1.2.11. I run
KUbuntu Feisty (libsdl currently at 1.2.11).

As a side note, I notice similar event catching problems with joysticks
in Linux BUT not in Windows. Also, running my program in WINE produces
the same effects as though I was natively in Windows.

Any suggestions guys?

Mouse motion tends to generate lots of events. Your event queue is
probably full (SDL_PushEvent should return an error in this case).

Perhaps you should change your setup, seeing as you acknowledge that
it is bad =)

Adding a callback feature that calls various functions depending on
the event type would probably not be too difficult, depending on your
programs current structure.

If you need help can we take a look at your current input code?

HTH.