[SDL] SDL_MOUSEMOTION event bug in Windows but not Linux

Andrew Dieffenbach puzzud at gmail.com
Sun Aug 12 15:47:48 PDT 2007


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?



More information about the SDL mailing list