Skip to content

Commit

Permalink
Merge commit '07d0f51fa292895443f563f0cbde4cb3802d87fa'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sibras committed Mar 11, 2023
2 parents c66f568 + 07d0f51 commit 4cd56e0
Show file tree
Hide file tree
Showing 16 changed files with 86 additions and 90 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ jobs:
if: runner.os == 'macOS'
run: |
brew install \
ninja
ninja \
pkg-config
- uses: actions/checkout@v3
- name: Check that versioning is consistent
# We only need to run this once: arbitrarily use the Linux/CMake build
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ endif()
# See docs/release_checklist.md
set(SDL_MAJOR_VERSION 2)
set(SDL_MINOR_VERSION 26)
set(SDL_MICRO_VERSION 3)
set(SDL_MICRO_VERSION 4)
set(SDL_VERSION "${SDL_MAJOR_VERSION}.${SDL_MINOR_VERSION}.${SDL_MICRO_VERSION}")

# Set defaults preventing destination file conflicts
Expand Down
2 changes: 1 addition & 1 deletion Makefile.os2
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
LIBNAME = SDL2
MAJOR_VERSION = 2
MINOR_VERSION = 26
MICRO_VERSION = 3
MICRO_VERSION = 4
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)
DESCRIPTION = Simple DirectMedia Layer 2

Expand Down
2 changes: 1 addition & 1 deletion Makefile.w32
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
LIBNAME = SDL2
MAJOR_VERSION = 2
MINOR_VERSION = 26
MICRO_VERSION = 3
MICRO_VERSION = 4
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)

LIBHOME = .
Expand Down
4 changes: 2 additions & 2 deletions Xcode/SDL/Info-Framework.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.26.3</string>
<string>2.26.4</string>
<key>CFBundleSignature</key>
<string>SDLX</string>
<key>CFBundleVersion</key>
<string>2.26.3</string>
<string>2.26.4</string>
</dict>
</plist>
8 changes: 4 additions & 4 deletions Xcode/SDL/SDL.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9529,7 +9529,7 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEPLOYMENT_POSTPROCESSING = YES;
DYLIB_COMPATIBILITY_VERSION = 2601.0.0;
DYLIB_CURRENT_VERSION = 2601.3.0;
DYLIB_CURRENT_VERSION = 2601.4.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_ALTIVEC_EXTENSIONS = YES;
Expand Down Expand Up @@ -9614,7 +9614,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
DYLIB_COMPATIBILITY_VERSION = 2601.0.0;
DYLIB_CURRENT_VERSION = 2601.3.0;
DYLIB_CURRENT_VERSION = 2601.4.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
Expand Down Expand Up @@ -9863,7 +9863,7 @@
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 2601.0.0;
DYLIB_CURRENT_VERSION = 2601.3.0;
DYLIB_CURRENT_VERSION = 2601.4.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
Expand Down Expand Up @@ -9915,7 +9915,7 @@
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 2601.0.0;
DYLIB_CURRENT_VERSION = 2601.3.0;
DYLIB_CURRENT_VERSION = 2601.4.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_NS_ASSERTIONS = NO;
GCC_C_LANGUAGE_STANDARD = gnu11;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
private static final String TAG = "SDL";
private static final int SDL_MAJOR_VERSION = 2;
private static final int SDL_MINOR_VERSION = 26;
private static final int SDL_MICRO_VERSION = 3;
private static final int SDL_MICRO_VERSION = 4;
/*
// Display InputType.SOURCE/CLASS of events and devices
//
Expand Down
6 changes: 5 additions & 1 deletion cmake/sdlchecks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,11 @@ macro(CheckPTHREAD)
check_c_source_compiles("
#include <pthread.h>
int main(int argc, char **argv) {
pthread_setname_np(pthread_self(), \"\");
#ifdef __APPLE__
pthread_setname_np(\"\");
#else
pthread_setname_np(pthread_self(),\"\");
#endif
return 0;
}" HAVE_PTHREAD_SETNAME_NP)
if (HAVE_PTHREAD_NP_H)
Expand Down
2 changes: 1 addition & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -3454,7 +3454,7 @@ orig_CFLAGS="$CFLAGS"
# See docs/release_checklist.md
SDL_MAJOR_VERSION=2
SDL_MINOR_VERSION=26
SDL_MICRO_VERSION=3
SDL_MICRO_VERSION=4
SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION

SDL_BINARY_AGE=`expr $SDL_MINOR_VERSION \* 100 + $SDL_MICRO_VERSION`
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dnl Set various version strings - taken gratefully from the GTk sources
# See docs/release_checklist.md
SDL_MAJOR_VERSION=2
SDL_MINOR_VERSION=26
SDL_MICRO_VERSION=3
SDL_MICRO_VERSION=4
SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION

SDL_BINARY_AGE=`expr $SDL_MINOR_VERSION \* 100 + $SDL_MICRO_VERSION`
Expand Down
2 changes: 1 addition & 1 deletion include/SDL_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ typedef struct SDL_version
*/
#define SDL_MAJOR_VERSION 2
#define SDL_MINOR_VERSION 26
#define SDL_PATCHLEVEL 3
#define SDL_PATCHLEVEL 4

/**
* Macro to determine SDL version program was compiled against.
Expand Down
2 changes: 1 addition & 1 deletion src/core/linux/SDL_sandbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ SDL_Sandbox SDL_DetectSandbox(void)
return SDL_SANDBOX_SNAP;
}

if (access("/run/host/container-runtime", F_OK) == 0) {
if (access("/run/host/container-manager", F_OK) == 0) {
return SDL_SANDBOX_UNKNOWN_CONTAINER;
}

Expand Down
41 changes: 21 additions & 20 deletions src/joystick/SDL_gamecontroller.c
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ static ControllerMapping_t *SDL_PrivateMatchControllerMappingForGUID(SDL_Joystic
/*
* Helper function to scan the mappings database for a controller with the specified GUID
*/
static ControllerMapping_t *SDL_PrivateGetControllerMappingForGUID(SDL_JoystickGUID guid, SDL_bool create_mapping)
static ControllerMapping_t *SDL_PrivateGetControllerMappingForGUID(SDL_JoystickGUID guid, SDL_bool adding_mapping)
{
ControllerMapping_t *mapping;
Uint16 vendor, product, crc;
Expand All @@ -790,6 +790,13 @@ static ControllerMapping_t *SDL_PrivateGetControllerMappingForGUID(SDL_JoystickG
return mapping;
}

if (adding_mapping) {
/* We didn't find an existing mapping */
return NULL;
}

/* Try harder to get the best match, or create a mapping */

if (vendor && product) {
/* Try again, ignoring the version */
if (crc) {
Expand All @@ -805,30 +812,24 @@ static ControllerMapping_t *SDL_PrivateGetControllerMappingForGUID(SDL_JoystickG
}
}

if (!create_mapping) {
return NULL;
}

#if SDL_JOYSTICK_XINPUT
if (SDL_IsJoystickXInput(guid)) {
/* This is an XInput device */
return s_pXInputMapping;
}
#endif
if (!mapping) {
if (SDL_IsJoystickHIDAPI(guid)) {
mapping = SDL_CreateMappingForHIDAPIController(guid);
} else if (SDL_IsJoystickRAWINPUT(guid)) {
mapping = SDL_CreateMappingForRAWINPUTController(guid);
} else if (SDL_IsJoystickWGI(guid)) {
mapping = SDL_CreateMappingForWGIController(guid);
} else if (SDL_IsJoystickVirtual(guid)) {
/* We'll pick up a robust mapping in VIRTUAL_JoystickGetGamepadMapping */
if (SDL_IsJoystickHIDAPI(guid)) {
mapping = SDL_CreateMappingForHIDAPIController(guid);
} else if (SDL_IsJoystickRAWINPUT(guid)) {
mapping = SDL_CreateMappingForRAWINPUTController(guid);
} else if (SDL_IsJoystickWGI(guid)) {
mapping = SDL_CreateMappingForWGIController(guid);
} else if (SDL_IsJoystickVirtual(guid)) {
/* We'll pick up a robust mapping in VIRTUAL_JoystickGetGamepadMapping */
#ifdef __ANDROID__
} else {
mapping = SDL_CreateMappingForAndroidController(guid);
} else {
mapping = SDL_CreateMappingForAndroidController(guid);
#endif
}
}
return mapping;
}
Expand Down Expand Up @@ -1276,7 +1277,7 @@ SDL_PrivateAddMappingForGUID(SDL_JoystickGUID jGUID, const char *mappingString,
}
}

pControllerMapping = SDL_PrivateGetControllerMappingForGUID(jGUID, SDL_FALSE);
pControllerMapping = SDL_PrivateGetControllerMappingForGUID(jGUID, SDL_TRUE);
if (pControllerMapping) {
/* Only overwrite the mapping if the priority is the same or higher. */
if (pControllerMapping->priority <= priority) {
Expand Down Expand Up @@ -1336,7 +1337,7 @@ static ControllerMapping_t *SDL_PrivateGetControllerMappingForNameAndGUID(const
{
ControllerMapping_t *mapping;

mapping = SDL_PrivateGetControllerMappingForGUID(guid, SDL_TRUE);
mapping = SDL_PrivateGetControllerMappingForGUID(guid, SDL_FALSE);
#ifdef __LINUX__
if (!mapping && name) {
if (SDL_strstr(name, "Xbox 360 Wireless Receiver")) {
Expand Down Expand Up @@ -1751,7 +1752,7 @@ SDL_GameControllerMappingForIndex(int mapping_index)
char *
SDL_GameControllerMappingForGUID(SDL_JoystickGUID guid)
{
ControllerMapping_t *mapping = SDL_PrivateGetControllerMappingForGUID(guid, SDL_TRUE);
ControllerMapping_t *mapping = SDL_PrivateGetControllerMappingForGUID(guid, SDL_FALSE);
if (mapping) {
return CreateMappingString(mapping, guid);
} else {
Expand Down
8 changes: 4 additions & 4 deletions src/main/windows/version.rc
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,26,3,0
PRODUCTVERSION 2,26,3,0
FILEVERSION 2,26,4,0
PRODUCTVERSION 2,26,4,0
FILEFLAGSMASK 0x3fL
FILEFLAGS 0x0L
FILEOS 0x40004L
Expand All @@ -23,12 +23,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "\0"
VALUE "FileDescription", "SDL\0"
VALUE "FileVersion", "2, 26, 3, 0\0"
VALUE "FileVersion", "2, 26, 4, 0\0"
VALUE "InternalName", "SDL\0"
VALUE "LegalCopyright", "Copyright (C) 2023 Sam Lantinga\0"
VALUE "OriginalFilename", "SDL2.dll\0"
VALUE "ProductName", "Simple DirectMedia Layer\0"
VALUE "ProductVersion", "2, 26, 3, 0\0"
VALUE "ProductVersion", "2, 26, 4, 0\0"
END
END
BLOCK "VarFileInfo"
Expand Down
6 changes: 4 additions & 2 deletions src/video/windows/SDL_windowswindow.c
Original file line number Diff line number Diff line change
Expand Up @@ -1325,14 +1325,16 @@ WIN_UpdateClipCursor(SDL_Window *window)
(window->flags & SDL_WINDOW_INPUT_FOCUS)) {
if (mouse->relative_mode && !mouse->relative_mode_warp && data->mouse_relative_mode_center) {
if (GetWindowRect(data->hwnd, &rect)) {
/* WIN_WarpCursor() jitters by +1, and remote desktop warp wobble is +/- 1 */
LONG remote_desktop_adjustment = GetSystemMetrics(SM_REMOTESESSION) ? 2 : 0;
LONG cx, cy;

cx = (rect.left + rect.right) / 2;
cy = (rect.top + rect.bottom) / 2;

/* Make an absurdly small clip rect */
rect.left = cx;
rect.right = cx + 1;
rect.left = cx - remote_desktop_adjustment;
rect.right = cx + 1 + remote_desktop_adjustment;
rect.top = cy;
rect.bottom = cy + 1;

Expand Down
84 changes: 36 additions & 48 deletions test/testime.c
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,6 @@ int main(int argc, char *argv[])
return 2;
}


#ifdef HAVE_SDL_TTF
/* Initialize fonts */
TTF_Init();
Expand Down Expand Up @@ -714,51 +713,44 @@ int main(int argc, char *argv[])
while (SDL_PollEvent(&event)) {
SDLTest_CommonEvent(state, &event, &done);
switch(event.type) {
case SDL_KEYDOWN: {
switch (event.key.keysym.sym)
{
case SDLK_RETURN:
text[0]=0x00;
Redraw();
break;
case SDLK_BACKSPACE:
/* Only delete text if not in editing mode. */
if (!markedText[0])
{
size_t textlen = SDL_strlen(text);

do {
if (textlen==0)
{
break;
}
if ((text[textlen-1] & 0x80) == 0x00)
{
/* One byte */
text[textlen-1]=0x00;
break;
}
if ((text[textlen-1] & 0xC0) == 0x80)
{
/* Byte from the multibyte sequence */
text[textlen-1]=0x00;
textlen--;
}
if ((text[textlen-1] & 0xC0) == 0xC0)
{
/* First byte of multibyte sequence */
text[textlen-1]=0x00;
break;
}
} while(1);

Redraw();
}
break;
case SDL_KEYDOWN:
switch (event.key.keysym.sym) {
case SDLK_RETURN:
text[0] = 0x00;
Redraw();
break;
case SDLK_BACKSPACE:
/* Only delete text if not in editing mode. */
if (!markedText[0]) {
size_t textlen = SDL_strlen(text);

do {
if (textlen == 0) {
break;
}
if ((text[textlen - 1] & 0x80) == 0x00) {
/* One byte */
text[textlen - 1] = 0x00;
break;
}
if ((text[textlen - 1] & 0xC0) == 0x80) {
/* Byte from the multibyte sequence */
text[textlen - 1] = 0x00;
textlen--;
}
if ((text[textlen - 1] & 0xC0) == 0xC0) {
/* First byte of multibyte sequence */
text[textlen - 1] = 0x00;
break;
}
} while(1);

Redraw();
}
break;
}

if (done)
{
if (done) {
break;
}

Expand Down Expand Up @@ -796,15 +788,11 @@ int main(int argc, char *argv[])
Redraw();
break;
}
break;

}
}
}
CleanupVideo();
SDLTest_CommonQuit(state);
return 0;
}


/* vi: set ts=4 sw=4 expandtab: */

0 comments on commit 4cd56e0

Please sign in to comment.