Commit Graph

20231 Commits

Author SHA1 Message Date
Ivan Epifanov
efaafd766e VITA: Remove unused/duplicate headers 2025-03-12 09:20:05 -07:00
Joshua T. Fisher
7746a9656e Fixup the mingw readme cmakelists 2025-03-11 19:42:28 -07:00
Sam Lantinga
2ce3dfdf1d Fixed Nintendo controller face button layout under Steam 2025-03-10 17:25:01 -07:00
Sam Lantinga
be6ed6e9c4 Fixed sscanf("026", "%1x%1x%1x", &r, &g, &b)
Fixes https://github.com/libsdl-org/SDL/issues/12510
2025-03-10 14:45:08 -07:00
Sam Lantinga
24339524c5 Use sized types when fixing undefined behavior 2025-03-10 09:12:40 -07:00
rohlem
f1d16e9b4d avoid UB (left shift of negative number) in SDL_windowsevents.c 2025-03-10 09:09:46 -07:00
Caleb Cornett
9fcca83512 gpu: Validate that CopyGPUTextureToTexture formats match 2025-03-09 17:29:47 -04:00
Frank Praznik
f2866418d4 wayland: Fix enum/boolean comparison and assignment 2025-03-09 11:55:05 -04:00
Cameron Gutman
597bfe6b27 mouse: Add internal integer mouse mode hint for sdl2-compat
Performing this inside SDL3 dramatically simplifies sdl2-compat. See https://github.com/libsdl-org/sdl2-compat/issues/372.
2025-03-08 19:06:36 -08:00
bobsayshilol
65cd2256c5 emscripten: Fix handling of special HTML targets
With ASAN enabled the existing code triggered null-pointer-dereference
in the strcmp since EMSCRIPTEN_EVENT_TARGET_WINDOW is a "fake" pointer
with the value ((const char*)2). In fixing this it was also noticed
that using the #window/#document/#screen targets as mentioned in the
docs fails since document.querySelector() returns null for them and we
should instead be mapping them to the special HTML targets provided.
2025-03-08 17:15:43 -08:00
TheMode
5d804a39d9 Implement SDL_GetSystemRAM and SDL_GetNumLogicalCPUCores for the 3ds (#12494) 2025-03-08 09:51:37 -08:00
Sam Lantinga
99336ea378 Fixed memory leak in memory leak tracking 2025-03-08 09:18:25 -08:00
ds-sloth
0306b5a865 Fix n3ds/SDL_syssem.c:SDL_SignalSemaphore (libsdl-org/SDL#12411) 2025-03-07 17:31:06 -08:00
Sam Lantinga
3353b92a96 Fixed pen events on iOS after reinitializing SDL
We weren't resetting apple_pencil_id, so not re-registering it later.
2025-03-07 16:32:53 -08:00
Frank Praznik
ad2584813f cocoa: Ignore both clicks and motion on tooltip windows 2025-03-07 15:05:18 -05:00
Frank Praznik
fe245c6e0d x11: Always synthesize size events for external windows
External windows may call this to update the renderer size, but not pump SDL events, either by syncing or running an event loop, so the size event always needs to be synthesized for external windows. If it is wrong, the true size will be sent if/when events are processed.
2025-03-07 14:12:14 -05:00
Frank Praznik
84d047cc11 wayland: Rollback the round trip when reading data offers
The bug this appeared to fix turned out to be randomly occurring and has other causes, and the read pipe is already polled for readiness, so this extra overhead isn't necessary.
2025-03-07 13:02:23 -05:00
SDL Wiki Bot
fc35107854 Sync SDL3 wiki -> header
[ci skip]
2025-03-07 17:01:23 +00:00
Sam Lantinga
d631a3add0 Add a link to docs/INTRO-mingw.md 2025-03-06 16:25:17 -08:00
Joshua T. Fisher
04b4577b58 Added MinGW Intro readme, touched up CMake and Visual Studio readmes. (#12485) 2025-03-06 16:24:16 -08:00
Sam Lantinga
b99ff00a95 Removed logic forcing vsync on if setting it off fails
The platforms that needed this (Windows Phone and Windows RT) are no longer supported, and if this is needed in the future it should be done at the renderer level, not here.

Fixes https://github.com/libsdl-org/SDL/issues/12475
2025-03-06 16:18:02 -08:00
SDL Wiki Bot
55695d3725 Sync SDL3 wiki -> header
[ci skip]
2025-03-06 20:23:18 +00:00
Frank Praznik
9c7c11f259 wayland: Roundtrip when receiving data offers
Otherwise, the receive operation might not have completed, resulting in there being no data to read.
2025-03-06 11:51:57 -05:00
Frank Praznik
c4be7f77a6 wayland: Add additional MIME types for text drag & drop
Previously, it only specifically accepted "text/plain;charset=utf8", which caused it to reject valid text from certain apps.
2025-03-06 11:51:57 -05:00
Sam Lantinga
e20e27e1fb Added SIMD blitters for 8888 -> 8888 format conversion 2025-03-06 02:14:54 -08:00
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