Tue, 12 Apr 2016 10:45:56 -0400Force WM_PAINT events on window resize
Ethan Lee [Tue, 12 Apr 2016 10:45:56 -0400] rev 10417
Force WM_PAINT events on window resize

Sat, 01 Oct 2016 12:43:14 -0700Fixed bug 3318 - testime.c enhancement with GNU Unifont support
Sam Lantinga [Sat, 01 Oct 2016 12:43:14 -0700] rev 10416
Fixed bug 3318 - testime.c enhancement with GNU Unifont support

Simon Hug

I'm proposing some changes to the IME test program test/testime.c. The patch includes support for the GNU Unifont hex file, making the SDL_ttf dependency optional. There were also one or two bugs that prevented the text and underline from showing up poperly.

Sat, 01 Oct 2016 12:33:26 -0700Fixed bug 3319 - Getting the POSIX out of testqsort.c
Sam Lantinga [Sat, 01 Oct 2016 12:33:26 -0700] rev 10415
Fixed bug 3319 - Getting the POSIX out of testqsort.c

Simon Hug

There's a call to the POSIX function random in test/testqsort.c. Naturally, Windows doesn't do that. The attached patch changes the call to the SDLtest framework random functions and adds some seed control.

Looking at SDLTest_RandomInitTime, I just want to say that 'srand((unsigned int)time(NULL)); a=rand(); srand(clock()); b=rand();' is an absolutely terrible way to initialize a seed on Windows because of its terrible LCG.

Sat, 01 Oct 2016 12:31:31 -0700Fixed bug 3320 - SDL_windows_main.c defines both console application entry points
Sam Lantinga [Sat, 01 Oct 2016 12:31:31 -0700] rev 10414
Fixed bug 3320 - SDL_windows_main.c defines both console application entry points

Simon Hug

The SDLmain file src/main/windows/SDL_windows_main.c defines both entry points for console applications, main and wmain. This seems to confuse MSVC. It outputs a LNK4067 warning and then chooses main, which is a shame because only wmain has the unicode handling. Using SDLmain.lib provided on libsdl.org, the linker also goes for main.

I'm proposing to not define the main entry point at all. wmain should be supported well enough with MSVC.

Sat, 01 Oct 2016 12:29:55 -0700Fixed bug 3322 - Missing error checking in testaudioinfo and testaudiohotplug
Sam Lantinga [Sat, 01 Oct 2016 12:29:55 -0700] rev 10413
Fixed bug 3322 - Missing error checking in testaudioinfo and testaudiohotplug

Simon Hug

The two tests test/testaudioinfo.c and test/testaudiohotplug.c are missing error checking when they call SDL_GetAudioDeviceName. This function can return NULL which the tests pass straight to SDL_Log.

Sat, 01 Oct 2016 12:28:05 -0700Fixed bug 3323 - SDL_LogOutput prints message twice on Windows when linked with libc
Sam Lantinga [Sat, 01 Oct 2016 12:28:05 -0700] rev 10412
Fixed bug 3323 - SDL_LogOutput prints message twice on Windows when linked with libc

Simon Hug

If SDL2 is compiled with HAVE_LIBC on Windows, the SDL_LogOutput function has two ways of printing a message. WriteConsole and fprintf.

Sat, 01 Oct 2016 12:17:42 -0700Reset dead keys when the SDL window loses focus, so dead keys pressed in SDL applications don't affect text input into other applications.
Sam Lantinga [Sat, 01 Oct 2016 12:17:42 -0700] rev 10411
Reset dead keys when the SDL window loses focus, so dead keys pressed in SDL applications don't affect text input into other applications.

Sat, 01 Oct 2016 11:54:02 -0700Fixed bug 3332 - Win32: reset deadkeys in StartTextInput/StopTextInput
Sam Lantinga [Sat, 01 Oct 2016 11:54:02 -0700] rev 10410
Fixed bug 3332 - Win32: reset deadkeys in StartTextInput/StopTextInput

Eric Wasylishen

The bug here is that a dead keys pressed before calling SDL_StartTextInput() carries over into future text input, so the next key pressed will have the deadkey applied to it.

This in undesirable, imho, and doesn't occur on OS X (haven't check Linux or elsewhere). It's causing a problem for Quakespasm on German keyboard layouts, where we use the ^ deadkey to toggle the console (which enables/disables text input), and ^ characters are showing up in the TEXTINPUT events.

Sat, 01 Oct 2016 11:48:15 -0700Fixed bug 3338 - console_wmain doesn't null terminate the argv array
Sam Lantinga [Sat, 01 Oct 2016 11:48:15 -0700] rev 10409
Fixed bug 3338 - console_wmain doesn't null terminate the argv array

Simon Hug

The function console_wmain in src/main/windows/SDL_windows_main.c does not null terminate the argument list it is creating. As specified by the C standard, "argv[argc] shall be a null pointer."

The SDLTest framework makes use of that null pointer and some test programs can cause an access violation because it's missing.

Sat, 01 Oct 2016 11:46:32 -0700Fixed bug 3345 - SDL_RenderClear inconsistency with ClipRect
Sam Lantinga [Sat, 01 Oct 2016 11:46:32 -0700] rev 10408
Fixed bug 3345 - SDL_RenderClear inconsistency with ClipRect

Simon Hug

The description of the SDL_RenderClear function in the SDL_render.h header says the following:

"This function clears the entire rendering target, ignoring the viewport."

The word "entire" implies that the clipping rectangle set with SDL_RenderSetClipRect also gets ignored. This is left somewhat ambiguous if only the viewport is mentioned. Minor thing, but let's see what the implementations actually do.

The software renderer ignores the clipping rectangle when clearing. It even has a comment on this: /* By definition the clear ignores the clip rect */

Most other render drivers (opengl, opengles, opengles2, direct3d, and psp [I assume. Can't test it.]) use the scissor test for the ClipRect and don't disable it when clearing. Clearing will only happen within the clipping rectangle for these drivers.

An exception is direct3d11 which uses a clear function that ignores the scissor test.