mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-07 11:58:12 +00:00
Compare commits
19 Commits
main
...
release-3.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
f6864924f7 | ||
![]() |
6b3dafa4d3 | ||
![]() |
5c0c5d2816 | ||
![]() |
de11dd3d60 | ||
![]() |
ac09af2600 | ||
![]() |
26d1afa29c | ||
![]() |
6aab3b9da8 | ||
![]() |
d959719a3d | ||
![]() |
5a7b17fec5 | ||
![]() |
1d6bb62870 | ||
![]() |
0c3603d893 | ||
![]() |
38a5bca892 | ||
![]() |
70a289076a | ||
![]() |
1d0ecf982f | ||
![]() |
18d93d11e1 | ||
![]() |
110a832f5c | ||
![]() |
6a9e970880 | ||
![]() |
4e3058ce82 | ||
![]() |
bc6307a872 |
@@ -5,7 +5,7 @@ if(NOT DEFINED CMAKE_BUILD_TYPE)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# See docs/release_checklist.md
|
# See docs/release_checklist.md
|
||||||
project(SDL3 LANGUAGES C VERSION "3.2.6")
|
project(SDL3 LANGUAGES C VERSION "3.2.8")
|
||||||
|
|
||||||
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
|
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
|
||||||
set(SDL3_MAINPROJECT ON)
|
set(SDL3_MAINPROJECT ON)
|
||||||
|
@@ -19,10 +19,10 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>FMWK</string>
|
<string>FMWK</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>3.2.6</string>
|
<string>3.2.8</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>SDLX</string>
|
<string>SDLX</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>3.2.6</string>
|
<string>3.2.8</string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
@@ -3086,7 +3086,7 @@
|
|||||||
CLANG_ENABLE_OBJC_ARC = YES;
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
DEPLOYMENT_POSTPROCESSING = YES;
|
DEPLOYMENT_POSTPROCESSING = YES;
|
||||||
DYLIB_COMPATIBILITY_VERSION = 201.0.0;
|
DYLIB_COMPATIBILITY_VERSION = 201.0.0;
|
||||||
DYLIB_CURRENT_VERSION = 201.6.0;
|
DYLIB_CURRENT_VERSION = 201.8.0;
|
||||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
GCC_ALTIVEC_EXTENSIONS = YES;
|
GCC_ALTIVEC_EXTENSIONS = YES;
|
||||||
@@ -3121,7 +3121,7 @@
|
|||||||
"@loader_path/Frameworks",
|
"@loader_path/Frameworks",
|
||||||
);
|
);
|
||||||
MACOSX_DEPLOYMENT_TARGET = 10.13;
|
MACOSX_DEPLOYMENT_TARGET = 10.13;
|
||||||
MARKETING_VERSION = 3.2.6;
|
MARKETING_VERSION = 3.2.8;
|
||||||
OTHER_LDFLAGS = "$(CONFIG_FRAMEWORK_LDFLAGS)";
|
OTHER_LDFLAGS = "$(CONFIG_FRAMEWORK_LDFLAGS)";
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = org.libsdl.SDL3;
|
PRODUCT_BUNDLE_IDENTIFIER = org.libsdl.SDL3;
|
||||||
PRODUCT_NAME = SDL3;
|
PRODUCT_NAME = SDL3;
|
||||||
@@ -3150,7 +3150,7 @@
|
|||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CLANG_ENABLE_OBJC_ARC = YES;
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
DYLIB_COMPATIBILITY_VERSION = 201.0.0;
|
DYLIB_COMPATIBILITY_VERSION = 201.0.0;
|
||||||
DYLIB_CURRENT_VERSION = 201.6.0;
|
DYLIB_CURRENT_VERSION = 201.8.0;
|
||||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
ENABLE_TESTABILITY = YES;
|
ENABLE_TESTABILITY = YES;
|
||||||
@@ -3182,7 +3182,7 @@
|
|||||||
"@loader_path/Frameworks",
|
"@loader_path/Frameworks",
|
||||||
);
|
);
|
||||||
MACOSX_DEPLOYMENT_TARGET = 10.13;
|
MACOSX_DEPLOYMENT_TARGET = 10.13;
|
||||||
MARKETING_VERSION = 3.2.6;
|
MARKETING_VERSION = 3.2.8;
|
||||||
ONLY_ACTIVE_ARCH = YES;
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
OTHER_LDFLAGS = "$(CONFIG_FRAMEWORK_LDFLAGS)";
|
OTHER_LDFLAGS = "$(CONFIG_FRAMEWORK_LDFLAGS)";
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = org.libsdl.SDL3;
|
PRODUCT_BUNDLE_IDENTIFIER = org.libsdl.SDL3;
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
Title SDL 3.2.6
|
Title SDL 3.2.8
|
||||||
Version 1
|
Version 1
|
||||||
Description SDL Library for macOS (http://www.libsdl.org)
|
Description SDL Library for macOS (http://www.libsdl.org)
|
||||||
DefaultLocation /Library/Frameworks
|
DefaultLocation /Library/Frameworks
|
||||||
|
@@ -60,7 +60,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||||||
private static final String TAG = "SDL";
|
private static final String TAG = "SDL";
|
||||||
private static final int SDL_MAJOR_VERSION = 3;
|
private static final int SDL_MAJOR_VERSION = 3;
|
||||||
private static final int SDL_MINOR_VERSION = 2;
|
private static final int SDL_MINOR_VERSION = 2;
|
||||||
private static final int SDL_MICRO_VERSION = 6;
|
private static final int SDL_MICRO_VERSION = 8;
|
||||||
/*
|
/*
|
||||||
// Display InputType.SOURCE/CLASS of events and devices
|
// Display InputType.SOURCE/CLASS of events and devices
|
||||||
//
|
//
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main include header for the SDL library, version 3.2.6
|
* Main include header for the SDL library, version 3.2.8
|
||||||
*
|
*
|
||||||
* It is almost always best to include just this one header instead of
|
* It is almost always best to include just this one header instead of
|
||||||
* picking out individual headers included here. There are exceptions to
|
* picking out individual headers included here. There are exceptions to
|
||||||
|
@@ -62,7 +62,7 @@ extern "C" {
|
|||||||
*
|
*
|
||||||
* \since This macro is available since SDL 3.2.0.
|
* \since This macro is available since SDL 3.2.0.
|
||||||
*/
|
*/
|
||||||
#define SDL_MICRO_VERSION 6
|
#define SDL_MICRO_VERSION 8
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This macro turns the version numbers into a numeric value.
|
* This macro turns the version numbers into a numeric value.
|
||||||
|
14
src/SDL.c
14
src/SDL.c
@@ -356,7 +356,9 @@ bool SDL_InitSubSystem(SDL_InitFlags flags)
|
|||||||
SDL_IncrementSubsystemRefCount(SDL_INIT_VIDEO);
|
SDL_IncrementSubsystemRefCount(SDL_INIT_VIDEO);
|
||||||
if (!SDL_VideoInit(NULL)) {
|
if (!SDL_VideoInit(NULL)) {
|
||||||
SDL_DecrementSubsystemRefCount(SDL_INIT_VIDEO);
|
SDL_DecrementSubsystemRefCount(SDL_INIT_VIDEO);
|
||||||
|
SDL_PushError();
|
||||||
SDL_QuitSubSystem(SDL_INIT_EVENTS);
|
SDL_QuitSubSystem(SDL_INIT_EVENTS);
|
||||||
|
SDL_PopError();
|
||||||
goto quit_and_error;
|
goto quit_and_error;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -381,7 +383,9 @@ bool SDL_InitSubSystem(SDL_InitFlags flags)
|
|||||||
SDL_IncrementSubsystemRefCount(SDL_INIT_AUDIO);
|
SDL_IncrementSubsystemRefCount(SDL_INIT_AUDIO);
|
||||||
if (!SDL_InitAudio(NULL)) {
|
if (!SDL_InitAudio(NULL)) {
|
||||||
SDL_DecrementSubsystemRefCount(SDL_INIT_AUDIO);
|
SDL_DecrementSubsystemRefCount(SDL_INIT_AUDIO);
|
||||||
|
SDL_PushError();
|
||||||
SDL_QuitSubSystem(SDL_INIT_EVENTS);
|
SDL_QuitSubSystem(SDL_INIT_EVENTS);
|
||||||
|
SDL_PopError();
|
||||||
goto quit_and_error;
|
goto quit_and_error;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -406,7 +410,9 @@ bool SDL_InitSubSystem(SDL_InitFlags flags)
|
|||||||
SDL_IncrementSubsystemRefCount(SDL_INIT_JOYSTICK);
|
SDL_IncrementSubsystemRefCount(SDL_INIT_JOYSTICK);
|
||||||
if (!SDL_InitJoysticks()) {
|
if (!SDL_InitJoysticks()) {
|
||||||
SDL_DecrementSubsystemRefCount(SDL_INIT_JOYSTICK);
|
SDL_DecrementSubsystemRefCount(SDL_INIT_JOYSTICK);
|
||||||
|
SDL_PushError();
|
||||||
SDL_QuitSubSystem(SDL_INIT_EVENTS);
|
SDL_QuitSubSystem(SDL_INIT_EVENTS);
|
||||||
|
SDL_PopError();
|
||||||
goto quit_and_error;
|
goto quit_and_error;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -430,7 +436,9 @@ bool SDL_InitSubSystem(SDL_InitFlags flags)
|
|||||||
SDL_IncrementSubsystemRefCount(SDL_INIT_GAMEPAD);
|
SDL_IncrementSubsystemRefCount(SDL_INIT_GAMEPAD);
|
||||||
if (!SDL_InitGamepads()) {
|
if (!SDL_InitGamepads()) {
|
||||||
SDL_DecrementSubsystemRefCount(SDL_INIT_GAMEPAD);
|
SDL_DecrementSubsystemRefCount(SDL_INIT_GAMEPAD);
|
||||||
|
SDL_PushError();
|
||||||
SDL_QuitSubSystem(SDL_INIT_JOYSTICK);
|
SDL_QuitSubSystem(SDL_INIT_JOYSTICK);
|
||||||
|
SDL_PopError();
|
||||||
goto quit_and_error;
|
goto quit_and_error;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -493,7 +501,9 @@ bool SDL_InitSubSystem(SDL_InitFlags flags)
|
|||||||
SDL_IncrementSubsystemRefCount(SDL_INIT_CAMERA);
|
SDL_IncrementSubsystemRefCount(SDL_INIT_CAMERA);
|
||||||
if (!SDL_CameraInit(NULL)) {
|
if (!SDL_CameraInit(NULL)) {
|
||||||
SDL_DecrementSubsystemRefCount(SDL_INIT_CAMERA);
|
SDL_DecrementSubsystemRefCount(SDL_INIT_CAMERA);
|
||||||
|
SDL_PushError();
|
||||||
SDL_QuitSubSystem(SDL_INIT_EVENTS);
|
SDL_QuitSubSystem(SDL_INIT_EVENTS);
|
||||||
|
SDL_PopError();
|
||||||
goto quit_and_error;
|
goto quit_and_error;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -511,7 +521,11 @@ bool SDL_InitSubSystem(SDL_InitFlags flags)
|
|||||||
return SDL_ClearError();
|
return SDL_ClearError();
|
||||||
|
|
||||||
quit_and_error:
|
quit_and_error:
|
||||||
|
{
|
||||||
|
SDL_PushError();
|
||||||
SDL_QuitSubSystem(flags_initialized);
|
SDL_QuitSubSystem(flags_initialized);
|
||||||
|
SDL_PopError();
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -46,4 +46,16 @@ typedef struct SDL_error
|
|||||||
// Defined in SDL_thread.c
|
// Defined in SDL_thread.c
|
||||||
extern SDL_error *SDL_GetErrBuf(bool create);
|
extern SDL_error *SDL_GetErrBuf(bool create);
|
||||||
|
|
||||||
|
// Macros to save and restore error values
|
||||||
|
#define SDL_PushError() \
|
||||||
|
char *saved_error = SDL_strdup(SDL_GetError())
|
||||||
|
|
||||||
|
#define SDL_PopError() \
|
||||||
|
do { \
|
||||||
|
if (saved_error) { \
|
||||||
|
SDL_SetError("%s", saved_error); \
|
||||||
|
SDL_free(saved_error); \
|
||||||
|
} \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
#endif // SDL_error_c_h_
|
#endif // SDL_error_c_h_
|
||||||
|
@@ -58,7 +58,9 @@ static bool pipewire_initialized = false;
|
|||||||
|
|
||||||
// Pipewire entry points
|
// Pipewire entry points
|
||||||
static const char *(*PIPEWIRE_pw_get_library_version)(void);
|
static const char *(*PIPEWIRE_pw_get_library_version)(void);
|
||||||
|
#if PW_CHECK_VERSION(0, 3, 75)
|
||||||
static bool (*PIPEWIRE_pw_check_library_version)(int major, int minor, int micro);
|
static bool (*PIPEWIRE_pw_check_library_version)(int major, int minor, int micro);
|
||||||
|
#endif
|
||||||
static void (*PIPEWIRE_pw_init)(int *, char ***);
|
static void (*PIPEWIRE_pw_init)(int *, char ***);
|
||||||
static void (*PIPEWIRE_pw_deinit)(void);
|
static void (*PIPEWIRE_pw_deinit)(void);
|
||||||
static struct pw_main_loop *(*PIPEWIRE_pw_main_loop_new)(const struct spa_dict *loop);
|
static struct pw_main_loop *(*PIPEWIRE_pw_main_loop_new)(const struct spa_dict *loop);
|
||||||
@@ -151,7 +153,9 @@ static void unload_pipewire_library(void)
|
|||||||
static bool load_pipewire_syms(void)
|
static bool load_pipewire_syms(void)
|
||||||
{
|
{
|
||||||
SDL_PIPEWIRE_SYM(pw_get_library_version);
|
SDL_PIPEWIRE_SYM(pw_get_library_version);
|
||||||
|
#if PW_CHECK_VERSION(0, 3, 75)
|
||||||
SDL_PIPEWIRE_SYM(pw_check_library_version);
|
SDL_PIPEWIRE_SYM(pw_check_library_version);
|
||||||
|
#endif
|
||||||
SDL_PIPEWIRE_SYM(pw_init);
|
SDL_PIPEWIRE_SYM(pw_init);
|
||||||
SDL_PIPEWIRE_SYM(pw_deinit);
|
SDL_PIPEWIRE_SYM(pw_deinit);
|
||||||
SDL_PIPEWIRE_SYM(pw_main_loop_new);
|
SDL_PIPEWIRE_SYM(pw_main_loop_new);
|
||||||
@@ -1024,7 +1028,11 @@ static bool hotplug_loop_init(void)
|
|||||||
|
|
||||||
spa_list_init(&hotplug.global_list);
|
spa_list_init(&hotplug.global_list);
|
||||||
|
|
||||||
|
#if PW_CHECK_VERSION(0, 3, 75)
|
||||||
hotplug.have_1_0_5 = PIPEWIRE_pw_check_library_version(1,0,5);
|
hotplug.have_1_0_5 = PIPEWIRE_pw_check_library_version(1,0,5);
|
||||||
|
#else
|
||||||
|
hotplug.have_1_0_5 = false;
|
||||||
|
#endif
|
||||||
|
|
||||||
hotplug.loop = PIPEWIRE_pw_thread_loop_new("SDLPwCameraPlug", NULL);
|
hotplug.loop = PIPEWIRE_pw_thread_loop_new("SDLPwCameraPlug", NULL);
|
||||||
if (!hotplug.loop) {
|
if (!hotplug.loop) {
|
||||||
|
@@ -9,8 +9,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
|||||||
//
|
//
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 3,2,6,0
|
FILEVERSION 3,2,8,0
|
||||||
PRODUCTVERSION 3,2,6,0
|
PRODUCTVERSION 3,2,8,0
|
||||||
FILEFLAGSMASK 0x3fL
|
FILEFLAGSMASK 0x3fL
|
||||||
FILEFLAGS 0x0L
|
FILEFLAGS 0x0L
|
||||||
FILEOS 0x40004L
|
FILEOS 0x40004L
|
||||||
@@ -23,12 +23,12 @@ BEGIN
|
|||||||
BEGIN
|
BEGIN
|
||||||
VALUE "CompanyName", "\0"
|
VALUE "CompanyName", "\0"
|
||||||
VALUE "FileDescription", "SDL\0"
|
VALUE "FileDescription", "SDL\0"
|
||||||
VALUE "FileVersion", "3, 2, 6, 0\0"
|
VALUE "FileVersion", "3, 2, 8, 0\0"
|
||||||
VALUE "InternalName", "SDL\0"
|
VALUE "InternalName", "SDL\0"
|
||||||
VALUE "LegalCopyright", "Copyright (C) 2025 Sam Lantinga\0"
|
VALUE "LegalCopyright", "Copyright (C) 2025 Sam Lantinga\0"
|
||||||
VALUE "OriginalFilename", "SDL3.dll\0"
|
VALUE "OriginalFilename", "SDL3.dll\0"
|
||||||
VALUE "ProductName", "Simple DirectMedia Layer\0"
|
VALUE "ProductName", "Simple DirectMedia Layer\0"
|
||||||
VALUE "ProductVersion", "3, 2, 6, 0\0"
|
VALUE "ProductVersion", "3, 2, 8, 0\0"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
@@ -110,7 +110,7 @@ typedef struct
|
|||||||
} SDL_DisabledEventBlock;
|
} SDL_DisabledEventBlock;
|
||||||
|
|
||||||
static SDL_DisabledEventBlock *SDL_disabled_events[256];
|
static SDL_DisabledEventBlock *SDL_disabled_events[256];
|
||||||
static Uint32 SDL_userevents = SDL_EVENT_USER;
|
static SDL_AtomicInt SDL_userevents;
|
||||||
|
|
||||||
typedef struct SDL_TemporaryMemory
|
typedef struct SDL_TemporaryMemory
|
||||||
{
|
{
|
||||||
@@ -1893,9 +1893,11 @@ Uint32 SDL_RegisterEvents(int numevents)
|
|||||||
{
|
{
|
||||||
Uint32 event_base = 0;
|
Uint32 event_base = 0;
|
||||||
|
|
||||||
if ((numevents > 0) && (SDL_userevents + numevents <= SDL_EVENT_LAST)) {
|
if (numevents > 0) {
|
||||||
event_base = SDL_userevents;
|
int value = SDL_AddAtomicInt(&SDL_userevents, numevents);
|
||||||
SDL_userevents += numevents;
|
if (value >= 0 && value <= (SDL_EVENT_LAST - SDL_EVENT_USER)) {
|
||||||
|
event_base = (Uint32)(SDL_EVENT_USER + value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return event_base;
|
return event_base;
|
||||||
}
|
}
|
||||||
|
@@ -4634,7 +4634,11 @@ static Uint32 VULKAN_INTERNAL_CreateSwapchain(
|
|||||||
swapchainCreateInfo.imageSharingMode = VK_SHARING_MODE_EXCLUSIVE;
|
swapchainCreateInfo.imageSharingMode = VK_SHARING_MODE_EXCLUSIVE;
|
||||||
swapchainCreateInfo.queueFamilyIndexCount = 0;
|
swapchainCreateInfo.queueFamilyIndexCount = 0;
|
||||||
swapchainCreateInfo.pQueueFamilyIndices = NULL;
|
swapchainCreateInfo.pQueueFamilyIndices = NULL;
|
||||||
|
#ifdef SDL_PLATFORM_ANDROID
|
||||||
swapchainCreateInfo.preTransform = VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR;
|
swapchainCreateInfo.preTransform = VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR;
|
||||||
|
#else
|
||||||
|
swapchainCreateInfo.preTransform = swapchainSupportDetails.capabilities.currentTransform;
|
||||||
|
#endif
|
||||||
swapchainCreateInfo.compositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR;
|
swapchainCreateInfo.compositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR;
|
||||||
swapchainCreateInfo.presentMode = SDLToVK_PresentMode[windowData->presentMode];
|
swapchainCreateInfo.presentMode = SDLToVK_PresentMode[windowData->presentMode];
|
||||||
swapchainCreateInfo.clipped = VK_TRUE;
|
swapchainCreateInfo.clipped = VK_TRUE;
|
||||||
|
@@ -1135,12 +1135,13 @@ check_removed:
|
|||||||
goto check_removed;
|
goto check_removed;
|
||||||
} else {
|
} else {
|
||||||
HIDAPI_DelDevice(device);
|
HIDAPI_DelDevice(device);
|
||||||
|
device = NULL;
|
||||||
|
|
||||||
// Update the device list again in case this device comes back
|
// Update the device list again in case this device comes back
|
||||||
SDL_HIDAPI_change_count = 0;
|
SDL_HIDAPI_change_count = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (device->broken && device->parent) {
|
if (device && device->broken && device->parent) {
|
||||||
HIDAPI_DelDevice(device->parent);
|
HIDAPI_DelDevice(device->parent);
|
||||||
|
|
||||||
// We deleted a different device here, restart the loop
|
// We deleted a different device here, restart the loop
|
||||||
|
@@ -462,8 +462,8 @@ static void UpdatePixelClipRect(SDL_Renderer *renderer, SDL_RenderViewState *vie
|
|||||||
{
|
{
|
||||||
const float scale_x = view->current_scale.x;
|
const float scale_x = view->current_scale.x;
|
||||||
const float scale_y = view->current_scale.y;
|
const float scale_y = view->current_scale.y;
|
||||||
view->pixel_clip_rect.x = (int)SDL_floorf((view->clip_rect.x * scale_x) + view->logical_offset.x);
|
view->pixel_clip_rect.x = (int)SDL_floorf(view->clip_rect.x * scale_x);
|
||||||
view->pixel_clip_rect.y = (int)SDL_floorf((view->clip_rect.y * scale_y) + view->logical_offset.y);
|
view->pixel_clip_rect.y = (int)SDL_floorf(view->clip_rect.y * scale_y);
|
||||||
view->pixel_clip_rect.w = (int)SDL_ceilf(view->clip_rect.w * scale_x);
|
view->pixel_clip_rect.w = (int)SDL_ceilf(view->clip_rect.w * scale_x);
|
||||||
view->pixel_clip_rect.h = (int)SDL_ceilf(view->clip_rect.h * scale_y);
|
view->pixel_clip_rect.h = (int)SDL_ceilf(view->clip_rect.h * scale_y);
|
||||||
}
|
}
|
||||||
|
@@ -163,6 +163,8 @@ struct SDL_VideoDisplay
|
|||||||
float content_scale;
|
float content_scale;
|
||||||
SDL_HDROutputProperties HDR;
|
SDL_HDROutputProperties HDR;
|
||||||
|
|
||||||
|
// This is true if we are fullscreen or fullscreen is pending
|
||||||
|
bool fullscreen_active;
|
||||||
SDL_Window *fullscreen_window;
|
SDL_Window *fullscreen_window;
|
||||||
|
|
||||||
SDL_VideoDevice *device;
|
SDL_VideoDevice *device;
|
||||||
|
@@ -1435,6 +1435,11 @@ void SDL_SetDesktopDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode
|
|||||||
{
|
{
|
||||||
SDL_DisplayMode last_mode;
|
SDL_DisplayMode last_mode;
|
||||||
|
|
||||||
|
if (display->fullscreen_active) {
|
||||||
|
// This is a temporary mode change, don't save the desktop mode
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
SDL_copyp(&last_mode, &display->desktop_mode);
|
SDL_copyp(&last_mode, &display->desktop_mode);
|
||||||
|
|
||||||
if (display->desktop_mode.internal) {
|
if (display->desktop_mode.internal) {
|
||||||
@@ -1944,6 +1949,8 @@ bool SDL_UpdateFullscreenMode(SDL_Window *window, SDL_FullscreenOp fullscreen, b
|
|||||||
SDL_MinimizeWindow(display->fullscreen_window);
|
SDL_MinimizeWindow(display->fullscreen_window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
display->fullscreen_active = window->fullscreen_exclusive;
|
||||||
|
|
||||||
if (!SDL_SetDisplayModeForDisplay(display, mode)) {
|
if (!SDL_SetDisplayModeForDisplay(display, mode)) {
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
@@ -1961,6 +1968,7 @@ bool SDL_UpdateFullscreenMode(SDL_Window *window, SDL_FullscreenOp fullscreen, b
|
|||||||
SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_ENTER_FULLSCREEN, 0, 0);
|
SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_ENTER_FULLSCREEN, 0, 0);
|
||||||
}
|
}
|
||||||
} else if (ret == SDL_FULLSCREEN_FAILED) {
|
} else if (ret == SDL_FULLSCREEN_FAILED) {
|
||||||
|
display->fullscreen_active = false;
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1976,18 +1984,24 @@ bool SDL_UpdateFullscreenMode(SDL_Window *window, SDL_FullscreenOp fullscreen, b
|
|||||||
* This is also unnecessary on Cocoa, Wayland, Win32, and X11 (will send SDL_EVENT_WINDOW_RESIZED).
|
* This is also unnecessary on Cocoa, Wayland, Win32, and X11 (will send SDL_EVENT_WINDOW_RESIZED).
|
||||||
*/
|
*/
|
||||||
if (!SDL_SendsFullscreenDimensions(_this)) {
|
if (!SDL_SendsFullscreenDimensions(_this)) {
|
||||||
|
SDL_Rect displayRect;
|
||||||
|
|
||||||
if (mode) {
|
if (mode) {
|
||||||
mode_w = mode->w;
|
mode_w = mode->w;
|
||||||
mode_h = mode->h;
|
mode_h = mode->h;
|
||||||
|
SDL_GetDisplayBounds(mode->displayID, &displayRect);
|
||||||
} else {
|
} else {
|
||||||
mode_w = display->desktop_mode.w;
|
mode_w = display->desktop_mode.w;
|
||||||
mode_h = display->desktop_mode.h;
|
mode_h = display->desktop_mode.h;
|
||||||
|
SDL_GetDisplayBounds(display->id, &displayRect);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (window->w != mode_w || window->h != mode_h) {
|
if (window->w != mode_w || window->h != mode_h) {
|
||||||
resized = true;
|
resized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_MOVED, displayRect.x, displayRect.y);
|
||||||
|
|
||||||
if (resized) {
|
if (resized) {
|
||||||
SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_RESIZED, mode_w, mode_h);
|
SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_RESIZED, mode_w, mode_h);
|
||||||
} else {
|
} else {
|
||||||
@@ -2005,6 +2019,8 @@ bool SDL_UpdateFullscreenMode(SDL_Window *window, SDL_FullscreenOp fullscreen, b
|
|||||||
|
|
||||||
// Restore the desktop mode
|
// Restore the desktop mode
|
||||||
if (display) {
|
if (display) {
|
||||||
|
display->fullscreen_active = false;
|
||||||
|
|
||||||
SDL_SetDisplayModeForDisplay(display, NULL);
|
SDL_SetDisplayModeForDisplay(display, NULL);
|
||||||
}
|
}
|
||||||
if (commit) {
|
if (commit) {
|
||||||
@@ -2034,6 +2050,7 @@ bool SDL_UpdateFullscreenMode(SDL_Window *window, SDL_FullscreenOp fullscreen, b
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!SDL_SendsFullscreenDimensions(_this)) {
|
if (!SDL_SendsFullscreenDimensions(_this)) {
|
||||||
|
SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_MOVED, window->windowed.x, window->windowed.y);
|
||||||
if (resized) {
|
if (resized) {
|
||||||
SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_RESIZED, window->windowed.w, window->windowed.h);
|
SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_RESIZED, window->windowed.w, window->windowed.h);
|
||||||
} else {
|
} else {
|
||||||
|
@@ -644,7 +644,9 @@ static CGError SetDisplayModeForDisplay(CGDirectDisplayID display, SDL_DisplayMo
|
|||||||
result = CGDisplaySetDisplayMode(display, moderef, NULL);
|
result = CGDisplaySetDisplayMode(display, moderef, NULL);
|
||||||
if (result == kCGErrorSuccess) {
|
if (result == kCGErrorSuccess) {
|
||||||
// If this mode works, try it first next time.
|
// If this mode works, try it first next time.
|
||||||
|
if (i > 0) {
|
||||||
CFArrayExchangeValuesAtIndices(data->modes, i, 0);
|
CFArrayExchangeValuesAtIndices(data->modes, i, 0);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -915,7 +915,8 @@ static NSCursor *Cocoa_GetDesiredCursor(void)
|
|||||||
|
|
||||||
- (BOOL)hasPendingWindowOperation
|
- (BOOL)hasPendingWindowOperation
|
||||||
{
|
{
|
||||||
return pendingWindowOperation != PENDING_OPERATION_NONE ||
|
// A pending zoom may be deferred until leaving fullscreen, so don't block on it.
|
||||||
|
return (pendingWindowOperation & ~PENDING_OPERATION_ZOOM) != PENDING_OPERATION_NONE ||
|
||||||
isMiniaturizing || inFullscreenTransition;
|
isMiniaturizing || inFullscreenTransition;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3263,24 +3264,11 @@ bool Cocoa_SyncWindow(SDL_VideoDevice *_this, SDL_Window *window)
|
|||||||
bool result = true;
|
bool result = true;
|
||||||
|
|
||||||
@autoreleasepool {
|
@autoreleasepool {
|
||||||
/* The timeout needs to be high enough that animated fullscreen
|
|
||||||
* spaces transitions won't cause it to time out.
|
|
||||||
*/
|
|
||||||
Uint64 timeout = SDL_GetTicksNS() + SDL_MS_TO_NS(2000);
|
|
||||||
SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->internal;
|
SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->internal;
|
||||||
while (true) {
|
|
||||||
|
do {
|
||||||
SDL_PumpEvents();
|
SDL_PumpEvents();
|
||||||
|
} while ([data.listener hasPendingWindowOperation]);
|
||||||
if (SDL_GetTicksNS() >= timeout) {
|
|
||||||
result = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (![data.listener hasPendingWindowOperation]) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
SDL_Delay(10);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
@@ -48,13 +48,17 @@
|
|||||||
static const char g_MessageBoxFontLatin1[] =
|
static const char g_MessageBoxFontLatin1[] =
|
||||||
"-*-*-medium-r-normal--0-120-*-*-p-0-iso8859-1";
|
"-*-*-medium-r-normal--0-120-*-*-p-0-iso8859-1";
|
||||||
|
|
||||||
static const char g_MessageBoxFont[] =
|
static const char* g_MessageBoxFont[] = {
|
||||||
"-*-*-medium-r-normal--*-120-*-*-*-*-iso10646-1," // explicitly unicode (iso10646-1)
|
"-*-*-medium-r-normal--*-120-*-*-*-*-iso10646-1", // explicitly unicode (iso10646-1)
|
||||||
"-*-*-medium-r-*--*-120-*-*-*-*-iso10646-1," // explicitly unicode (iso10646-1)
|
"-*-*-medium-r-*--*-120-*-*-*-*-iso10646-1", // explicitly unicode (iso10646-1)
|
||||||
"-*-*-*-*-*--*-*-*-*-*-*-iso10646-1," // just give me anything Unicode.
|
"-misc-*-*-*-*--*-*-*-*-*-*-iso10646-1", // misc unicode (fix for some systems)
|
||||||
"-*-*-medium-r-normal--*-120-*-*-*-*-iso8859-1," // explicitly latin1, in case low-ASCII works out.
|
"-*-*-*-*-*--*-*-*-*-*-*-iso10646-1", // just give me anything Unicode.
|
||||||
"-*-*-medium-r-*--*-120-*-*-*-*-iso8859-1," // explicitly latin1, in case low-ASCII works out.
|
"-*-*-medium-r-normal--*-120-*-*-*-*-iso8859-1", // explicitly latin1, in case low-ASCII works out.
|
||||||
"-*-*-*-*-*--*-*-*-*-*-*-iso8859-1"; // just give me anything latin1.
|
"-*-*-medium-r-*--*-120-*-*-*-*-iso8859-1", // explicitly latin1, in case low-ASCII works out.
|
||||||
|
"-misc-*-*-*-*--*-*-*-*-*-*-iso8859-1", // misc latin1 (fix for some systems)
|
||||||
|
"-*-*-*-*-*--*-*-*-*-*-*-iso8859-1", // just give me anything latin1.
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
|
||||||
static const SDL_MessageBoxColor g_default_colors[SDL_MESSAGEBOX_COLOR_COUNT] = {
|
static const SDL_MessageBoxColor g_default_colors[SDL_MESSAGEBOX_COLOR_COUNT] = {
|
||||||
{ 56, 54, 53 }, // SDL_MESSAGEBOX_COLOR_BACKGROUND,
|
{ 56, 54, 53 }, // SDL_MESSAGEBOX_COLOR_BACKGROUND,
|
||||||
@@ -200,13 +204,19 @@ static bool X11_MessageBoxInit(SDL_MessageBoxDataX11 *data, const SDL_MessageBox
|
|||||||
if (SDL_X11_HAVE_UTF8) {
|
if (SDL_X11_HAVE_UTF8) {
|
||||||
char **missing = NULL;
|
char **missing = NULL;
|
||||||
int num_missing = 0;
|
int num_missing = 0;
|
||||||
data->font_set = X11_XCreateFontSet(data->display, g_MessageBoxFont,
|
int i_font;
|
||||||
|
for (i_font = 0; g_MessageBoxFont[i_font]; ++i_font) {
|
||||||
|
data->font_set = X11_XCreateFontSet(data->display, g_MessageBoxFont[i_font],
|
||||||
&missing, &num_missing, NULL);
|
&missing, &num_missing, NULL);
|
||||||
if (missing) {
|
if (missing) {
|
||||||
X11_XFreeStringList(missing);
|
X11_XFreeStringList(missing);
|
||||||
}
|
}
|
||||||
|
if (data->font_set) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!data->font_set) {
|
if (!data->font_set) {
|
||||||
return SDL_SetError("Couldn't load font %s", g_MessageBoxFont);
|
return SDL_SetError("Couldn't load x11 message box font");
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
|
@@ -78,6 +78,23 @@ static bool X11_IsXWayland(Display *d)
|
|||||||
return X11_XQueryExtension(d, "XWAYLAND", &opcode, &event, &error) == True;
|
return X11_XQueryExtension(d, "XWAYLAND", &opcode, &event, &error) == True;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool X11_CheckCurrentDesktop(const char *name)
|
||||||
|
{
|
||||||
|
SDL_Environment *env = SDL_GetEnvironment();
|
||||||
|
|
||||||
|
const char *desktopVar = SDL_GetEnvironmentVariable(env, "DESKTOP_SESSION");
|
||||||
|
if (desktopVar && SDL_strcasecmp(desktopVar, name) == 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
desktopVar = SDL_GetEnvironmentVariable(env, "XDG_CURRENT_DESKTOP");
|
||||||
|
if (desktopVar && SDL_strcasestr(desktopVar, name)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
static SDL_VideoDevice *X11_CreateDevice(void)
|
static SDL_VideoDevice *X11_CreateDevice(void)
|
||||||
{
|
{
|
||||||
SDL_VideoDevice *device;
|
SDL_VideoDevice *device;
|
||||||
@@ -256,8 +273,14 @@ static SDL_VideoDevice *X11_CreateDevice(void)
|
|||||||
device->system_theme = SDL_SystemTheme_Get();
|
device->system_theme = SDL_SystemTheme_Get();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
device->device_caps = VIDEO_DEVICE_CAPS_HAS_POPUP_WINDOW_SUPPORT |
|
device->device_caps = VIDEO_DEVICE_CAPS_HAS_POPUP_WINDOW_SUPPORT;
|
||||||
VIDEO_DEVICE_CAPS_SENDS_FULLSCREEN_DIMENSIONS;
|
|
||||||
|
/* Openbox doesn't send the new window dimensions when entering fullscreen, so the events must be synthesized.
|
||||||
|
* This is otherwise not wanted, as it can break fullscreen window positioning on multi-monitor configurations.
|
||||||
|
*/
|
||||||
|
if (!X11_CheckCurrentDesktop("openbox")) {
|
||||||
|
device->device_caps |= VIDEO_DEVICE_CAPS_SENDS_DISPLAY_CHANGES;
|
||||||
|
}
|
||||||
|
|
||||||
data->is_xwayland = X11_IsXWayland(x11_display);
|
data->is_xwayland = X11_IsXWayland(x11_display);
|
||||||
if (data->is_xwayland) {
|
if (data->is_xwayland) {
|
||||||
|
Reference in New Issue
Block a user