Fri, 29 May 2020 21:26:32 -0700Fixed bug 5113 - SDL_UpdateWindowSurfaceRects BitBlt the entire surface on Win32 default tip
Sam Lantinga <slouken@libsdl.org> [Fri, 29 May 2020 21:26:32 -0700] rev 13884
Fixed bug 5113 - SDL_UpdateWindowSurfaceRects BitBlt the entire surface on Win32

Ryan C. Gordon

As discussed here:
https://discourse.libsdl.org/t/question-about-implementation-of-sdl-updatewindowsurfacerects/27561

"As you can see this function [WIN_UpdateWindowFramebuffer, in src/video/windows/SDL_windowsframebuffer.c] calls BitBlt on entire screen, even though it accepts the rects. Rects variable is not even used in this function at all. Now my question is why is that the case?"

Fri, 29 May 2020 21:22:11 -0700Fixed bug 5155 - HIDAPI_JoystickDisconnected incorrect array shift
Sam Lantinga <slouken@libsdl.org> [Fri, 29 May 2020 21:22:11 -0700] rev 13883
Fixed bug 5155 - HIDAPI_JoystickDisconnected incorrect array shift

Anthony Pesch

I was looking into my own input bug and noticed an issue in the HIDAPI code while looking over it. I don't have a controller that goes down this path to test and try to provoke the issue, but it looks pretty straight forward.

The memmove to shift the joystick id array on disconnect isn't scaling the size by sizeof(SDL_JoystickID), likely corrupting the ids on disconnect.

Fri, 29 May 2020 16:31:05 -0700Fixed bug 5105 - sndio support not working in dynamic mode (dlopen)
Sam Lantinga <slouken@libsdl.org> [Fri, 29 May 2020 16:31:05 -0700] rev 13882
Fixed bug 5105 - sndio support not working in dynamic mode (dlopen)

Giovanni Bajo

The CMake build system supports several audio frameworks for Linux: one of them is sndio.

All frameworks can be built with "runtime linking" (that is, using dlopen to load the library at runtime). In sdlchecks.cmake, there's code to do the same with sndio:

=================================================================
# Requires:
# - n/a
# Optional:
# - SNDIO_SHARED opt
# - HAVE_DLOPEN opt
macro(CheckSNDIO)
if(SNDIO)
# TODO: set include paths properly, so the sndio headers are found
check_include_file(sndio.h HAVE_SNDIO_H)
find_library(D_SNDIO_LIB sndio)
if(HAVE_SNDIO_H AND D_SNDIO_LIB)
set(HAVE_SNDIO TRUE)
file(GLOB SNDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/sndio/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${SNDIO_SOURCES})
set(SDL_AUDIO_DRIVER_SNDIO 1)
if(SNDIO_SHARED)
if(NOT HAVE_DLOPEN)
message_warn("You must have SDL_LoadObject() support for dynamic sndio loading")
else()
FindLibraryAndSONAME("sndio")
set(SDL_AUDIO_DRIVER_SNDIO_DYNAMIC "\"${SNDIO_LIB_SONAME}\"")
set(HAVE_SNDIO_SHARED TRUE)
endif()
else()
list(APPEND EXTRA_LIBS ${D_SNDIO_LIB})
endif()
set(HAVE_SDL_AUDIO TRUE)
endif()
endif()
endmacro()
=================================================================

The feature is gated by an option called SNDIO_SHARED. It is also fully implemented in SDL_sndioaudio.c

Unfortunately, it seems there is a missing line in CMakeLists.txt, so SNDIO_SHARED is not defined:

======================================================================
set_option(ALSA "Support the ALSA audio API" ${UNIX_SYS})
dep_option(ALSA_SHARED "Dynamically load ALSA audio support" ON "ALSA" OFF)
set_option(JACK "Support the JACK audio API" ${UNIX_SYS})
dep_option(JACK_SHARED "Dynamically load JACK audio support" ON "JACK" OFF)
set_option(ESD "Support the Enlightened Sound Daemon" ${UNIX_SYS})
dep_option(ESD_SHARED "Dynamically load ESD audio support" ON "ESD" OFF)
set_option(PULSEAUDIO "Use PulseAudio" ${UNIX_SYS})
dep_option(PULSEAUDIO_SHARED "Dynamically load PulseAudio support" ON "PULSEAUDIO" OFF)
set_option(ARTS "Support the Analog Real Time Synthesizer" ${UNIX_SYS})
dep_option(ARTS_SHARED "Dynamically load aRts audio support" ON "ARTS" OFF)
set_option(NAS "Support the NAS audio API" ${UNIX_SYS})
set_option(NAS_SHARED "Dynamically load NAS audio API" ${UNIX_SYS})
set_option(SNDIO "Support the sndio audio API" ${UNIX_SYS})
set_option(FUSIONSOUND "Use FusionSound audio driver" OFF)
dep_option(FUSIONSOUND_SHARED "Dynamically load fusionsound audio support" ON "FUSIONSOUND" OFF)
======================================================================

You can see that all frameworks define a "dep_option" NAME_SHARED, and SNDIO is the only one where the option is missing.

This means that runtime loading of sndio is never activated. If sndio is found at configuration time, it is always activated in "linked" mode, so that the final binary will have a load-time dependency with libsdnio. This is unfortunate.

To fix the problem, it is sufficient to add this line:

dep_option(SNDIO_SHARED "Dynamically load the sndio audio API" ${UNIX_SYS} ON "SNDIO" OFF)

I've verified that this fixes the bug, and sndio can now be dynamically loaded as expected.

Fri, 29 May 2020 16:28:56 -0700Fixed bug 5145 - Fix whitespace in SDL_vulkan.h
Sam Lantinga <slouken@libsdl.org> [Fri, 29 May 2020 16:28:56 -0700] rev 13881
Fixed bug 5145 - Fix whitespace in SDL_vulkan.h

Colin Caine

Everywhere else seems to use spaces.

See patch diffed from a fresh hg checkout yesterday.

Mon, 25 May 2020 20:55:29 -0700cocoa: Change Caps Lock behavior to toggle instead of locking
Cameron Gutman <aicommander@gmail.com> [Mon, 25 May 2020 20:55:29 -0700] rev 13880
cocoa: Change Caps Lock behavior to toggle instead of locking

It currently behaves like a locking key which is pressed
when Caps Lock is enabled and released when disabled. This
means that apps that trigger events on Caps Lock key down will
only fire these events every other time Caps Lock is pressed.

Fri, 29 May 2020 16:02:49 -0700Fixed bug 5146 - SDL_RenderFillRect doesn't work in DirectFB
Sam Lantinga <slouken@libsdl.org> [Fri, 29 May 2020 16:02:49 -0700] rev 13879
Fixed bug 5146 - SDL_RenderFillRect doesn't work in DirectFB

Lacky

It looks like refactoring of SDL2 internal API has broken SDL_RenderFillRect for DirectFB. In new version function SDL_RenderFillRect returns 0, but rectangle is not visible.

Replacing "count" with "len" in the argument list for SDL_memcpy in DirectFB_QueueFillRects fixes problem.

Thu, 21 May 2020 00:06:09 -0400wayland: update pointer position on initial enter event
Tudor Brindus <me@tbrindus.ca> [Thu, 21 May 2020 00:06:09 -0400] rev 13878
wayland: update pointer position on initial enter event

Fri, 29 May 2020 15:40:17 -0700Don't bother logging security exception getting the device serial number
Sam Lantinga <slouken@libsdl.org> [Fri, 29 May 2020 15:40:17 -0700] rev 13877
Don't bother logging security exception getting the device serial number

This can happen anytime we haven't opened the device yet

Fri, 29 May 2020 15:37:03 -0700- Added exception handler for the new SecurityException in USBDevice getSerialNumber
Sockmonsters <sdlbugs@sockmonsters.com> [Fri, 29 May 2020 15:37:03 -0700] rev 13876
- Added exception handler for the new SecurityException in USBDevice getSerialNumber

Fri, 29 May 2020 14:54:07 -0700The zero happens at a higher level now
Sam Lantinga <slouken@libsdl.org> [Fri, 29 May 2020 14:54:07 -0700] rev 13875
The zero happens at a higher level now