Yes, this happens to me too on Mac OS X. A workaround is to defer window destruction until a mouse release event, instead of doing it immediately on a mouse press. It might not be a bad idea to do that even without this bug.On 2013-08-18, at 5:32 PM, Jonas Thiem wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Please read the bug report carefully, it has detailed instructions for reproducing the bug including demonstration code. Compile and test for yourself to verify: the events lost are clicks happening in the newly created window, at a point where creation is clearly finished and those events should be received again (you can wait various seconds, it won’t change a thing).
The culprit is most likely SDL remembering the mouse being pressed down in the old window, but if you destroy the window while the mouse is pressed down and then create a new window (and release the mouse after destroying the old, but before creating the new one), SDL will still think the mouse is pressed down and subsequently lose/drop the first legitimate mouse down event in the new window, breaking the first mouse click.
Now you might think releasing the mouse exactly between destroying the old window and creating the new one can’t happen accidentally, but in fact it does happen quite easily if the destroy window & recreate happens in a mouse down event.
On 08/18/2013 06:37 PM, Sparks wrote:
Why is this a bug with SDL ?
> If you close the window, and their isn't another window
available, then the events should be dropped. SDL has no reason to
keep them in memory, and it has no idea you are going to open a
new window again.
>
> I assume you close/open the window when they change
resolution or something like that?
> Why don't you make a hidden window, in addition to the other
window you are closing/re-opening. and then, you shouldn't lose
any events, and you can queue them up.
>
>
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (GNU/Linux)
iQIcBAEBAgAGBQJSES9eAAoJECgTcNPC9Cd0vGkQAJ/QFE32pLBBqMfAMK2Qrw8l
gFW+yKoIRtLsAWdmbY/RbtURl+o24GcGZyYJnykuOTq9H7HHggiFV9CDXjBn5ejj
lPuf82mi1en/mqQePQ2LDSGVks03UiC6xg/J+yfdxcjgxUjmYAAaV4eowmJmgyji
eM26zZ71FxDA9cruO++EhCJbA3KvGJWJ9qf+/xvXbwWY5KjIWkOwoKZ956q9u17Y
Ilz/+MEz4ENLbneI2+GnthIjftf5L3iFCjhiUvlvSYtPC8UCSFOtjpuULrgLbsLm
7ioMLc98jE0lISWehzU1/OF/G6uFTWfmMK2mu5Sr8tYzUpQZGA1ouLacUmejayjy
w7ArA44Ov/FMUBb3KqmwBX81zedthHaiHB/fsbTvvGkv6UAnXHWG0GW9NG/mmaz+
FETtYYFC1MtoFKqEjDNxznRWzVvE/WA0BWiAGvDeDSkI8/BRvolxvG7/UpSb7xkY
N/rHCOa40JA+kLi3n5kpE8g24Lk6zv8FzqaItnnQXdRX2aF4ls4zaOBggZTDsmRG
p0iUzBF4zRga/Ju95qiF6/+SnH+e0Rsk+Rgr/0K40p5Fx8NXJaMVarPf83AUNyvv
YXB2OZsU7b9oTwmKBBYuM7VC5sxmFhG2reTbVFjVLXldN/Mih3TVlF+kiCq/IWXk
jxqgf59CRM/7qQx/YOBZ
=Zb6f
-----END PGP SIGNATURE-----
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org