Sat, 20 Dec 2014 11:45:39 -0500Partial fix for bug 2726 - Win32 'mouse' events not applying 'SDL_TOUCH_MOUSEID'
David Ludwig <dludwig@pobox.com> [Sat, 20 Dec 2014 11:45:39 -0500] rev 9668
Partial fix for bug 2726 - Win32 'mouse' events not applying 'SDL_TOUCH_MOUSEID'

This is a Win32-specific fix for bug 2726. A WinRT fix for this bug was applied
separately, via https://hg.libsdl.org/SDL/rev/bea2e725e29a

This fix applies SDL_TOUCH_MOUSEID to 'mouse' events coming from touch devices,
but only when relative-mouse-mode is turned OFF. This bug is still present
when relative-mouse-mode is ON, however Microsoft does not provide documentation
on whether or not those input events (which come from WM_INPUT) can be
identified as touch-specific or not. Unofficially, that data might be available
(via GetMessageExtraInfo()), however this patch only uses MS-documented APIs.

Thu, 28 May 2015 09:52:48 -0700Fixed X11 build, added code to print initial modifiers to checkkeys
Sam Lantinga <slouken@libsdl.org> [Thu, 28 May 2015 09:52:48 -0700] rev 9667
Fixed X11 build, added code to print initial modifiers to checkkeys

Thu, 28 May 2015 09:33:47 -0700Fixed bug 2736 - X11 doesn't set KMOD_NUM and KMOD_CAPS to system state
Sam Lantinga <slouken@libsdl.org> [Thu, 28 May 2015 09:33:47 -0700] rev 9666
Fixed bug 2736 - X11 doesn't set KMOD_NUM and KMOD_CAPS to system state

Zack Middleton

Using X11 (on Debian Wheezy), SDL_GetModState() & KMOD_NUM and KMOD_CAPS are not set to system state (numlock/capslock LEDs). Pressing numlock or capslock toggles the mod state, though if num/caps lock is enabled before starting the program it's still reversed from system state. This makes getting KMOD_NUM and KMOD_CAPS in programs unreliable. This can be seen using the checkkeys test program.

The function that appears to have handle this in SDL 1.2 is X11_SetKeyboardState. The function call is commented out with "FIXME:" in SDL 2.

Using Windows backend through WINE; on first key press if numlock and/or capslock is enabled on system, numlock/capslock SDL_SendKeyboardKey is run and toggles KMOD_NUM/KMOD_CAPS to the correct state. On X11 this does not happen.

The attached patch makes X11 backend set keyboard state on window focus if no window was previously focused. It sets all keys to system up/down state and toggles KMOD_NUM/KMOD_CAPS via SDL_SendKeyboardKey to match system if needed. The patch is based on SDL 1.2's X11_SetKeyboardState.

Thu, 28 May 2015 08:51:59 -0700Fixed Windows build
Sam Lantinga <slouken@libsdl.org> [Thu, 28 May 2015 08:51:59 -0700] rev 9665
Fixed Windows build

Thu, 28 May 2015 08:41:07 -0700Fixed bug 2860 - SetProp must be paired with RemoveProp especially for properties added to external windows
Sam Lantinga <slouken@libsdl.org> [Thu, 28 May 2015 08:41:07 -0700] rev 9664
Fixed bug 2860 - SetProp must be paired with RemoveProp especially for properties added to external windows

Coriiander

Upon creating a window, a window property is added to it through the Win32-function "SetProp". This is done in the SDL-function "SetupWindowData" in file "src\video\windows\SDL_windowswindow.c".

Whenever you call "SetProp" to add a property to a Win32-window, you should also call the Win32-function "RemoveProp" to remove it before destroying that Win32-window.

While you might think that it's ok and that Windows will clean up nicely itself, it is not ok. It is against all Win32-API guidelines and is mostlikely a leak. Especially on external windows (CreateWindowFrom) you want to have things done right, not messy and leaky, affecting some other module. Even if SDL gets shutdown entirely that external window will now forever still have the "SDL_WindowData" prop attached to it.

Thu, 28 May 2015 01:27:24 -0400I think this will be the time...
Ryan C. Gordon <icculus@icculus.org> [Thu, 28 May 2015 01:27:24 -0400] rev 9663
I think this will be the time...

Thu, 28 May 2015 01:22:14 -0400Still trying to get this to compile...
Ryan C. Gordon <icculus@icculus.org> [Thu, 28 May 2015 01:22:14 -0400] rev 9662
Still trying to get this to compile...

Thu, 28 May 2015 01:16:55 -0400More patching to compile...
Ryan C. Gordon <icculus@icculus.org> [Thu, 28 May 2015 01:16:55 -0400] rev 9661
More patching to compile...

Thu, 28 May 2015 01:08:33 -0400Another attempt to get this to compile.
Ryan C. Gordon <icculus@icculus.org> [Thu, 28 May 2015 01:08:33 -0400] rev 9660
Another attempt to get this to compile.

Thu, 28 May 2015 01:02:03 -0400Patched to compile on MingW.
Ryan C. Gordon <icculus@icculus.org> [Thu, 28 May 2015 01:02:03 -0400] rev 9659
Patched to compile on MingW.

(I think!)