diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0db9cba62b861..8f9ab396c855d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -87,7 +87,7 @@ endif()
# See docs/release_checklist.md
set(SDL_MAJOR_VERSION 2)
set(SDL_MINOR_VERSION 30)
-set(SDL_MICRO_VERSION 1)
+set(SDL_MICRO_VERSION 2)
set(SDL_VERSION "${SDL_MAJOR_VERSION}.${SDL_MINOR_VERSION}.${SDL_MICRO_VERSION}")
# Set defaults preventing destination file conflicts
@@ -1107,6 +1107,8 @@ if(SDL_LIBC)
check_symbol_exists(getauxval "sys/auxv.h" HAVE_GETAUXVAL)
check_symbol_exists(elf_aux_info "sys/auxv.h" HAVE_ELF_AUX_INFO)
check_symbol_exists(poll "poll.h" HAVE_POLL)
+ check_symbol_exists(memfd_create "sys/mman.h" HAVE_MEMFD_CREATE)
+ check_symbol_exists(posix_fallocate "fcntl.h" HAVE_POSIX_FALLOCATE)
check_library_exists(m pow "" HAVE_LIBM)
if(HAVE_LIBM)
diff --git a/Makefile.os2 b/Makefile.os2
index 0617137f5ed9c..805a613d88678 100644
--- a/Makefile.os2
+++ b/Makefile.os2
@@ -15,7 +15,7 @@
LIBNAME = SDL2
MAJOR_VERSION = 2
MINOR_VERSION = 30
-MICRO_VERSION = 1
+MICRO_VERSION = 2
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)
DESCRIPTION = Simple DirectMedia Layer 2
diff --git a/Makefile.w32 b/Makefile.w32
index 6739b6d8e6ddc..cfa3517534a8d 100644
--- a/Makefile.w32
+++ b/Makefile.w32
@@ -6,7 +6,7 @@
LIBNAME = SDL2
MAJOR_VERSION = 2
MINOR_VERSION = 30
-MICRO_VERSION = 1
+MICRO_VERSION = 2
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)
LIBHOME = .
diff --git a/VisualC-GDK/SDL/SDL.vcxproj b/VisualC-GDK/SDL/SDL.vcxproj
index 7fe0d4105dc92..2097e6944c689 100644
--- a/VisualC-GDK/SDL/SDL.vcxproj
+++ b/VisualC-GDK/SDL/SDL.vcxproj
@@ -499,7 +499,6 @@
-
diff --git a/VisualC-GDK/SDL/SDL.vcxproj.filters b/VisualC-GDK/SDL/SDL.vcxproj.filters
index d2ff21b10e4c9..56494d4831c90 100644
--- a/VisualC-GDK/SDL/SDL.vcxproj.filters
+++ b/VisualC-GDK/SDL/SDL.vcxproj.filters
@@ -780,9 +780,6 @@
video\khronos\vulkan
-
- video\khronos\vulkan
-
video\khronos\vulkan
diff --git a/VisualC/SDL/SDL.vcxproj b/VisualC/SDL/SDL.vcxproj
index d52b5c058e947..a798514a1b5e0 100644
--- a/VisualC/SDL/SDL.vcxproj
+++ b/VisualC/SDL/SDL.vcxproj
@@ -394,7 +394,6 @@
-
diff --git a/VisualC/SDL/SDL.vcxproj.filters b/VisualC/SDL/SDL.vcxproj.filters
index 9452f370bc423..60899f55c472c 100644
--- a/VisualC/SDL/SDL.vcxproj.filters
+++ b/VisualC/SDL/SDL.vcxproj.filters
@@ -780,9 +780,6 @@
video\khronos\vulkan
-
- video\khronos\vulkan
-
video\khronos\vulkan
diff --git a/Xcode/SDL/Info-Framework.plist b/Xcode/SDL/Info-Framework.plist
index 7700c32794da5..088ca4f7d2b08 100644
--- a/Xcode/SDL/Info-Framework.plist
+++ b/Xcode/SDL/Info-Framework.plist
@@ -19,10 +19,10 @@
CFBundlePackageType
FMWK
CFBundleShortVersionString
- 2.30.1
+ 2.30.2
CFBundleSignature
SDLX
CFBundleVersion
- 2.30.1
+ 2.30.2
diff --git a/Xcode/SDL/SDL.xcodeproj/project.pbxproj b/Xcode/SDL/SDL.xcodeproj/project.pbxproj
index 64afe8797dedc..2505a8778ad7b 100644
--- a/Xcode/SDL/SDL.xcodeproj/project.pbxproj
+++ b/Xcode/SDL/SDL.xcodeproj/project.pbxproj
@@ -206,7 +206,6 @@
A75FCD4823E25AB700529352 /* SDL_keycode.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DB1595D4D800BBD41B /* SDL_keycode.h */; settings = {ATTRIBUTES = (Public, ); }; };
A75FCD4A23E25AB700529352 /* SDL_cocoakeyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A68023E2513E00DCD162 /* SDL_cocoakeyboard.h */; };
A75FCD4B23E25AB700529352 /* SDL_uikitvulkan.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A63323E2513D00DCD162 /* SDL_uikitvulkan.h */; };
- A75FCD4E23E25AB700529352 /* vulkan.hpp in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73223E2513E00DCD162 /* vulkan.hpp */; };
A75FCD4F23E25AB700529352 /* SDL_loadso.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DC1595D4D800BBD41B /* SDL_loadso.h */; settings = {ATTRIBUTES = (Public, ); }; };
A75FCD5023E25AB700529352 /* gl2ext.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A72323E2513E00DCD162 /* gl2ext.h */; };
A75FCD5123E25AB700529352 /* SDL_clipboardevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A93923E2514000DCD162 /* SDL_clipboardevents_c.h */; };
@@ -282,7 +281,6 @@
A75FCDA123E25AB700529352 /* vulkan_xlib.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73A23E2513E00DCD162 /* vulkan_xlib.h */; };
A75FCDA223E25AB700529352 /* SDL_uikitwindow.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A62723E2513D00DCD162 /* SDL_uikitwindow.h */; };
A75FCDA323E25AB700529352 /* vulkan_vi.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A72F23E2513E00DCD162 /* vulkan_vi.h */; };
- A75FCDA423E25AB700529352 /* vulkan_mir.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73923E2513E00DCD162 /* vulkan_mir.h */; };
A75FCDA523E25AB700529352 /* SDL_quit.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E81595D4D800BBD41B /* SDL_quit.h */; settings = {ATTRIBUTES = (Public, ); }; };
A75FCDA623E25AB700529352 /* default_cursor.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A93323E2514000DCD162 /* default_cursor.h */; };
A75FCDA723E25AB700529352 /* SDL_render_sw_c.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A8F523E2514000DCD162 /* SDL_render_sw_c.h */; };
@@ -580,7 +578,6 @@
A75FCF0123E25AC700529352 /* SDL_keycode.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DB1595D4D800BBD41B /* SDL_keycode.h */; settings = {ATTRIBUTES = (Public, ); }; };
A75FCF0323E25AC700529352 /* SDL_cocoakeyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A68023E2513E00DCD162 /* SDL_cocoakeyboard.h */; };
A75FCF0423E25AC700529352 /* SDL_uikitvulkan.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A63323E2513D00DCD162 /* SDL_uikitvulkan.h */; };
- A75FCF0723E25AC700529352 /* vulkan.hpp in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73223E2513E00DCD162 /* vulkan.hpp */; };
A75FCF0823E25AC700529352 /* SDL_loadso.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557DC1595D4D800BBD41B /* SDL_loadso.h */; settings = {ATTRIBUTES = (Public, ); }; };
A75FCF0923E25AC700529352 /* gl2ext.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A72323E2513E00DCD162 /* gl2ext.h */; };
A75FCF0A23E25AC700529352 /* SDL_clipboardevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A93923E2514000DCD162 /* SDL_clipboardevents_c.h */; };
@@ -656,7 +653,6 @@
A75FCF5A23E25AC700529352 /* vulkan_xlib.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73A23E2513E00DCD162 /* vulkan_xlib.h */; };
A75FCF5B23E25AC700529352 /* SDL_uikitwindow.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A62723E2513D00DCD162 /* SDL_uikitwindow.h */; };
A75FCF5C23E25AC700529352 /* vulkan_vi.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A72F23E2513E00DCD162 /* vulkan_vi.h */; };
- A75FCF5D23E25AC700529352 /* vulkan_mir.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73923E2513E00DCD162 /* vulkan_mir.h */; };
A75FCF5E23E25AC700529352 /* SDL_quit.h in Headers */ = {isa = PBXBuildFile; fileRef = AA7557E81595D4D800BBD41B /* SDL_quit.h */; settings = {ATTRIBUTES = (Public, ); }; };
A75FCF5F23E25AC700529352 /* default_cursor.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A93323E2514000DCD162 /* default_cursor.h */; };
A75FCF6023E25AC700529352 /* SDL_render_sw_c.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A8F523E2514000DCD162 /* SDL_render_sw_c.h */; };
@@ -974,7 +970,6 @@
A769B0CD23E259AE00872273 /* SDL_systhread_c.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A78423E2513E00DCD162 /* SDL_systhread_c.h */; };
A769B0D023E259AE00872273 /* SDL_cocoakeyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A68023E2513E00DCD162 /* SDL_cocoakeyboard.h */; };
A769B0D123E259AE00872273 /* SDL_uikitvulkan.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A63323E2513D00DCD162 /* SDL_uikitvulkan.h */; };
- A769B0D423E259AE00872273 /* vulkan.hpp in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73223E2513E00DCD162 /* vulkan.hpp */; };
A769B0D623E259AE00872273 /* gl2ext.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A72323E2513E00DCD162 /* gl2ext.h */; };
A769B0D723E259AE00872273 /* SDL_clipboardevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A93923E2514000DCD162 /* SDL_clipboardevents_c.h */; };
A769B0D923E259AE00872273 /* SDL_syshaptic_c.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A5CF23E2513D00DCD162 /* SDL_syshaptic_c.h */; };
@@ -1036,7 +1031,6 @@
A769B12923E259AE00872273 /* vulkan_xlib.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73A23E2513E00DCD162 /* vulkan_xlib.h */; };
A769B12A23E259AE00872273 /* SDL_uikitwindow.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A62723E2513D00DCD162 /* SDL_uikitwindow.h */; };
A769B12B23E259AE00872273 /* vulkan_vi.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A72F23E2513E00DCD162 /* vulkan_vi.h */; };
- A769B12C23E259AE00872273 /* vulkan_mir.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73923E2513E00DCD162 /* vulkan_mir.h */; };
A769B12E23E259AE00872273 /* default_cursor.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A93323E2514000DCD162 /* default_cursor.h */; };
A769B12F23E259AE00872273 /* SDL_render_sw_c.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A8F523E2514000DCD162 /* SDL_render_sw_c.h */; };
A769B13223E259AE00872273 /* SDL_nullvideo.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A60A23E2513D00DCD162 /* SDL_nullvideo.h */; };
@@ -2110,12 +2104,6 @@
A7D8B26923E2514200DCD162 /* vk_platform.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73123E2513E00DCD162 /* vk_platform.h */; };
A7D8B26A23E2514200DCD162 /* vk_platform.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73123E2513E00DCD162 /* vk_platform.h */; };
A7D8B26B23E2514200DCD162 /* vk_platform.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73123E2513E00DCD162 /* vk_platform.h */; };
- A7D8B26C23E2514200DCD162 /* vulkan.hpp in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73223E2513E00DCD162 /* vulkan.hpp */; };
- A7D8B26D23E2514200DCD162 /* vulkan.hpp in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73223E2513E00DCD162 /* vulkan.hpp */; };
- A7D8B26E23E2514200DCD162 /* vulkan.hpp in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73223E2513E00DCD162 /* vulkan.hpp */; };
- A7D8B26F23E2514200DCD162 /* vulkan.hpp in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73223E2513E00DCD162 /* vulkan.hpp */; };
- A7D8B27023E2514200DCD162 /* vulkan.hpp in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73223E2513E00DCD162 /* vulkan.hpp */; };
- A7D8B27123E2514200DCD162 /* vulkan.hpp in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73223E2513E00DCD162 /* vulkan.hpp */; };
A7D8B27223E2514200DCD162 /* vulkan_fuchsia.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73323E2513E00DCD162 /* vulkan_fuchsia.h */; };
A7D8B27323E2514200DCD162 /* vulkan_fuchsia.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73323E2513E00DCD162 /* vulkan_fuchsia.h */; };
A7D8B27423E2514200DCD162 /* vulkan_fuchsia.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73323E2513E00DCD162 /* vulkan_fuchsia.h */; };
@@ -2152,12 +2140,6 @@
A7D8B29323E2514200DCD162 /* vulkan_xcb.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73823E2513E00DCD162 /* vulkan_xcb.h */; };
A7D8B29423E2514200DCD162 /* vulkan_xcb.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73823E2513E00DCD162 /* vulkan_xcb.h */; };
A7D8B29523E2514200DCD162 /* vulkan_xcb.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73823E2513E00DCD162 /* vulkan_xcb.h */; };
- A7D8B29623E2514200DCD162 /* vulkan_mir.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73923E2513E00DCD162 /* vulkan_mir.h */; };
- A7D8B29723E2514200DCD162 /* vulkan_mir.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73923E2513E00DCD162 /* vulkan_mir.h */; };
- A7D8B29823E2514200DCD162 /* vulkan_mir.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73923E2513E00DCD162 /* vulkan_mir.h */; };
- A7D8B29923E2514200DCD162 /* vulkan_mir.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73923E2513E00DCD162 /* vulkan_mir.h */; };
- A7D8B29A23E2514200DCD162 /* vulkan_mir.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73923E2513E00DCD162 /* vulkan_mir.h */; };
- A7D8B29B23E2514200DCD162 /* vulkan_mir.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73923E2513E00DCD162 /* vulkan_mir.h */; };
A7D8B29C23E2514200DCD162 /* vulkan_xlib.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73A23E2513E00DCD162 /* vulkan_xlib.h */; };
A7D8B29D23E2514200DCD162 /* vulkan_xlib.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73A23E2513E00DCD162 /* vulkan_xlib.h */; };
A7D8B29E23E2514200DCD162 /* vulkan_xlib.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D8A73A23E2513E00DCD162 /* vulkan_xlib.h */; };
@@ -3968,14 +3950,12 @@
A7D8A72F23E2513E00DCD162 /* vulkan_vi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vulkan_vi.h; sourceTree = ""; };
A7D8A73023E2513E00DCD162 /* vulkan.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vulkan.h; sourceTree = ""; };
A7D8A73123E2513E00DCD162 /* vk_platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vk_platform.h; sourceTree = ""; };
- A7D8A73223E2513E00DCD162 /* vulkan.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = vulkan.hpp; sourceTree = ""; };
A7D8A73323E2513E00DCD162 /* vulkan_fuchsia.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vulkan_fuchsia.h; sourceTree = ""; };
A7D8A73423E2513E00DCD162 /* vulkan_wayland.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vulkan_wayland.h; sourceTree = ""; };
A7D8A73523E2513E00DCD162 /* vulkan_win32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vulkan_win32.h; sourceTree = ""; };
A7D8A73623E2513E00DCD162 /* vulkan_macos.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vulkan_macos.h; sourceTree = ""; };
A7D8A73723E2513E00DCD162 /* vulkan_xlib_xrandr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vulkan_xlib_xrandr.h; sourceTree = ""; };
A7D8A73823E2513E00DCD162 /* vulkan_xcb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vulkan_xcb.h; sourceTree = ""; };
- A7D8A73923E2513E00DCD162 /* vulkan_mir.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vulkan_mir.h; sourceTree = ""; };
A7D8A73A23E2513E00DCD162 /* vulkan_xlib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vulkan_xlib.h; sourceTree = ""; };
A7D8A73B23E2513E00DCD162 /* vulkan_ios.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vulkan_ios.h; sourceTree = ""; };
A7D8A73C23E2513E00DCD162 /* vulkan_core.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vulkan_core.h; sourceTree = ""; };
@@ -5003,7 +4983,6 @@
A7D8A73323E2513E00DCD162 /* vulkan_fuchsia.h */,
A7D8A73B23E2513E00DCD162 /* vulkan_ios.h */,
A7D8A73623E2513E00DCD162 /* vulkan_macos.h */,
- A7D8A73923E2513E00DCD162 /* vulkan_mir.h */,
A7D8A72F23E2513E00DCD162 /* vulkan_vi.h */,
A7D8A73423E2513E00DCD162 /* vulkan_wayland.h */,
A7D8A73523E2513E00DCD162 /* vulkan_win32.h */,
@@ -5011,7 +4990,6 @@
A7D8A73723E2513E00DCD162 /* vulkan_xlib_xrandr.h */,
A7D8A73A23E2513E00DCD162 /* vulkan_xlib.h */,
A7D8A73023E2513E00DCD162 /* vulkan.h */,
- A7D8A73223E2513E00DCD162 /* vulkan.hpp */,
);
path = vulkan;
sourceTree = "";
@@ -5596,7 +5574,6 @@
5616CA63252BB35F005D5928 /* SDL_sysurl.h in Headers */,
A75FCD4A23E25AB700529352 /* SDL_cocoakeyboard.h in Headers */,
A75FCD4B23E25AB700529352 /* SDL_uikitvulkan.h in Headers */,
- A75FCD4E23E25AB700529352 /* vulkan.hpp in Headers */,
A75FCD4F23E25AB700529352 /* SDL_loadso.h in Headers */,
A75FCD5023E25AB700529352 /* gl2ext.h in Headers */,
A75FCD5123E25AB700529352 /* SDL_clipboardevents_c.h in Headers */,
@@ -5680,7 +5657,6 @@
A75FCDA123E25AB700529352 /* vulkan_xlib.h in Headers */,
A75FCDA223E25AB700529352 /* SDL_uikitwindow.h in Headers */,
A75FCDA323E25AB700529352 /* vulkan_vi.h in Headers */,
- A75FCDA423E25AB700529352 /* vulkan_mir.h in Headers */,
A75FCDA523E25AB700529352 /* SDL_quit.h in Headers */,
A75FCDA623E25AB700529352 /* default_cursor.h in Headers */,
A75FCDA723E25AB700529352 /* SDL_render_sw_c.h in Headers */,
@@ -5833,7 +5809,6 @@
5616CA66252BB361005D5928 /* SDL_sysurl.h in Headers */,
A75FCF0323E25AC700529352 /* SDL_cocoakeyboard.h in Headers */,
A75FCF0423E25AC700529352 /* SDL_uikitvulkan.h in Headers */,
- A75FCF0723E25AC700529352 /* vulkan.hpp in Headers */,
A75FCF0823E25AC700529352 /* SDL_loadso.h in Headers */,
A75FCF0923E25AC700529352 /* gl2ext.h in Headers */,
A75FCF0A23E25AC700529352 /* SDL_clipboardevents_c.h in Headers */,
@@ -5917,7 +5892,6 @@
A75FCF5A23E25AC700529352 /* vulkan_xlib.h in Headers */,
A75FCF5B23E25AC700529352 /* SDL_uikitwindow.h in Headers */,
A75FCF5C23E25AC700529352 /* vulkan_vi.h in Headers */,
- A75FCF5D23E25AC700529352 /* vulkan_mir.h in Headers */,
A75FCF5E23E25AC700529352 /* SDL_quit.h in Headers */,
A75FCF5F23E25AC700529352 /* default_cursor.h in Headers */,
A75FCF6023E25AC700529352 /* SDL_render_sw_c.h in Headers */,
@@ -6043,7 +6017,6 @@
A769B0D023E259AE00872273 /* SDL_cocoakeyboard.h in Headers */,
5616CA5D252BB35E005D5928 /* SDL_sysurl.h in Headers */,
A769B0D123E259AE00872273 /* SDL_uikitvulkan.h in Headers */,
- A769B0D423E259AE00872273 /* vulkan.hpp in Headers */,
A769B0D623E259AE00872273 /* gl2ext.h in Headers */,
A769B0D723E259AE00872273 /* SDL_clipboardevents_c.h in Headers */,
A769B0D923E259AE00872273 /* SDL_syshaptic_c.h in Headers */,
@@ -6114,7 +6087,6 @@
F386F6F52884663E001840AA /* SDL_utils_c.h in Headers */,
A769B12A23E259AE00872273 /* SDL_uikitwindow.h in Headers */,
A769B12B23E259AE00872273 /* vulkan_vi.h in Headers */,
- A769B12C23E259AE00872273 /* vulkan_mir.h in Headers */,
A769B12E23E259AE00872273 /* default_cursor.h in Headers */,
A769B12F23E259AE00872273 /* SDL_render_sw_c.h in Headers */,
A769B13223E259AE00872273 /* SDL_nullvideo.h in Headers */,
@@ -6387,13 +6359,11 @@
A7D8B26723E2514200DCD162 /* vk_platform.h in Headers */,
A7D8B2AF23E2514200DCD162 /* vk_sdk_platform.h in Headers */,
A7D8B26123E2514200DCD162 /* vulkan.h in Headers */,
- A7D8B26D23E2514200DCD162 /* vulkan.hpp in Headers */,
A7D8B2B523E2514200DCD162 /* vulkan_android.h in Headers */,
A7D8B2A923E2514200DCD162 /* vulkan_core.h in Headers */,
A7D8B27323E2514200DCD162 /* vulkan_fuchsia.h in Headers */,
A7D8B2A323E2514200DCD162 /* vulkan_ios.h in Headers */,
A7D8B28523E2514200DCD162 /* vulkan_macos.h in Headers */,
- A7D8B29723E2514200DCD162 /* vulkan_mir.h in Headers */,
A7D8B25B23E2514200DCD162 /* vulkan_vi.h in Headers */,
A7D8B27923E2514200DCD162 /* vulkan_wayland.h in Headers */,
A7D8B27F23E2514200DCD162 /* vulkan_win32.h in Headers */,
@@ -6629,13 +6599,11 @@
A7D8B26823E2514200DCD162 /* vk_platform.h in Headers */,
A7D8B2B023E2514200DCD162 /* vk_sdk_platform.h in Headers */,
A7D8B26223E2514200DCD162 /* vulkan.h in Headers */,
- A7D8B26E23E2514200DCD162 /* vulkan.hpp in Headers */,
A7D8B2B623E2514200DCD162 /* vulkan_android.h in Headers */,
A7D8B2AA23E2514200DCD162 /* vulkan_core.h in Headers */,
A7D8B27423E2514200DCD162 /* vulkan_fuchsia.h in Headers */,
A7D8B2A423E2514200DCD162 /* vulkan_ios.h in Headers */,
A7D8B28623E2514200DCD162 /* vulkan_macos.h in Headers */,
- A7D8B29823E2514200DCD162 /* vulkan_mir.h in Headers */,
A7D8B25C23E2514200DCD162 /* vulkan_vi.h in Headers */,
A7D8B27A23E2514200DCD162 /* vulkan_wayland.h in Headers */,
A7D8B28023E2514200DCD162 /* vulkan_win32.h in Headers */,
@@ -6704,7 +6672,6 @@
A7D8AE9223E2514100DCD162 /* SDL_cocoakeyboard.h in Headers */,
5616CA5A252BB35D005D5928 /* SDL_sysurl.h in Headers */,
A7D8ACE523E2514100DCD162 /* SDL_uikitvulkan.h in Headers */,
- A7D8B27023E2514200DCD162 /* vulkan.hpp in Headers */,
A7D8B22823E2514200DCD162 /* gl2ext.h in Headers */,
A7D8BB7323E2514500DCD162 /* SDL_clipboardevents_c.h in Headers */,
A7D8AAE423E2514100DCD162 /* SDL_syshaptic_c.h in Headers */,
@@ -6775,7 +6742,6 @@
F386F6F42884663E001840AA /* SDL_utils_c.h in Headers */,
A7D8AC9D23E2514100DCD162 /* SDL_uikitwindow.h in Headers */,
A7D8B25E23E2514200DCD162 /* vulkan_vi.h in Headers */,
- A7D8B29A23E2514200DCD162 /* vulkan_mir.h in Headers */,
A7D8BB4F23E2514500DCD162 /* default_cursor.h in Headers */,
A7D8B9FF23E2514400DCD162 /* SDL_render_sw_c.h in Headers */,
A7D8ABFB23E2514100DCD162 /* SDL_nullvideo.h in Headers */,
@@ -7048,13 +7014,11 @@
A7D8B26623E2514200DCD162 /* vk_platform.h in Headers */,
A7D8B2AE23E2514200DCD162 /* vk_sdk_platform.h in Headers */,
A7D8B26023E2514200DCD162 /* vulkan.h in Headers */,
- A7D8B26C23E2514200DCD162 /* vulkan.hpp in Headers */,
A7D8B2B423E2514200DCD162 /* vulkan_android.h in Headers */,
A7D8B2A823E2514200DCD162 /* vulkan_core.h in Headers */,
A7D8B27223E2514200DCD162 /* vulkan_fuchsia.h in Headers */,
A7D8B2A223E2514200DCD162 /* vulkan_ios.h in Headers */,
A7D8B28423E2514200DCD162 /* vulkan_macos.h in Headers */,
- A7D8B29623E2514200DCD162 /* vulkan_mir.h in Headers */,
A7D8B25A23E2514200DCD162 /* vulkan_vi.h in Headers */,
A7D8B27823E2514200DCD162 /* vulkan_wayland.h in Headers */,
A7D8B27E23E2514200DCD162 /* vulkan_win32.h in Headers */,
@@ -7118,7 +7082,6 @@
A7D8BA7623E2514400DCD162 /* SDL_shaders_gl.h in Headers */,
A7D8B42B23E2514300DCD162 /* SDL_systhread_c.h in Headers */,
A7D8AE9123E2514100DCD162 /* SDL_cocoakeyboard.h in Headers */,
- A7D8B26F23E2514200DCD162 /* vulkan.hpp in Headers */,
A7D8B22723E2514200DCD162 /* gl2ext.h in Headers */,
A7D8BB7223E2514500DCD162 /* SDL_clipboardevents_c.h in Headers */,
A7D8AAE323E2514100DCD162 /* SDL_syshaptic_c.h in Headers */,
@@ -7189,7 +7152,6 @@
A7D8B29F23E2514200DCD162 /* vulkan_xlib.h in Headers */,
A7D8B25D23E2514200DCD162 /* vulkan_vi.h in Headers */,
F316AB882B5A02C3002EF551 /* yuv_rgb_common.h in Headers */,
- A7D8B29923E2514200DCD162 /* vulkan_mir.h in Headers */,
A1BB8B6F27F6CF330057CFA8 /* SDL_list.h in Headers */,
A7D8BB4E23E2514500DCD162 /* default_cursor.h in Headers */,
A7D8B9FE23E2514400DCD162 /* SDL_render_sw_c.h in Headers */,
@@ -7325,7 +7287,6 @@
DB313FDB17554B71006C0E22 /* SDL_keycode.h in Headers */,
A7D8AE9323E2514100DCD162 /* SDL_cocoakeyboard.h in Headers */,
A7D8ACE623E2514100DCD162 /* SDL_uikitvulkan.h in Headers */,
- A7D8B27123E2514200DCD162 /* vulkan.hpp in Headers */,
DB313FDC17554B71006C0E22 /* SDL_loadso.h in Headers */,
A7D8B22923E2514200DCD162 /* gl2ext.h in Headers */,
A7D8BB7423E2514500DCD162 /* SDL_clipboardevents_c.h in Headers */,
@@ -7409,7 +7370,6 @@
A7D8B2A123E2514200DCD162 /* vulkan_xlib.h in Headers */,
A7D8AC9E23E2514100DCD162 /* SDL_uikitwindow.h in Headers */,
A7D8B25F23E2514200DCD162 /* vulkan_vi.h in Headers */,
- A7D8B29B23E2514200DCD162 /* vulkan_mir.h in Headers */,
DB313FE817554B71006C0E22 /* SDL_quit.h in Headers */,
A7D8BB5023E2514500DCD162 /* default_cursor.h in Headers */,
A7D8BA0023E2514400DCD162 /* SDL_render_sw_c.h in Headers */,
@@ -9769,7 +9729,7 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEPLOYMENT_POSTPROCESSING = YES;
DYLIB_COMPATIBILITY_VERSION = 3001.0.0;
- DYLIB_CURRENT_VERSION = 3001.1.0;
+ DYLIB_CURRENT_VERSION = 3001.2.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_ALTIVEC_EXTENSIONS = YES;
@@ -9810,7 +9770,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_LINK_OBJC_RUNTIME = NO;
- MARKETING_VERSION = 2.30.1;
+ MARKETING_VERSION = 2.30.2;
OTHER_LDFLAGS = "-liconv";
};
name = Release;
@@ -9854,7 +9814,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
DYLIB_COMPATIBILITY_VERSION = 3001.0.0;
- DYLIB_CURRENT_VERSION = 3001.1.0;
+ DYLIB_CURRENT_VERSION = 3001.2.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
@@ -9896,7 +9856,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_LINK_OBJC_RUNTIME = NO;
- MARKETING_VERSION = 2.30.1;
+ MARKETING_VERSION = 2.30.2;
OTHER_LDFLAGS = "-liconv";
};
name = Debug;
@@ -10103,7 +10063,7 @@
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 3001.0.0;
- DYLIB_CURRENT_VERSION = 3001.1.0;
+ DYLIB_CURRENT_VERSION = 3001.2.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
@@ -10155,7 +10115,7 @@
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 3001.0.0;
- DYLIB_CURRENT_VERSION = 3001.1.0;
+ DYLIB_CURRENT_VERSION = 3001.2.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_NS_ASSERTIONS = NO;
GCC_C_LANGUAGE_STANDARD = gnu11;
diff --git a/Xcode/SDL/pkg-support/SDL.info b/Xcode/SDL/pkg-support/SDL.info
index 13f6d9c4952a4..705fcbc780ace 100644
--- a/Xcode/SDL/pkg-support/SDL.info
+++ b/Xcode/SDL/pkg-support/SDL.info
@@ -1,4 +1,4 @@
-Title SDL 2.30.1
+Title SDL 2.30.2
Version 1
Description SDL Library for Mac OS X (http://www.libsdl.org)
DefaultLocation /Library/Frameworks
diff --git a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
index fd5a056e3f460..7cbf9d34b3abb 100644
--- a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
+++ b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
@@ -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 = 30;
- private static final int SDL_MICRO_VERSION = 1;
+ private static final int SDL_MICRO_VERSION = 2;
/*
// Display InputType.SOURCE/CLASS of events and devices
//
diff --git a/android-project/app/src/main/java/org/libsdl/app/SDLControllerManager.java b/android-project/app/src/main/java/org/libsdl/app/SDLControllerManager.java
index d6913f1571f09..9d8b20b7bbf7c 100644
--- a/android-project/app/src/main/java/org/libsdl/app/SDLControllerManager.java
+++ b/android-project/app/src/main/java/org/libsdl/app/SDLControllerManager.java
@@ -546,13 +546,15 @@ public void pollHapticDevices() {
if (haptic == null) {
InputDevice device = InputDevice.getDevice(deviceIds[i]);
Vibrator vib = device.getVibrator();
- if (vib.hasVibrator()) {
- haptic = new SDLHaptic();
- haptic.device_id = deviceIds[i];
- haptic.name = device.getName();
- haptic.vib = vib;
- mHaptics.add(haptic);
- SDLControllerManager.nativeAddHaptic(haptic.device_id, haptic.name);
+ if (vib != null) {
+ if (vib.hasVibrator()) {
+ haptic = new SDLHaptic();
+ haptic.device_id = deviceIds[i];
+ haptic.name = device.getName();
+ haptic.vib = vib;
+ mHaptics.add(haptic);
+ SDLControllerManager.nativeAddHaptic(haptic.device_id, haptic.name);
+ }
}
}
}
diff --git a/configure b/configure
index 940e034fb6dbb..9489151e5858f 100755
--- a/configure
+++ b/configure
@@ -3510,7 +3510,7 @@ orig_CFLAGS="$CFLAGS"
# See docs/release_checklist.md
SDL_MAJOR_VERSION=2
SDL_MINOR_VERSION=30
-SDL_MICRO_VERSION=1
+SDL_MICRO_VERSION=2
SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
SDL_BINARY_AGE=`expr $SDL_MINOR_VERSION \* 100 + $SDL_MICRO_VERSION`
@@ -19749,6 +19749,18 @@ if test "x$ac_cv_func_poll" = xyes
then :
printf "%s\n" "#define HAVE_POLL 1" >>confdefs.h
+fi
+ac_fn_c_check_func "$LINENO" "memfd_create" "ac_cv_func_memfd_create"
+if test "x$ac_cv_func_memfd_create" = xyes
+then :
+ printf "%s\n" "#define HAVE_MEMFD_CREATE 1" >>confdefs.h
+
+fi
+ac_fn_c_check_func "$LINENO" "posix_fallocate" "ac_cv_func_posix_fallocate"
+if test "x$ac_cv_func_posix_fallocate" = xyes
+then :
+ printf "%s\n" "#define HAVE_POSIX_FALLOCATE 1" >>confdefs.h
+
fi
ac_fn_c_check_func "$LINENO" "_Exit" "ac_cv_func__Exit"
if test "x$ac_cv_func__Exit" = xyes
diff --git a/configure.ac b/configure.ac
index 9f2097a851255..2114e4099dff2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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=30
-SDL_MICRO_VERSION=1
+SDL_MICRO_VERSION=2
SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
SDL_BINARY_AGE=`expr $SDL_MINOR_VERSION \* 100 + $SDL_MICRO_VERSION`
@@ -359,7 +359,7 @@ dnl Checks for library functions.
AC_DEFINE(HAVE_MPROTECT, 1, [ ])
],[]),
)
- AC_CHECK_FUNCS(malloc calloc realloc free getenv setenv putenv unsetenv bsearch qsort abs bcopy memset memcmp memcpy memmove wcslen wcslcpy wcslcat _wcsdup wcsdup wcsstr wcscmp wcsncmp wcscasecmp _wcsicmp wcsncasecmp _wcsnicmp strlen strlcpy strlcat _strrev _strupr _strlwr index rindex strchr strrchr strstr strtok_r itoa _ltoa _uitoa _ultoa strtod strtol strtoul _i64toa _ui64toa strtoll strtoull atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp strcasestr vsscanf vsnprintf fopen64 fseeko fseeko64 sigaction setjmp nanosleep sysconf sysctlbyname getauxval elf_aux_info poll _Exit)
+ AC_CHECK_FUNCS(malloc calloc realloc free getenv setenv putenv unsetenv bsearch qsort abs bcopy memset memcmp memcpy memmove wcslen wcslcpy wcslcat _wcsdup wcsdup wcsstr wcscmp wcsncmp wcscasecmp _wcsicmp wcsncasecmp _wcsnicmp strlen strlcpy strlcat _strrev _strupr _strlwr index rindex strchr strrchr strstr strtok_r itoa _ltoa _uitoa _ultoa strtod strtol strtoul _i64toa _ui64toa strtoll strtoull atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp strcasestr vsscanf vsnprintf fopen64 fseeko fseeko64 sigaction setjmp nanosleep sysconf sysctlbyname getauxval elf_aux_info poll memfd_create posix_fallocate _Exit)
AC_CHECK_LIB(m, pow, [LIBS="$LIBS -lm"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm"])
AC_CHECK_FUNCS(acos acosf asin asinf atan atanf atan2 atan2f ceil ceilf copysign copysignf cos cosf exp expf fabs fabsf floor floorf trunc truncf fmod fmodf log logf log10 log10f lround lroundf pow powf round roundf scalbn scalbnf sin sinf sqrt sqrtf tan tanf)
diff --git a/include/SDL_config.h.cmake b/include/SDL_config.h.cmake
index e1da0c6d4d5c6..ffcafd895ce8a 100644
--- a/include/SDL_config.h.cmake
+++ b/include/SDL_config.h.cmake
@@ -190,6 +190,8 @@
#cmakedefine HAVE_FOPEN64 1
#cmakedefine HAVE_FSEEKO 1
#cmakedefine HAVE_FSEEKO64 1
+#cmakedefine HAVE_MEMFD_CREATE 1
+#cmakedefine HAVE_POSIX_FALLOCATE 1
#cmakedefine HAVE_SIGACTION 1
#cmakedefine HAVE_SA_SIGACTION 1
#cmakedefine HAVE_SETJMP 1
diff --git a/include/SDL_config.h.in b/include/SDL_config.h.in
index 35b849d0bac0a..f5dd166ff58df 100644
--- a/include/SDL_config.h.in
+++ b/include/SDL_config.h.in
@@ -211,6 +211,8 @@
#undef HAVE_GETAUXVAL
#undef HAVE_ELF_AUX_INFO
#undef HAVE_POLL
+#undef HAVE_MEMFD_CREATE
+#undef HAVE_POSIX_FALLOCATE
#undef HAVE__EXIT
#else
diff --git a/include/SDL_platform.h b/include/SDL_platform.h
index 6e67b4577a3d0..e8bf11acfd4b9 100644
--- a/include/SDL_platform.h
+++ b/include/SDL_platform.h
@@ -199,8 +199,10 @@
#undef __GDK__
#define __GDK__ 1
#endif
-#if defined(__PSP__)
+#if defined(__PSP__) || defined(__psp__)
+#ifdef __PSP__
#undef __PSP__
+#endif
#define __PSP__ 1
#endif
#if defined(PS2)
diff --git a/include/SDL_version.h b/include/SDL_version.h
index 6b66df90f5e2f..c222d7761e64d 100644
--- a/include/SDL_version.h
+++ b/include/SDL_version.h
@@ -59,7 +59,7 @@ typedef struct SDL_version
*/
#define SDL_MAJOR_VERSION 2
#define SDL_MINOR_VERSION 30
-#define SDL_PATCHLEVEL 1
+#define SDL_PATCHLEVEL 2
/**
* Macro to determine SDL version program was compiled against.
diff --git a/src/core/linux/SDL_udev.c b/src/core/linux/SDL_udev.c
index 9cb5345ca7bb0..5bdfc0db81904 100644
--- a/src/core/linux/SDL_udev.c
+++ b/src/core/linux/SDL_udev.c
@@ -31,6 +31,7 @@
#ifdef SDL_USE_LIBUDEV
#include
+#include
#include "SDL_assert.h"
#include "SDL_evdev_capabilities.h"
@@ -227,61 +228,59 @@ void SDL_UDEV_Scan(void)
SDL_bool SDL_UDEV_GetProductInfo(const char *device_path, Uint16 *vendor, Uint16 *product, Uint16 *version, int *class)
{
- struct udev_enumerate *enumerate = NULL;
- struct udev_list_entry *devs = NULL;
- struct udev_list_entry *item = NULL;
- SDL_bool found = SDL_FALSE;
+ struct stat statbuf;
+ char type;
+ struct udev_device *dev;
+ const char* val;
+ int class_temp;
if (!_this) {
return SDL_FALSE;
}
- enumerate = _this->syms.udev_enumerate_new(_this->udev);
- if (!enumerate) {
- SDL_SetError("udev_enumerate_new() failed");
+ if (stat(device_path, &statbuf) == -1) {
return SDL_FALSE;
}
- _this->syms.udev_enumerate_scan_devices(enumerate);
- devs = _this->syms.udev_enumerate_get_list_entry(enumerate);
- for (item = devs; item && !found; item = _this->syms.udev_list_entry_get_next(item)) {
- const char *path = _this->syms.udev_list_entry_get_name(item);
- struct udev_device *dev = _this->syms.udev_device_new_from_syspath(_this->udev, path);
- if (dev) {
- const char *val = NULL;
- const char *existing_path;
+ if (S_ISBLK(statbuf.st_mode)) {
+ type = 'b';
+ }
+ else if (S_ISCHR(statbuf.st_mode)) {
+ type = 'c';
+ }
+ else {
+ return SDL_FALSE;
+ }
- existing_path = _this->syms.udev_device_get_devnode(dev);
- if (existing_path && SDL_strcmp(device_path, existing_path) == 0) {
- int class_temp;
- found = SDL_TRUE;
+ dev = _this->syms.udev_device_new_from_devnum(_this->udev, type, statbuf.st_rdev);
- val = _this->syms.udev_device_get_property_value(dev, "ID_VENDOR_ID");
- if (val) {
- *vendor = (Uint16)SDL_strtol(val, NULL, 16);
- }
+ if (!dev) {
+ return SDL_FALSE;
+ }
- val = _this->syms.udev_device_get_property_value(dev, "ID_MODEL_ID");
- if (val) {
- *product = (Uint16)SDL_strtol(val, NULL, 16);
- }
+ val = _this->syms.udev_device_get_property_value(dev, "ID_VENDOR_ID");
+ if (val) {
+ *vendor = (Uint16)SDL_strtol(val, NULL, 16);
+ }
- val = _this->syms.udev_device_get_property_value(dev, "ID_REVISION");
- if (val) {
- *version = (Uint16)SDL_strtol(val, NULL, 16);
- }
+ val = _this->syms.udev_device_get_property_value(dev, "ID_MODEL_ID");
+ if (val) {
+ *product = (Uint16)SDL_strtol(val, NULL, 16);
+ }
- class_temp = device_class(dev);
- if (class_temp) {
- *class = class_temp;
- }
- }
- _this->syms.udev_device_unref(dev);
- }
+ val = _this->syms.udev_device_get_property_value(dev, "ID_REVISION");
+ if (val) {
+ *version = (Uint16)SDL_strtol(val, NULL, 16);
}
- _this->syms.udev_enumerate_unref(enumerate);
- return found;
+ class_temp = device_class(dev);
+ if (class_temp) {
+ *class = class_temp;
+ }
+
+ _this->syms.udev_device_unref(dev);
+
+ return SDL_TRUE;
}
void SDL_UDEV_UnloadLibrary(void)
diff --git a/src/file/SDL_rwops.c b/src/file/SDL_rwops.c
index b6f5c20cf1a93..febc62b2eaeb0 100644
--- a/src/file/SDL_rwops.c
+++ b/src/file/SDL_rwops.c
@@ -38,7 +38,6 @@
#include
#include
#endif
-
#ifdef HAVE_LIMITS_H
#include
#endif
@@ -752,16 +751,17 @@ static int SDLCALL mem_close(SDL_RWops *context)
/* Functions to create SDL_RWops structures from various data sources */
#if defined(HAVE_STDIO_H) && !(defined(__WIN32__) || defined(__GDK__))
-static SDL_bool SDL_IsRegularFile(FILE *f)
+static SDL_bool IsRegularFileOrPipe(FILE *f)
{
#ifdef __WINRT__
struct __stat64 st;
- if (_fstat64(_fileno(f), &st) < 0 || (st.st_mode & _S_IFMT) != _S_IFREG) {
+ if (_fstat64(_fileno(f), &st) < 0 ||
+ !((st.st_mode & _S_IFMT) == _S_IFREG || (st.st_mode & _S_IFMT) == _S_IFIFO)) {
return SDL_FALSE;
}
#else
struct stat st;
- if (fstat(fileno(f), &st) < 0 || !S_ISREG(st.st_mode)) {
+ if (fstat(fileno(f), &st) < 0 || !(S_ISREG(st.st_mode) || S_ISFIFO(st.st_mode))) {
return SDL_FALSE;
}
#endif
@@ -782,9 +782,9 @@ SDL_RWops *SDL_RWFromFile(const char *file, const char *mode)
if (*file == '/') {
FILE *fp = fopen(file, mode);
if (fp) {
- if (!SDL_IsRegularFile(fp)) {
+ if (!IsRegularFileOrPipe(fp)) {
fclose(fp);
- SDL_SetError("%s is not a regular file", file);
+ SDL_SetError("%s is not a regular file or pipe", file);
return NULL;
}
return SDL_RWFromFP(fp, 1);
@@ -802,9 +802,9 @@ SDL_RWops *SDL_RWFromFile(const char *file, const char *mode)
fp = fopen(path, mode);
SDL_stack_free(path);
if (fp) {
- if (!SDL_IsRegularFile(fp)) {
+ if (!IsRegularFileOrPipe(fp)) {
fclose(fp);
- SDL_SetError("%s is not a regular file", path);
+ SDL_SetError("%s is not a regular file or pipe", path);
return NULL;
}
return SDL_RWFromFP(fp, 1);
@@ -886,10 +886,10 @@ SDL_RWops *SDL_RWFromFile(const char *file, const char *mode)
#endif
if (!fp) {
SDL_SetError("Couldn't open %s", file);
- } else if (!SDL_IsRegularFile(fp)) {
+ } else if (!IsRegularFileOrPipe(fp)) {
fclose(fp);
fp = NULL;
- SDL_SetError("%s is not a regular file", file);
+ SDL_SetError("%s is not a regular file or pipe", file);
} else {
rwops = SDL_RWFromFP(fp, SDL_TRUE);
}
diff --git a/src/joystick/SDL_gamecontroller.c b/src/joystick/SDL_gamecontroller.c
index bbb7f7994da8d..a7d3303b3161a 100644
--- a/src/joystick/SDL_gamecontroller.c
+++ b/src/joystick/SDL_gamecontroller.c
@@ -555,7 +555,7 @@ static ControllerMapping_t *SDL_CreateMappingForHIDAPIController(SDL_JoystickGUI
SDL_strlcat(mapping_string, "a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,righttrigger:a5,start:b6,x:b2,y:b3,misc1:b15,", sizeof(mapping_string));
break;
case k_eSwitchDeviceInfoControllerType_SEGA_Genesis:
- SDL_strlcat(mapping_string, "a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,rightshoulder:b10,righttrigger:a5,start:b6,misc1:b15,", sizeof(mapping_string));
+ SDL_strlcat(mapping_string, "a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,rightshoulder:b10,righttrigger:a5,start:b6,x:b2,y:b3,misc1:b15,", sizeof(mapping_string));
break;
case k_eWiiExtensionControllerType_None:
SDL_strlcat(mapping_string, "a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,start:b6,x:b2,y:b3,", sizeof(mapping_string));
diff --git a/src/joystick/SDL_gamecontrollerdb.h b/src/joystick/SDL_gamecontrollerdb.h
index d1f152ce0cf41..43f98a1eb6384 100644
--- a/src/joystick/SDL_gamecontrollerdb.h
+++ b/src/joystick/SDL_gamecontrollerdb.h
@@ -125,6 +125,7 @@ static const char *s_ControllerMappings[] = {
"03000000260900008888000000000000,Cyber Gadget GameCube Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:a4,rightx:a2,righty:a3~,start:b7,x:b2,y:b3,",
"03000000a306000022f6000000000000,Cyborg V.3 Rumble Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:+a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:-a3,rightx:a2,righty:a4,start:b9,x:b0,y:b3,",
"03000000451300000830000000000000,Defender Game Racer X7,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,",
+ "03000000790000000600000000000000,Defender Joystick Cobra R4,crc:c77a,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2~,righty:a3~,start:b9,x:b3,y:b0,",
"03000000791d00000103000000000000,Dual Box WII,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,rightx:a2,righty:a3,start:b9,x:b3,y:b0,",
"03000000bd12000002e0000000000000,Dual USB Vibration Joystick,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b9,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b10,righttrigger:b5,rightx:a3,righty:a2,start:b11,x:b3,y:b0,",
"030000006f0e00003001000000000000,EA SPORTS PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,",
@@ -317,7 +318,7 @@ static const char *s_ControllerMappings[] = {
"03000000a30600002106000000000000,Saitek PS1000,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b0,y:b3,",
"03000000a306000020f6000000000000,Saitek PS2700,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b0,y:b3,",
"03000000300f00001101000000000000,Saitek Rumble Pad,a:b2,b:b3,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,",
- "03000000790000000600000000000000,Sanwa Supply JY-P76USV,crc:20f0,+leftx:+a0,+rightx:+a2,+righty:a4,-leftx:-a0,-lefty:-a1,-rightx:-a2,-righty:-a4,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,lefty:+a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,start:b9,x:b2,y:b3,",
+ "03000000790000000600000000000000,Sanwa Supply JY-P76USV,crc:20f0,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b2,y:b3,",
"0300000000050000289b000000000000,Saturn_Adapter_2.0,a:b1,b:b2,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b0,y:b3,",
"030000009b2800000500000000000000,Saturn_Adapter_2.0,a:b1,b:b2,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b0,y:b3,",
"030000008f0e00000800000000000000,SpeedLink Strike FX,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,",
@@ -859,7 +860,6 @@ static const char *s_ControllerMappings[] = {
"03000000120c0000100e000011010000,ZEROPLUS P4 Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,",
"03000000120c0000101e000011010000,ZEROPLUS P4 Wired Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,",
"03000000666600006706000000010000,boom PSX to PC Converter,a:b2,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,leftshoulder:b6,leftstick:b9,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b10,righttrigger:b5,rightx:a2,righty:a3,start:b11,x:b3,y:b0,",
- "030000000d0f00000d00000000010000,hori,a:b0,b:b6,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b3,leftx:b4,lefty:b5,rightshoulder:b7,start:b9,x:b1,y:b2,",
"03000000830500006020000010010000,iBuffalo SNES Controller,a:b0,b:b1,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b7,x:b2,y:b3,hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,",
"03000000830500006020000010010000,iBuffalo SNES Controller,a:b1,b:b0,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b7,x:b3,y:b2,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,",
"050000006964726f69643a636f6e0000,idroid:con,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,",
diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c
index fe5da27c2980b..0526b302ab301 100644
--- a/src/joystick/SDL_joystick.c
+++ b/src/joystick/SDL_joystick.c
@@ -296,6 +296,7 @@ static Uint32 initial_flightstick_devices[] = {
MAKE_VIDPID(0x046d, 0xc215), /* Logitech Extreme 3D */
MAKE_VIDPID(0x231d, 0x0126), /* Gunfighter Mk.III ‘Space Combat Edition’ (right) */
MAKE_VIDPID(0x231d, 0x0127), /* Gunfighter Mk.III ‘Space Combat Edition’ (left) */
+ MAKE_VIDPID(0x362c, 0x0001), /* Yawman Arrow */
};
static SDL_vidpid_list flightstick_devices = {
SDL_HINT_JOYSTICK_FLIGHTSTICK_DEVICES, 0, 0, NULL,
@@ -1315,13 +1316,15 @@ const char *SDL_JoystickName(SDL_Joystick *joystick)
const SDL_SteamVirtualGamepadInfo *info;
SDL_LockJoysticks();
- info = SDL_GetJoystickInstanceVirtualGamepadInfo(joystick->instance_id);
- if (info) {
- retval = info->name;
- } else {
+ {
CHECK_JOYSTICK_MAGIC(joystick, NULL);
- retval = joystick->name;
+ info = SDL_GetJoystickInstanceVirtualGamepadInfo(joystick->instance_id);
+ if (info) {
+ retval = info->name;
+ } else {
+ retval = joystick->name;
+ }
}
SDL_UnlockJoysticks();
@@ -3112,13 +3115,17 @@ Uint16 SDL_JoystickGetVendor(SDL_Joystick *joystick)
const SDL_SteamVirtualGamepadInfo *info;
SDL_LockJoysticks();
- info = SDL_GetJoystickInstanceVirtualGamepadInfo(joystick->instance_id);
- if (info) {
- vendor = info->vendor_id;
- } else {
- SDL_JoystickGUID guid = SDL_JoystickGetGUID(joystick);
+ {
+ CHECK_JOYSTICK_MAGIC(joystick, 0);
- SDL_GetJoystickGUIDInfo(guid, &vendor, NULL, NULL, NULL);
+ info = SDL_GetJoystickInstanceVirtualGamepadInfo(joystick->instance_id);
+ if (info) {
+ vendor = info->vendor_id;
+ } else {
+ SDL_JoystickGUID guid = SDL_JoystickGetGUID(joystick);
+
+ SDL_GetJoystickGUIDInfo(guid, &vendor, NULL, NULL, NULL);
+ }
}
SDL_UnlockJoysticks();
@@ -3131,13 +3138,17 @@ Uint16 SDL_JoystickGetProduct(SDL_Joystick *joystick)
const SDL_SteamVirtualGamepadInfo *info;
SDL_LockJoysticks();
- info = SDL_GetJoystickInstanceVirtualGamepadInfo(joystick->instance_id);
- if (info) {
- product = info->product_id;
- } else {
- SDL_JoystickGUID guid = SDL_JoystickGetGUID(joystick);
+ {
+ CHECK_JOYSTICK_MAGIC(joystick, 0);
- SDL_GetJoystickGUIDInfo(guid, NULL, &product, NULL, NULL);
+ info = SDL_GetJoystickInstanceVirtualGamepadInfo(joystick->instance_id);
+ if (info) {
+ product = info->product_id;
+ } else {
+ SDL_JoystickGUID guid = SDL_JoystickGetGUID(joystick);
+
+ SDL_GetJoystickGUIDInfo(guid, NULL, &product, NULL, NULL);
+ }
}
SDL_UnlockJoysticks();
diff --git a/src/joystick/hidapi/SDL_hidapijoystick.c b/src/joystick/hidapi/SDL_hidapijoystick.c
index 81453eec469a1..1584a2cf9df43 100644
--- a/src/joystick/hidapi/SDL_hidapijoystick.c
+++ b/src/joystick/hidapi/SDL_hidapijoystick.c
@@ -168,6 +168,10 @@ SDL_bool HIDAPI_SupportsPlaystationDetection(Uint16 vendor, Uint16 product)
}
return SDL_TRUE;
case USB_VENDOR_MADCATZ:
+ if (product == USB_PRODUCT_MADCATZ_SAITEK_SIDE_PANEL_CONTROL_DECK) {
+ /* This is not a Playstation compatible device */
+ return SDL_FALSE;
+ }
return SDL_TRUE;
case USB_VENDOR_MAYFLASH:
return SDL_TRUE;
diff --git a/src/joystick/linux/SDL_sysjoystick.c b/src/joystick/linux/SDL_sysjoystick.c
index 39ddb75af20c9..75d25227de3e8 100644
--- a/src/joystick/linux/SDL_sysjoystick.c
+++ b/src/joystick/linux/SDL_sysjoystick.c
@@ -1036,21 +1036,24 @@ static int LINUX_JoystickInit(void)
}
if (enumeration_method == ENUMERATION_LIBUDEV) {
- if (SDL_UDEV_Init() < 0) {
- return SDL_SetError("Could not initialize UDEV");
- }
+ if (SDL_UDEV_Init() == 0) {
+ /* Set up the udev callback */
+ if (SDL_UDEV_AddCallback(joystick_udev_callback) < 0) {
+ SDL_UDEV_Quit();
+ return SDL_SetError("Could not set up joystick <-> udev callback");
+ }
- /* Set up the udev callback */
- if (SDL_UDEV_AddCallback(joystick_udev_callback) < 0) {
- SDL_UDEV_Quit();
- return SDL_SetError("Could not set up joystick <-> udev callback");
+ /* Force a scan to build the initial device list */
+ SDL_UDEV_Scan();
+ } else {
+ SDL_LogDebug(SDL_LOG_CATEGORY_INPUT,
+ "udev init failed, disabling udev integration");
+ enumeration_method = ENUMERATION_FALLBACK;
}
-
- /* Force a scan to build the initial device list */
- SDL_UDEV_Scan();
- } else
+ }
#endif
- {
+
+ if (enumeration_method != ENUMERATION_LIBUDEV) {
#if defined(HAVE_INOTIFY)
inotify_fd = SDL_inotify_init1();
diff --git a/src/joystick/psp/SDL_sysjoystick.c b/src/joystick/psp/SDL_sysjoystick.c
index 11e6acc183f9a..3d7d53148c3db 100644
--- a/src/joystick/psp/SDL_sysjoystick.c
+++ b/src/joystick/psp/SDL_sysjoystick.c
@@ -210,7 +210,9 @@ static void PSP_JoystickUpdate(SDL_Joystick *joystick)
static enum PspCtrlButtons old_buttons = 0;
static unsigned char old_x = 0, old_y = 0;
- sceCtrlReadBufferPositive(&pad, 1);
+ if (sceCtrlPeekBufferPositive(&pad, 1) <= 0) {
+ return;
+ }
buttons = pad.Buttons;
x = pad.Lx;
y = pad.Ly;
diff --git a/src/joystick/sort_controllers.py b/src/joystick/sort_controllers.py
index c354a22dccf56..c97559f553700 100755
--- a/src/joystick/sort_controllers.py
+++ b/src/joystick/sort_controllers.py
@@ -35,6 +35,15 @@ def find_element(prefix, bindings):
return -1
+def get_crc_from_entry(entry):
+ crc = ""
+ line = "".join(entry)
+ bindings = line.split(",")
+ pos = find_element("crc:", bindings)
+ if pos >= 0:
+ crc = bindings[pos][4:]
+ return crc
+
def save_controller(line):
global controllers
match = split_pattern.match(line)
@@ -85,7 +94,7 @@ def save_controller(line):
entry.append(match.group(5))
controllers.append(entry)
- entry_id = entry[1] + entry[3]
+ entry_id = entry[1] + get_crc_from_entry(entry)
if ',sdk' in line or ',hint:' in line:
conditionals.append(entry_id)
@@ -94,7 +103,7 @@ def write_controllers():
global controller_guids
# Check for duplicates
for entry in controllers:
- entry_id = entry[1] + entry[3]
+ entry_id = entry[1] + get_crc_from_entry(entry)
if (entry_id in controller_guids and entry_id not in conditionals):
current_name = entry[2]
existing_name = controller_guids[entry_id][2]
diff --git a/src/joystick/usb_ids.h b/src/joystick/usb_ids.h
index 1e218a4b53b11..19ca22710eeab 100644
--- a/src/joystick/usb_ids.h
+++ b/src/joystick/usb_ids.h
@@ -71,6 +71,7 @@
#define USB_PRODUCT_HORI_FIGHTING_STICK_ALPHA_PS5 0x0184
#define USB_PRODUCT_LOGITECH_F310 0xc216
#define USB_PRODUCT_LOGITECH_CHILLSTREAM 0xcad1
+#define USB_PRODUCT_MADCATZ_SAITEK_SIDE_PANEL_CONTROL_DECK 0x2218
#define USB_PRODUCT_NACON_REVOLUTION_5_PRO_PS4_WIRELESS 0x0d16
#define USB_PRODUCT_NACON_REVOLUTION_5_PRO_PS4_WIRED 0x0d17
#define USB_PRODUCT_NACON_REVOLUTION_5_PRO_PS5_WIRELESS 0x0d18
diff --git a/src/joystick/windows/SDL_dinputjoystick.c b/src/joystick/windows/SDL_dinputjoystick.c
index 89daf0464dc98..fb46445e1095f 100644
--- a/src/joystick/windows/SDL_dinputjoystick.c
+++ b/src/joystick/windows/SDL_dinputjoystick.c
@@ -855,6 +855,7 @@ int SDL_DINPUT_JoystickOpen(SDL_Joystick *joystick, JoyStick_DeviceData *joystic
} else if (FAILED(result)) {
return SetDIerror("IDirectInputDevice8::SetProperty", result);
}
+ joystick->hwdata->first_update = SDL_TRUE;
/* Poll and wait for initial device state to be populated */
result = IDirectInputDevice8_Poll(joystick->hwdata->InputDevice);
@@ -1130,7 +1131,14 @@ void SDL_DINPUT_JoystickUpdate(SDL_Joystick *joystick)
IDirectInputDevice8_Poll(joystick->hwdata->InputDevice);
}
- if (joystick->hwdata->buffered) {
+ if (joystick->hwdata->first_update) {
+ /* Poll to get the initial state of the joystick */
+ UpdateDINPUTJoystickState_Polled(joystick);
+ joystick->hwdata->first_update = SDL_FALSE;
+ return;
+ }
+
+ if (joystick->hwdata->buffered ) {
UpdateDINPUTJoystickState_Buffered(joystick);
} else {
UpdateDINPUTJoystickState_Polled(joystick);
diff --git a/src/joystick/windows/SDL_windowsjoystick_c.h b/src/joystick/windows/SDL_windowsjoystick_c.h
index c39481ffc23f1..18c39e80388a6 100644
--- a/src/joystick/windows/SDL_windowsjoystick_c.h
+++ b/src/joystick/windows/SDL_windowsjoystick_c.h
@@ -77,6 +77,7 @@ struct joystick_hwdata
LPDIRECTINPUTDEVICE8 InputDevice;
DIDEVCAPS Capabilities;
SDL_bool buffered;
+ SDL_bool first_update;
input_t Inputs[MAX_INPUTS];
int NumInputs;
int NumSliders;
diff --git a/src/locale/n3ds/SDL_syslocale.c b/src/locale/n3ds/SDL_syslocale.c
index 0f6f03745a61e..1573f28bc03a0 100644
--- a/src/locale/n3ds/SDL_syslocale.c
+++ b/src/locale/n3ds/SDL_syslocale.c
@@ -33,7 +33,7 @@ void SDL_SYS_GetPreferredLocales(char *buf, size_t buflen)
{
/* The 3DS only supports these 12 languages, only one can be active at a time */
static const char AVAILABLE_LOCALES[][6] = { "ja_JP", "en_US", "fr_FR", "de_DE",
- "it_IT", "es_ES", "zn_CN", "ko_KR",
+ "it_IT", "es_ES", "zh_CN", "ko_KR",
"nl_NL", "pt_PT", "ru_RU", "zh_TW" };
u8 current_locale = GetLocaleIndex();
if (current_locale != BAD_LOCALE) {
@@ -45,14 +45,13 @@ SDL_FORCE_INLINE u8
GetLocaleIndex(void)
{
u8 current_locale;
+ Result result;
if (R_FAILED(cfguInit())) {
return BAD_LOCALE;
}
- if (R_FAILED(CFGU_GetSystemLanguage(¤t_locale))) {
- return BAD_LOCALE;
- }
+ result = CFGU_GetSystemLanguage(¤t_locale);
cfguExit();
- return current_locale;
+ return R_SUCCEEDED(result) ? current_locale : BAD_LOCALE;
}
/* vi: set sts=4 ts=4 sw=4 expandtab: */
diff --git a/src/main/windows/version.rc b/src/main/windows/version.rc
index 21f806861a7f8..7a1bddf35272a 100644
--- a/src/main/windows/version.rc
+++ b/src/main/windows/version.rc
@@ -9,8 +9,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 2,30,1,0
- PRODUCTVERSION 2,30,1,0
+ FILEVERSION 2,30,2,0
+ PRODUCTVERSION 2,30,2,0
FILEFLAGSMASK 0x3fL
FILEFLAGS 0x0L
FILEOS 0x40004L
@@ -23,12 +23,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "\0"
VALUE "FileDescription", "SDL\0"
- VALUE "FileVersion", "2, 30, 1, 0\0"
+ VALUE "FileVersion", "2, 30, 2, 0\0"
VALUE "InternalName", "SDL\0"
VALUE "LegalCopyright", "Copyright (C) 2024 Sam Lantinga\0"
VALUE "OriginalFilename", "SDL2.dll\0"
VALUE "ProductName", "Simple DirectMedia Layer\0"
- VALUE "ProductVersion", "2, 30, 1, 0\0"
+ VALUE "ProductVersion", "2, 30, 2, 0\0"
END
END
BLOCK "VarFileInfo"
diff --git a/src/video/cocoa/SDL_cocoawindow.m b/src/video/cocoa/SDL_cocoawindow.m
index b7ff1ca736e48..828366095c5da 100644
--- a/src/video/cocoa/SDL_cocoawindow.m
+++ b/src/video/cocoa/SDL_cocoawindow.m
@@ -460,6 +460,17 @@ static void Cocoa_UpdateClipCursor(SDL_Window * window)
}
}
+static NSCursor *Cocoa_GetDesiredCursor(void)
+{
+ SDL_Mouse *mouse = SDL_GetMouse();
+
+ if (mouse->cursor_shown && mouse->cur_cursor && !mouse->relative_mode) {
+ return (__bridge NSCursor *)mouse->cur_cursor->driverdata;
+ }
+
+ return [NSCursor invisibleCursor];
+}
+
@implementation Cocoa_WindowListener
@@ -1323,6 +1334,7 @@ - (void)mouseMoved:(NSEvent *)theEvent
NSPoint point;
int x, y;
SDL_Window *window;
+ NSView *contentView;
if (!mouse) {
return;
@@ -1330,6 +1342,17 @@ - (void)mouseMoved:(NSEvent *)theEvent
mouseID = mouse->mouseID;
window = _data.window;
+ contentView = _data.sdlContentView;
+ point = [theEvent locationInWindow];
+
+ if ([contentView mouse:[contentView convertPoint:point fromView:nil] inRect:[contentView bounds]] &&
+ [NSCursor currentCursor] != Cocoa_GetDesiredCursor()) {
+ // The wrong cursor is on screen, fix it. This fixes an macOS bug that is only known to
+ // occur in fullscreen windows on the built-in displays of newer MacBooks with camera
+ // notches. When the mouse is moved near the top of such a window (within about 44 units)
+ // and then moved back down, the cursor rects aren't respected.
+ [_data.nswindow invalidateCursorRectsForView:contentView];
+ }
if ([self processHitTest:theEvent]) {
SDL_SendWindowEvent(window, SDL_WINDOWEVENT_HIT_TEST, 0, 0);
@@ -1340,7 +1363,6 @@ - (void)mouseMoved:(NSEvent *)theEvent
return;
}
- point = [theEvent locationInWindow];
x = (int)point.x;
y = (int)(window->h - point.y);
@@ -1590,17 +1612,9 @@ - (BOOL)mouseDownCanMoveWindow
- (void)resetCursorRects
{
- SDL_Mouse *mouse;
[super resetCursorRects];
- mouse = SDL_GetMouse();
-
- if (mouse->cursor_shown && mouse->cur_cursor && !mouse->relative_mode) {
- [self addCursorRect:[self bounds]
- cursor:(__bridge NSCursor *)mouse->cur_cursor->driverdata];
- } else {
- [self addCursorRect:[self bounds]
- cursor:[NSCursor invisibleCursor]];
- }
+ [self addCursorRect:[self bounds]
+ cursor:Cocoa_GetDesiredCursor()];
}
- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent
diff --git a/src/video/wayland/SDL_waylandmouse.c b/src/video/wayland/SDL_waylandmouse.c
index 59570e22e6307..4b7264588dd0b 100644
--- a/src/video/wayland/SDL_waylandmouse.c
+++ b/src/video/wayland/SDL_waylandmouse.c
@@ -23,11 +23,12 @@
#ifdef SDL_VIDEO_DRIVER_WAYLAND
-#include
#include
#include
#include
#include
+#include
+#include
#include "../SDL_sysvideo.h"
@@ -58,6 +59,7 @@ typedef struct
*/
SDL_SystemCursor system_cursor;
void *shm_data;
+ size_t shm_data_size;
} Wayland_CursorData;
#ifdef SDL_USE_LIBDBUS
@@ -289,27 +291,72 @@ static SDL_bool wayland_get_system_cursor(SDL_VideoData *vdata, Wayland_CursorDa
return SDL_TRUE;
}
-static int wayland_create_tmp_file(off_t size)
+static int set_tmp_file_size(int fd, off_t size)
{
- static const char template[] = "/sdl-shared-XXXXXX";
- char *xdg_path;
- char tmp_path[PATH_MAX];
- int fd;
+#ifdef HAVE_POSIX_FALLOCATE
+ sigset_t set, old_set;
+ int ret;
- xdg_path = SDL_getenv("XDG_RUNTIME_DIR");
- if (!xdg_path) {
- return -1;
- }
+ /* SIGALRM can potentially block a large posix_fallocate() operation
+ * from succeeding, so block it.
+ */
+ sigemptyset(&set);
+ sigaddset(&set, SIGALRM);
+ sigprocmask(SIG_BLOCK, &set, &old_set);
+
+ do {
+ ret = posix_fallocate(fd, 0, size);
+ } while (ret == EINTR);
- SDL_strlcpy(tmp_path, xdg_path, PATH_MAX);
- SDL_strlcat(tmp_path, template, PATH_MAX);
+ sigprocmask(SIG_SETMASK, &old_set, NULL);
- fd = mkostemp(tmp_path, O_CLOEXEC);
- if (fd < 0) {
+ if (ret == 0) {
+ return 0;
+ }
+ else if (ret != EINVAL && errno != EOPNOTSUPP) {
return -1;
}
+#endif
if (ftruncate(fd, size) < 0) {
+ return -1;
+ }
+ return 0;
+}
+
+static int wayland_create_tmp_file(off_t size)
+{
+ int fd;
+
+#ifdef HAVE_MEMFD_CREATE
+ fd = memfd_create("SDL", MFD_CLOEXEC | MFD_ALLOW_SEALING);
+ if (fd >= 0) {
+ fcntl(fd, F_ADD_SEALS, F_SEAL_SHRINK | F_SEAL_SEAL);
+ } else
+#endif
+ {
+ static const char template[] = "/sdl-shared-XXXXXX";
+ char *xdg_path;
+ char tmp_path[PATH_MAX];
+
+ xdg_path = SDL_getenv("XDG_RUNTIME_DIR");
+ if (!xdg_path) {
+ return -1;
+ }
+
+ SDL_strlcpy(tmp_path, xdg_path, PATH_MAX);
+ SDL_strlcat(tmp_path, template, PATH_MAX);
+
+ fd = mkostemp(tmp_path, O_CLOEXEC);
+ if (fd < 0) {
+ return -1;
+ }
+
+ /* Need to manually unlink the temp files, or they can persist after close and fill up the temp storage. */
+ unlink(tmp_path);
+ }
+
+ if (set_tmp_file_size(fd, size) < 0) {
close(fd);
return -1;
}
@@ -333,19 +380,18 @@ static int create_buffer_from_shm(Wayland_CursorData *d,
SDL_VideoDevice *vd = SDL_GetVideoDevice();
SDL_VideoData *data = (SDL_VideoData *)vd->driverdata;
struct wl_shm_pool *shm_pool;
+ int shm_fd;
int stride = width * 4;
- int size = stride * height;
-
- int shm_fd;
+ d->shm_data_size = stride * height;
- shm_fd = wayland_create_tmp_file(size);
+ shm_fd = wayland_create_tmp_file(d->shm_data_size);
if (shm_fd < 0) {
return SDL_SetError("Creating mouse cursor buffer failed.");
}
d->shm_data = mmap(NULL,
- size,
+ d->shm_data_size,
PROT_READ | PROT_WRITE,
MAP_SHARED,
shm_fd,
@@ -358,7 +404,7 @@ static int create_buffer_from_shm(Wayland_CursorData *d,
SDL_assert(d->shm_data != NULL);
- shm_pool = wl_shm_create_pool(data->shm, shm_fd, size);
+ shm_pool = wl_shm_create_pool(data->shm, shm_fd, d->shm_data_size);
d->buffer = wl_shm_pool_create_buffer(shm_pool,
0,
width,
@@ -459,6 +505,7 @@ static void Wayland_FreeCursorData(Wayland_CursorData *d)
if (d->buffer) {
if (d->shm_data) {
wl_buffer_destroy(d->buffer);
+ munmap(d->shm_data, d->shm_data_size);
}
d->buffer = NULL;
}
@@ -482,7 +529,6 @@ static void Wayland_FreeCursor(SDL_Cursor *cursor)
Wayland_FreeCursorData((Wayland_CursorData *)cursor->driverdata);
- /* Not sure what's meant to happen to shm_data */
SDL_free(cursor->driverdata);
SDL_free(cursor);
}
diff --git a/src/video/wayland/SDL_waylandopengles.c b/src/video/wayland/SDL_waylandopengles.c
index cf911492a01e2..22311a63e65fa 100644
--- a/src/video/wayland/SDL_waylandopengles.c
+++ b/src/video/wayland/SDL_waylandopengles.c
@@ -126,7 +126,7 @@ int Wayland_GLES_SwapWindow(_THIS, SDL_Window *window)
struct wl_display *display = videodata->display;
SDL_VideoDisplay *sdldisplay = SDL_GetDisplayForWindow(window);
/* 1/3 speed (or 20hz), so we'll progress even if throttled to zero. */
- const Uint32 max_wait = SDL_GetTicks() + (sdldisplay->current_mode.refresh_rate ? (3000 / sdldisplay->current_mode.refresh_rate) : 50);
+ const Uint32 max_wait = SDL_GetTicks() + (sdldisplay && sdldisplay->current_mode.refresh_rate ? (3000 / sdldisplay->current_mode.refresh_rate) : 50);
while (SDL_AtomicGet(&data->swap_interval_ready) == 0) {
Uint32 now;
diff --git a/src/video/wayland/SDL_waylandwindow.c b/src/video/wayland/SDL_waylandwindow.c
index 483ec1926c6c5..34008d5e7af36 100644
--- a/src/video/wayland/SDL_waylandwindow.c
+++ b/src/video/wayland/SDL_waylandwindow.c
@@ -202,7 +202,7 @@ static void SetDrawSurfaceViewport(SDL_Window *window, int src_width, int src_he
wind->draw_viewport = wp_viewporter_get_viewport(video->viewporter, wind->surface);
}
- wp_viewport_set_source(wind->draw_viewport, wl_fixed_from_int(0), wl_fixed_from_int(0), wl_fixed_from_int(src_width), wl_fixed_from_int(src_height));
+ wp_viewport_set_source(wind->draw_viewport, wl_fixed_from_int(-1), wl_fixed_from_int(-1), wl_fixed_from_int(-1), wl_fixed_from_int(-1));
wp_viewport_set_destination(wind->draw_viewport, dst_width, dst_height);
}
}
diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c
index 8e05c414d4d65..b034bf7ec414b 100644
--- a/src/video/windows/SDL_windowsevents.c
+++ b/src/video/windows/SDL_windowsevents.c
@@ -137,6 +137,11 @@ static SDL_Scancode VKeytoScancodeFallback(WPARAM vkey)
static SDL_Scancode VKeytoScancode(WPARAM vkey)
{
switch (vkey) {
+ case VK_BACK:
+ return SDL_SCANCODE_BACKSPACE;
+ case VK_CAPITAL:
+ return SDL_SCANCODE_CAPSLOCK;
+
case VK_MODECHANGE:
return SDL_SCANCODE_MODE;
case VK_SELECT:
@@ -1803,6 +1808,7 @@ void SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata)
int WIN_WaitEventTimeout(_THIS, int timeout)
{
if (g_WindowsEnableMessageLoop) {
+#if !defined(__XBOXONE__) && !defined(__XBOXSERIES__)
DWORD dwMilliseconds, ret;
dwMilliseconds = timeout < 0 ? INFINITE : (DWORD)timeout;
ret = MsgWaitForMultipleObjects(0, NULL, FALSE, dwMilliseconds, QS_ALLINPUT);
@@ -1811,6 +1817,35 @@ int WIN_WaitEventTimeout(_THIS, int timeout)
} else {
return 0;
}
+#else
+ /* MsgWaitForMultipleObjects is desktop-only. */
+ MSG msg;
+ BOOL message_result;
+ UINT_PTR timer_id = 0;
+ if (timeout > 0) {
+ timer_id = SetTimer(NULL, 0, timeout, NULL);
+ message_result = GetMessage(&msg, 0, 0, 0);
+ KillTimer(NULL, timer_id);
+ } else if (timeout == 0) {
+ message_result = PeekMessage(&msg, NULL, 0, 0, PM_REMOVE);
+ } else {
+ message_result = GetMessage(&msg, 0, 0, 0);
+ }
+ if (message_result) {
+ if (msg.message == WM_TIMER && !msg.hwnd && msg.wParam == timer_id) {
+ return 0;
+ }
+ if (g_WindowsMessageHook) {
+ g_WindowsMessageHook(g_WindowsMessageHookData, msg.hwnd, msg.message, msg.wParam, msg.lParam);
+ }
+ /* Always translate the message in case it's a non-SDL window (e.g. with Qt integration) */
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ return 1;
+ } else {
+ return 0;
+ }
+#endif /*!defined(__XBOXONE__) && !defined(__XBOXSERIES__)*/
} else {
/* Fail the wait so the caller falls back to polling */
return -1;
@@ -1927,13 +1962,26 @@ static void WIN_CleanRegisterApp(WNDCLASSEX wcex)
SDL_Appname = NULL;
}
+static BOOL CALLBACK WIN_ResourceNameCallback(HMODULE hModule, LPCTSTR lpType, LPTSTR lpName, LONG_PTR lParam)
+{
+ WNDCLASSEX *wcex = (WNDCLASSEX *)lParam;
+
+ (void)lpType; /* We already know that the resource type is RT_GROUP_ICON. */
+
+ /* We leave hIconSm as NULL as it will allow Windows to automatically
+ choose the appropriate small icon size to suit the current DPI. */
+ wcex->hIcon = LoadIcon(hModule, lpName);
+
+ /* Do not bother enumerating any more. */
+ return FALSE;
+}
+
/* Register the class for this application */
int SDL_RegisterApp(const char *name, Uint32 style, void *hInst)
{
WNDCLASSEX wcex;
#if !defined(__XBOXONE__) && !defined(__XBOXSERIES__)
const char *hint;
- TCHAR path[MAX_PATH];
#endif
/* Only do this once... */
@@ -1976,9 +2024,8 @@ int SDL_RegisterApp(const char *name, Uint32 style, void *hInst)
wcex.hIconSm = LoadIcon(SDL_Instance, MAKEINTRESOURCE(SDL_atoi(hint)));
}
} else {
- /* Use the first icon as a default icon, like in the Explorer */
- GetModuleFileName(SDL_Instance, path, MAX_PATH);
- ExtractIconEx(path, 0, &wcex.hIcon, &wcex.hIconSm, 1);
+ /* Use the first icon as a default icon, like in the Explorer. */
+ EnumResourceNames(SDL_Instance, RT_GROUP_ICON, WIN_ResourceNameCallback, (LONG_PTR)&wcex);
}
#endif /*!defined(__XBOXONE__) && !defined(__XBOXSERIES__)*/