Commit Graph

20206 Commits

Author SHA1 Message Date
Sam Lantinga
4c82b5843e Added support for SDL_PIXELFORMAT_MJPG to SDL_DuplicateSurface()
Fixes https://github.com/libsdl-org/SDL/issues/12472
2025-03-05 23:33:26 -08:00
Sam Lantinga
cb099ebd4f Make texture scale mode a part of the 2D renderer draw state
Also added texture addressing mode support to the PSP and Vita renderers (untested)

Fixes https://github.com/libsdl-org/SDL/issues/12461
2025-03-05 21:35:04 -08:00
Frank Praznik
6e2d3c9b5d x11: Enable legacy synchronization for external window resize and move events
External windows often handle their own events, and SDL implicitly processing events during synchronization can be unexpected and cause issues. For requests that don't change the window state beyond size or position, use the legacy synchronization method that synthesizes events from the window attributes without processing events.
2025-03-05 17:56:28 -05:00
SDL Wiki Bot
bdde074688 Sync SDL3 wiki -> header
[ci skip]
2025-03-05 22:49:13 +00:00
Sam Lantinga
49af576940 Disable XTest by default
On Ubuntu 24.04 running XWayland, XTestFakeMotionEvent() appears to succeed but doesn't actually move the cursor, even if the cursor is hidden.
2025-03-05 13:23:02 -08:00
Sam Lantinga
794ff283e2 Added support for using XTest to warp the mouse 2025-03-05 13:23:02 -08:00
Sam Lantinga
fae324dacb Update XSync code to match SDL3 conventions 2025-03-05 13:23:02 -08:00
SDL Wiki Bot
f01bcaeb17 Sync SDL3 wiki -> header
[ci skip]
2025-03-05 17:08:00 +00:00
Sam Lantinga
fe9bdcf508 Added SDL_HINT_VIDEO_X11_EXTERNAL_WINDOW_INPUT 2025-03-05 09:07:05 -08:00
SDL Wiki Bot
9f557941f3 Sync SDL3 wiki -> header
[ci skip]
2025-03-05 15:25:22 +00:00
Sam Lantinga
8f40dad460 Document the thread safety of SDL surface functions 2025-03-05 07:24:24 -08:00
Sam Lantinga
aef240b2e4 Fixed continuous logging if returning to desktop mode fails on X11 2025-03-04 17:24:29 -08:00
Sam Lantinga
e9632c83c7 Handle XWayland not sending display disconnected events
Also updated X11_CheckDisplaysMoved() to handle multiple X11 screens

Fixes https://github.com/libsdl-org/SDL/issues/12462
2025-03-04 17:23:23 -08:00
Sam Lantinga
ca9bc6b164 Revert "Ignore BadRROutput errors from XRRGetOutputInfo()"
This reverts commit 0c8ddc1f0a.

The real bug here is that XWayland isn't sending us a display disconnected event, which will be handled in the next commit.
2025-03-04 17:16:35 -08:00
Sam Lantinga
0c8ddc1f0a Ignore BadRROutput errors from XRRGetOutputInfo()
Fixes https://github.com/libsdl-org/SDL/issues/12462
2025-03-04 16:08:41 -08:00
Sam Lantinga
80ae3a7516 Fixed crash when restoring the desktop mode on macOS
Fixes https://github.com/libsdl-org/SDL/issues/12460
2025-03-04 14:31:51 -08:00
Sam Lantinga
5f07347e4f Fixed crash unplugging a HIDAPI controller 2025-03-04 11:42:17 -08:00
Sam Lantinga
82552e5b7c Make SDL_RegisterEvents() thread-safe
Fixes https://github.com/libsdl-org/SDL/issues/12457
2025-03-04 10:27:55 -08:00
Frank Praznik
9f9a442823 video: Synthesize fullscreen related moves if the driver does not. 2025-03-04 12:41:06 -05:00
Frank Praznik
e7abbf158a x11: Synthesize fullscreen size events on Openbox
Openbox doesn't send size events when entering fullscreen, so they must be synthesized. This is not desirable on any other window manager, as it can break fullscreen positioning on multi-monitor configurations.
2025-03-04 12:41:06 -05:00
Sam Lantinga
5d20bbf348 Presenting while drawing to a render target should fail.
People are adding present calls while rendering to render targets, not understanding that this doesn't make sense, and wondering why they get flicker on some systems. If there are programs that relied on the previous behavior we can add a hint to control this.

Fixes https://github.com/libsdl-org/SDL/issues/12432
2025-03-04 08:46:13 -08:00
Volian0
debbe1cf75 Fix for Message Box failing to init on X11 (#12455)
Fixed X11 message boxes failing to initialize, because the proper X Logical Font Description could not be found
2025-03-04 08:29:08 -08:00
Sam Lantinga
4bb46e93c8 Fixed clip rect when logical presentation is enabled
We don't need to include the logical offset, it's already included in the viewport.

Fixes https://github.com/libsdl-org/SDL/issues/12454
2025-03-04 08:24:18 -08:00
SDL Wiki Bot
7df0ffd436 Sync SDL3 wiki -> header
[ci skip]
2025-03-04 13:27:13 +00:00
Sam Lantinga
7c29c8b266 Added fullscreen_active to better track fullscreen state
This is true if fullscreen is pending or currently active. This is a better check in SDL_SetDesktopDisplayMode() because a fullscreen mode may be pending and complete asynchronously and the window hasn't been set to fullscreen yet.
2025-03-03 21:18:42 -08:00
Frank Praznik
3b9f0dff10 Use _this pointer to reference the video device 2025-03-03 18:39:44 -05:00
Frank Praznik
0ccf272eea Check the display device before dereferencing
It can be null if the desktop mode is set early during initial display enumeration.
2025-03-03 11:24:25 -05:00
Frank Praznik
6c347cbf33 video: Handle Cocoa desktop mode switch inhibition in the video layer
The X backend had the same issue, so both Cocoa and X can be handled in the same location.
2025-03-03 10:50:20 -05:00
Sam Lantinga
24ec2ed785 Don't save temporary mode changes to the desktop mode
Fixes https://github.com/libsdl-org/SDL/issues/12441
2025-03-03 07:40:55 -08:00
Simon McVittie
d57aa6f7af pipewire: Don't require pw_check_library_version() with Pipewire < 0.3.75
The Debian 12 'bookworm' stable release only has 0.3.65, which is earlier
than the introduction of that symbol. Similarly, Steam Runtime 3 'sniper'
and Steam Runtime 2 'soldier' have a backport of 0.3.65 from Debian 12,
so they have the same limitation.

steamrt/tasks#686

Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-03-03 07:32:19 -08:00
Caleb Cornett
113eb6f01d gpu: Add BC2_RGBA_UNORM_SRGB to GetBlockWidth/Height functions 2025-03-03 01:35:16 -05:00
Sam Lantinga
2c7c3d4d7b Only use VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR on Android
This fixes Nintendo Switch where the identity bit isn't available. We only needed this on Android to automatically handle device user orientation.
2025-03-02 09:12:48 -08:00
Ozkan Sezer
ca3c5fd409 fix build: s/SDL_DetectSandbox/SDL_GetSandbox/ 2025-03-02 19:40:02 +03:00
kemal
eac63b4735 Add the definition for DBUS_TYPE_UNIX_FD to SDL_dbus.h 2025-03-02 08:03:57 -08:00
kemal
16f12c0d55 Implement the XDP Camera portal
This helps the Pipewire camera driver to access cameras
in a sandboxed environment without host Pipewire socket access.
Unlike other platforms, no event is sent when the user rejects
camera access. This is because there is no mechanism to query
cameras through the portal, and we only obtain access to the
Pipewire fd if the user accepts the request. The Pipewire driver
will attempt to open the host socket instead.
2025-03-02 08:03:57 -08:00
SDL Wiki Bot
c3b415641a Sync SDL3 wiki -> header
[ci skip]
2025-03-02 15:56:34 +00:00
SDL Wiki Bot
2a0223487f Sync SDL3 wiki -> header
[ci skip]
2025-03-02 15:55:59 +00:00
Sam Lantinga
1a7c206986 Save and restore error messages when rolling back after failed init
Fixes https://github.com/libsdl-org/SDL/issues/12439
2025-03-02 07:55:56 -08:00
Sam Lantinga
2c46c3d5b7 Updated dynamic API for new functions 2025-03-02 07:53:51 -08:00
expikr
5373271a12 forbid transform change while relative mode active 2025-03-02 07:53:09 -08:00
expikr
428f0dcd61 add SDL_SetRelativeMouseTransform 2025-03-02 07:53:09 -08:00
Arkadiusz Lach
67127afe3f Fix from #12118 2025-03-02 07:52:25 -08:00
Arkadiusz Lach
e25ee22469 Added tiled 9-grid texture rendering function
* New function SDL_RenderTexture9GridTiled, borders and center is tiled instead of stretched
2025-03-02 07:52:25 -08:00
SDL Wiki Bot
954675b32a Sync SDL3 wiki -> header
[ci skip]
2025-03-02 15:52:11 +00:00
Arkadiusz Lach
44bca81fdd Change default texture scale mode per renderer
* SDL_SetDefaultTextureScaleMode(SDL_Renderer *renderer, SDL_ScaleMode scale_mode)
* SDL_GetDefaultTextureScaleMode(SDL_Renderer *renderer, SDL_ScaleMode *scale_mode)
2025-03-02 07:51:17 -08:00
Caleb Cornett
b0d2a4f355 gpu: Fix Z offset for D3D12 realigned 3D texture uploads 2025-03-02 00:04:57 -05:00
Frank Praznik
b69201daeb cocoa: Don't overwrite the desktop mode when changing the fullscreen mode
Changing the mode triggers a display reconfiguration event, which will overwrite the desktop mode with the set fullscreen mode, preventing proper restoration when leaving fullscreen. Don't overwrite the desktop mode if the reconfiguration is due to a fullscreen mode switch.
2025-03-01 22:55:38 -05:00
Frank Praznik
078d737a27 cocoa: Run pending events to completion
Fullscreen spaces and miniaturization will always give us some notification that they succeeded or failed, so the timeout isn't required. This prevents errant timeouts when live-resize is active.
2025-03-01 19:33:38 -08:00
Sam Lantinga
b0df1cbbef Updated to version 3.3.0 for development 2025-03-01 19:31:00 -08:00
Sam Lantinga
65864190cc Added testpen to the Xcode test project release-3.2.6 2025-03-01 18:49:25 -08:00