Compare commits

..

8 Commits

Author SHA1 Message Date
Sam Lantinga
07d0f51fa2 Updated to version 2.26.4 for release 2023-03-06 15:52:05 -08:00
Sam Lantinga
cbc2b014b6 Don't clobber an existing entry with a different version when adding a gamepad mapping
(cherry picked from commit 727c7d4e2f)
(cherry picked from commit 660fc89967)
2023-03-01 16:46:24 -08:00
Sam Lantinga
fa9f7c70c5 Fixed relative mouse motion over remote desktop
Setting the cursor clip area to a single pixel prevents the relative mouse motion remote desktop warping from working, so the mouse is never recentered.

(cherry picked from commit daffe02b11)
(cherry picked from commit ad09976eca)
2023-02-24 09:23:55 -08:00
Anonymous Maarten
dc34e96fff ci: install pkg-config on Macos runner
(cherry picked from commit 86f0c69465)
2023-02-17 01:05:01 +03:00
Sam Lantinga
6edc0100e1 Fixed Steam Runtime sandbox detection
Fixes hotplug issues on Steam Deck for Proton and native games

(cherry picked from commit bcd97b36d2)
(cherry picked from commit e7376b7b74)
2023-02-15 13:55:31 -08:00
Ozkan Sezer
9b061c04e7 cmake: really fix detection of pthread_setname_np() on Apple platforms. 2023-02-13 11:56:10 +03:00
Ozkan Sezer
718a880f91 cmake: fix detection of pthread_setname_np() on Apple platforms. 2023-02-13 11:55:40 +03:00
Ozkan Sezer
853ee9a3e6 testime.c fixes from SDL2 branch. 2023-02-10 11:11:10 +03:00
16 changed files with 84 additions and 88 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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 = .

View File

@@ -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>

View File

@@ -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;
@@ -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;
@@ -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;
@@ -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;

View File

@@ -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
//

View File

@@ -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)

2
configure vendored
View File

@@ -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`

View File

@@ -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`

View File

@@ -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.

View File

@@ -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;
}

View File

@@ -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;
@@ -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) {
@@ -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;
}
@@ -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) {
@@ -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")) {
@@ -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 {

View File

@@ -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
@@ -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"

View File

@@ -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;

View File

@@ -679,7 +679,6 @@ int main(int argc, char *argv[])
return 2;
}
#ifdef HAVE_SDL_TTF
/* Initialize fonts */
TTF_Init();
@@ -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);
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);
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;
Redraw();
}
break;
}
if (done)
{
if (done) {
break;
}
@@ -796,9 +788,6 @@ int main(int argc, char *argv[])
Redraw();
break;
}
break;
}
}
}
CleanupVideo();
@@ -806,5 +795,4 @@ int main(int argc, char *argv[])
return 0;
}
/* vi: set ts=4 sw=4 expandtab: */