Problem with creating multiple windows in SDL 1.3

If you create a window (#1) in SDL 1.3, then create a new window (#2) later on, then destroy window #2. Window #1 stops responding to mouse events. It appear that this is because SDL re-registers with RegisterRawInputDevices on every window create, which causes #2 to get the inputs (which no longer exists). Does this seem right? If so, should it only do RegisterRawInputDevices on the first window created, or maybe even re-register on a destroy window with another window ID that actually exists?

mike

2009/11/1 mweber26 :

If you create a window (#1) in SDL 1.3, then create a new window (#2) later
on, then destroy window #2. Window #1 stops responding to mouse events. It
appear that this is because SDL re-registers with RegisterRawInputDevices on
every window create, which causes #2 to get the inputs (which no longer
exists). Does this seem right? If so, should it only do
RegisterRawInputDevices on the first window created, or maybe even
re-register on a destroy window with another window ID that actually exists?

Actually, every window that registers with RegisterRawInputDevices
receives notifications, not just one at a time. If you’re getting
errors like that, it’s probably from some other cause. If the window
is not in focus, then depending on what flags you set when calling
RegisterRawInputDevices, you may not receive input notifications
though.

I’ve entered a bug for this in bugzilla:
http://bugzilla.libsdl.org/show_bug.cgi?id=879On Sun, Nov 1, 2009 at 1:26 PM, mweber26 wrote:

If you create a window (#1) in SDL 1.3, then create a new window (#2) later
on, then destroy window #2. Window #1 stops responding to mouse events. It
appear that this is because SDL re-registers with RegisterRawInputDevices on
every window create, which causes #2 to get the inputs (which no longer
exists). Does this seem right? If so, should it only do
RegisterRawInputDevices on the first window created, or maybe even
re-register on a destroy window with another window ID that actually exists?

mike


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


-Sam Lantinga, Founder and President, Galaxy Gameworks LLC