Compare commits

...

8 Commits

Author SHA1 Message Date
Frank Praznik
c9b993f7b6 wayland: Prevent the window from errantly growing when scale to display is used
Some compositors will send a configure event immediately after a scale event, however, this event can contain the old logical size, and should be ignored, or the window will incorrectly change size when moved between displays with differing scale factors.

Store the last requested logical size as the last configure size when resizing a floating window due to a scale change, so a configure event immediately following with the old size will be ignored.

(cherry picked from commit 18219d5b53)
(cherry picked from commit 58c9c0ba7b)
2026-03-12 10:25:04 -04:00
Anonymous Maarten
17c70ee0aa cmake: cannot detect deprecated apple-clang link options (they are not fatal)
So skip these

(cherry picked from commit 5f151f4532)
2026-02-03 20:57:47 +01:00
Brad Smith
6d7bceb41d cmake: Fix header detection with CheckUSBHID
Make use of check_include_files to be able to also include
stdint.h when checking for the headers. Fixes detection of
usbhid.h on OpenBSD.

/usr/include/usbhid.h:40:2: error: unknown type name 'uint32_t'
   40 |         uint32_t _usage_page;
      |         ^

(cherry picked from commit 410a35fbee)
2026-01-28 07:45:40 -08:00
Frank Praznik
49955b3732 events: Raise keyboard keys before sending the focus lost message
Otherwise, the key raises may end up being ignored.

(cherry picked from commit e62d6a95b9)
2026-01-15 15:03:30 -05:00
Anonymous Maarten
3d03699d2b cmake: rpi videocore needs brcmegl as well
(cherry picked from commit cd31381185)
2026-01-14 18:17:52 +01:00
Frank Praznik
c12b2e41cb joystick/win32: Fix function return type mismatch
Fixes #14804

(cherry picked from commit 55acc0b829)
2026-01-11 10:57:58 -05:00
Anonymous Maarten
bba304c0b4 cmake: add SDL_FULL_VERSION target property containing full SDL version
(cherry picked from commit d73e74f9bf)
2026-01-06 04:05:20 +01:00
Sam Lantinga
814deb9438 Updated to version 3.2.31 for development 2025-12-31 17:54:27 -08:00
12 changed files with 44 additions and 31 deletions

View File

@@ -5,7 +5,7 @@ if(NOT DEFINED CMAKE_BUILD_TYPE)
endif()
# See docs/release_checklist.md
project(SDL3 LANGUAGES C VERSION "3.2.30")
project(SDL3 LANGUAGES C VERSION "3.2.31")
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
set(SDL3_MAINPROJECT ON)
@@ -46,6 +46,7 @@ endif()
include(CheckLibraryExists)
include(CheckIncludeFile)
include(CheckIncludeFiles)
include(CheckLanguage)
include(CheckSymbolExists)
include(CheckCSourceCompiles)
@@ -615,12 +616,7 @@ if(USE_GCC OR USE_CLANG OR USE_INTELCC OR USE_QCC)
endif()
endif()
if(APPLE)
check_linker_flag(C "-Wl,-undefined,error" LINKER_SUPPORTS_WL_UNDEFINED_ERROR)
if(LINKER_SUPPORTS_WL_UNDEFINED_ERROR)
sdl_shared_link_options("-Wl,-undefined,error")
endif()
elseif(NOT OPENBSD)
if(NOT OPENBSD)
cmake_push_check_state()
check_linker_flag(C "-Wl,--no-undefined" LINKER_SUPPORTS_WL_NO_UNDEFINED)
#FIXME: originally this if had an additional "AND NOT (USE_CLANG AND WINDOWS)"
@@ -3485,6 +3481,8 @@ if(SDL_SHARED)
set_property(TARGET SDL3-shared PROPERTY INTERFACE_SDL3_SHARED TRUE)
set_property(TARGET SDL3-shared APPEND PROPERTY COMPATIBLE_INTERFACE_STRING "SDL_VERSION")
set_property(TARGET SDL3-shared PROPERTY INTERFACE_SDL_VERSION "SDL${SDL3_VERSION_MAJOR}")
set_property(TARGET SDL3-shared APPEND PROPERTY EXPORT_PROPERTIES "SDL_FULL_VERSION")
set_property(TARGET SDL3-shared PROPERTY SDL_FULL_VERSION "${PROJECT_VERSION}")
if(NOT CMAKE_VERSION VERSION_LESS "3.16")
target_precompile_headers(SDL3-shared PRIVATE "$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:${PROJECT_SOURCE_DIR}/src/SDL_internal.h>")
endif()
@@ -3509,6 +3507,8 @@ if(SDL_STATIC)
set_property(TARGET SDL3-static PROPERTY INTERFACE_SDL3_SHARED FALSE)
set_property(TARGET SDL3-static APPEND PROPERTY COMPATIBLE_INTERFACE_STRING "SDL_VERSION")
set_property(TARGET SDL3-static PROPERTY INTERFACE_SDL_VERSION "SDL${SDL3_VERSION_MAJOR}")
set_property(TARGET SDL3-static APPEND PROPERTY EXPORT_PROPERTIES "SDL_FULL_VERSION")
set_property(TARGET SDL3-static PROPERTY SDL_FULL_VERSION "${PROJECT_VERSION}")
if(NOT CMAKE_VERSION VERSION_LESS "3.16")
target_precompile_headers(SDL3-static PRIVATE "$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:${PROJECT_SOURCE_DIR}/src/SDL_internal.h>")
endif()

View File

@@ -19,10 +19,10 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>3.2.30</string>
<string>3.2.31</string>
<key>CFBundleSignature</key>
<string>SDLX</string>
<key>CFBundleVersion</key>
<string>3.2.30</string>
<string>3.2.31</string>
</dict>
</plist>

View File

@@ -3082,7 +3082,7 @@
CLANG_ENABLE_OBJC_ARC = YES;
DEPLOYMENT_POSTPROCESSING = YES;
DYLIB_COMPATIBILITY_VERSION = 201.0.0;
DYLIB_CURRENT_VERSION = 201.30.0;
DYLIB_CURRENT_VERSION = 201.31.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_ALTIVEC_EXTENSIONS = YES;
@@ -3117,7 +3117,7 @@
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 3.2.30;
MARKETING_VERSION = 3.2.31;
OTHER_LDFLAGS = "$(CONFIG_FRAMEWORK_LDFLAGS)";
PRODUCT_BUNDLE_IDENTIFIER = org.libsdl.SDL3;
PRODUCT_NAME = SDL3;
@@ -3148,7 +3148,7 @@
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
DYLIB_COMPATIBILITY_VERSION = 201.0.0;
DYLIB_CURRENT_VERSION = 201.30.0;
DYLIB_CURRENT_VERSION = 201.31.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
@@ -3180,7 +3180,7 @@
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 3.2.30;
MARKETING_VERSION = 3.2.31;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = "$(CONFIG_FRAMEWORK_LDFLAGS)";
PRODUCT_BUNDLE_IDENTIFIER = org.libsdl.SDL3;

View File

@@ -1,4 +1,4 @@
Title SDL 3.2.30
Title SDL 3.2.31
Version 1
Description SDL Library for macOS (http://www.libsdl.org)
DefaultLocation /Library/Frameworks

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 = 3;
private static final int SDL_MINOR_VERSION = 2;
private static final int SDL_MICRO_VERSION = 30;
private static final int SDL_MICRO_VERSION = 31;
/*
// Display InputType.SOURCE/CLASS of events and devices
//

View File

@@ -946,22 +946,22 @@ macro(CheckUSBHID)
cmake_push_check_state()
check_library_exists(usbhid hid_init "" LIBUSBHID)
if(LIBUSBHID)
check_include_file(usbhid.h HAVE_USBHID_H)
check_include_files("stdint.h;usbhid.h" HAVE_USBHID_H)
if(HAVE_USBHID_H)
set(USB_CFLAGS "-DHAVE_USBHID_H")
endif()
check_include_file(libusbhid.h HAVE_LIBUSBHID_H)
check_include_files("stdint.h;libusbhid.h" HAVE_LIBUSBHID_H)
if(HAVE_LIBUSBHID_H)
string(APPEND USB_CFLAGS " -DHAVE_LIBUSBHID_H")
endif()
set(USB_LIBS ${USB_LIBS} usbhid)
else()
check_include_file(usb.h HAVE_USB_H)
check_include_files("stdint.h;usb.h" HAVE_USB_H)
if(HAVE_USB_H)
set(USB_CFLAGS "-DHAVE_USB_H")
endif()
check_include_file(libusb.h HAVE_LIBUSB_H)
check_include_files("stdint.h;libusb.h" HAVE_LIBUSB_H)
if(HAVE_LIBUSB_H)
string(APPEND USB_CFLAGS " -DHAVE_LIBUSB_H")
endif()
@@ -1156,7 +1156,8 @@ macro(CheckRPI)
set(HAVE_SDL_VIDEO TRUE)
set(SDL_VIDEO_DRIVER_RPI 1)
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/video/raspberry/*.c")
sdl_link_dependency(rpi-video LIBS PkgConfig::PC_BCM_HOST PKG_CONFIG_PREFIX PC_BCM_HOST PKG_CONFIG_SPECS ${BCM_HOST_PKG_CONFIG_SPEC})
sdl_link_dependency(rpi-video-bcm_host LIBS PkgConfig::PC_BCM_HOST PKG_CONFIG_PREFIX PC_BCM_HOST PKG_CONFIG_SPECS ${BCM_HOST_PKG_CONFIG_SPEC})
sdl_link_dependency(rpi-video-brcmegl LIBS PkgConfig::PC_BRCMEGL PKG_CONFIG_PREFIX PC_BRCMEGL PKG_CONFIG_SPECS ${BRCMEGL_PKG_CONFIG_SPEC})
endif()
endif()
endif()

View File

@@ -20,7 +20,7 @@
*/
/**
* Main include header for the SDL library, version 3.2.30
* Main include header for the SDL library, version 3.2.31
*
* It is almost always best to include just this one header instead of
* picking out individual headers included here. There are exceptions to

View File

@@ -62,7 +62,7 @@ extern "C" {
*
* \since This macro is available since SDL 3.2.0.
*/
#define SDL_MICRO_VERSION 30
#define SDL_MICRO_VERSION 31
/**
* This macro turns the version numbers into a numeric value.

View File

@@ -9,8 +9,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,2,30,0
PRODUCTVERSION 3,2,30,0
FILEVERSION 3,2,31,0
PRODUCTVERSION 3,2,31,0
FILEFLAGSMASK 0x3fL
FILEFLAGS 0x0L
FILEOS 0x40004L
@@ -23,12 +23,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "\0"
VALUE "FileDescription", "SDL\0"
VALUE "FileVersion", "3, 2, 30, 0\0"
VALUE "FileVersion", "3, 2, 31, 0\0"
VALUE "InternalName", "SDL\0"
VALUE "LegalCopyright", "Copyright (C) 2025 Sam Lantinga\0"
VALUE "OriginalFilename", "SDL3.dll\0"
VALUE "ProductName", "Simple DirectMedia Layer\0"
VALUE "ProductVersion", "3, 2, 30, 0\0"
VALUE "ProductVersion", "3, 2, 31, 0\0"
END
END
BLOCK "VarFileInfo"

View File

@@ -333,6 +333,11 @@ bool SDL_SetKeyboardFocus(SDL_Window *window)
}
}
if (keyboard->focus && !window) {
// We won't get anymore keyboard messages, so reset keyboard state
SDL_ResetKeyboard();
}
// See if the current window has lost focus
if (keyboard->focus && keyboard->focus != window) {
SDL_SendWindowEvent(keyboard->focus, SDL_EVENT_WINDOW_FOCUS_LOST, 0, 0);
@@ -346,9 +351,6 @@ bool SDL_SetKeyboardFocus(SDL_Window *window)
}
if (keyboard->focus && !window) {
// We won't get anymore keyboard messages, so reset keyboard state
SDL_ResetKeyboard();
// Also leave mouse relative mode
if (mouse->relative_mode) {
SDL_SetRelativeMouseMode(false);

View File

@@ -25,8 +25,8 @@
extern bool RAWINPUT_IsEnabled(void);
// Registers for input events
extern int RAWINPUT_RegisterNotifications(HWND hWnd);
extern int RAWINPUT_UnregisterNotifications(void);
extern bool RAWINPUT_RegisterNotifications(HWND hWnd);
extern bool RAWINPUT_UnregisterNotifications(void);
// Returns 0 if message was handled
extern LRESULT CALLBACK RAWINPUT_WindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);

View File

@@ -1471,6 +1471,16 @@ static void Wayland_HandlePreferredScaleChanged(SDL_WindowData *window_data, dou
* the new backbuffer dimensions.
*/
if (window_data->floating) {
/* Some compositors will send a configure event immediately after a scale event, however,
* this event can contain the old logical size, and should be ignored, or the window can
* incorrectly change size when moved between displays with differing scale factors.
*
* Store the last requested logical size as the last configure size, so a configure event
* with the old size will be ignored.
*/
window_data->last_configure.width = window_data->requested.logical_width;
window_data->last_configure.height = window_data->requested.logical_height;
window_data->requested.logical_width = PixelToPoint(window_data->sdlwindow, window_data->requested.pixel_width);
window_data->requested.logical_height = PixelToPoint(window_data->sdlwindow, window_data->requested.pixel_height);
} else {