Possible bug in SDL 1.2.14 when using SDL_VIDEO_CENTERED

This is in reference to my emails on mouse motion being clipped in OpenGL
mode. Attached is a test program that shows the problem in OpenGL mode in
Linux.

Run the program, and hover the mouse around the bottom-left corner. It
should indicate motion up to 639x479. Then press the ‘2’ key, which
switches to 640x420. Again, hover around the corner, and notice motion up
to 639x419. Finally, press the ‘3’ key, which switches back to 640x480.
However, now the bottom corner only registers up to 639x419, even though
the screen size is 640x480.

I’ve determined this to be a result of an extra ConfigureNotify event
being generated, possibly by the SDL_VIDEO_CENTERED environment variable.
This is only seen in SDL 1.2.14, since a new SetMouseRange() function
clips the range to the previous window size, which when smaller than the
current one is causing the problem.

I’m not sure how to work around this, other than to disable
SDL_VIDEO_CENTERED in my app. But that’s not an ideal solution, since the
user can also set it.

Any feedback is appreciated,
SA
-------------- next part --------------
A non-text attachment was scrubbed…
Name: sdlmouse.c
Type: text/x-csrc
Size: 1740 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20100730/4056bad6/attachment.c