Commit Graph

20231 Commits

Author SHA1 Message Date
Sam Lantinga
195ad85ba4 Fixed typo 2025-05-06 16:08:03 -07:00
Frank Praznik
f4813ca2cf x11: Filter out duplicate key presses when an IME is active
IME text events can result in sending duplicate key press events, which will result in undesired repeated key presses. Since the events are exact duplicates, compare the serials to filter out redundant key down events.
2025-05-06 18:06:14 -04:00
Sam Clegg
8e1f4bafb4 [emscripten] Remove referenc to Module['createContext']
The Module interface is the one used by the outside world.  This code
is inside the module itself so can use the internal name, avoiding the
need to export this function on the Module at all.

See https://github.com/emscripten-core/emscripten/pull/24269
2025-05-06 14:16:26 -07:00
Ivan Epifanov
1dbb813316 VITA: fix audio playback 2025-05-06 12:55:22 -07:00
SDL Wiki Bot
20f783532b Sync SDL3 wiki -> header
[ci skip]
2025-05-06 17:21:29 +00:00
SDL Wiki Bot
bbd973c8d2 Sync SDL3 wiki -> header
[ci skip]
2025-05-06 16:46:42 +00:00
SDL Wiki Bot
71303b41bf Sync SDL3 wiki -> header
[ci skip]
2025-05-06 05:16:13 +00:00
Ryan C. Gordon
a7344206e8 wikiheaders: Patched to compile.
(whoops.)
2025-05-05 23:58:59 -04:00
Ryan C. Gordon
06c2f9fcfc wikiheaders: Correct wiki README digest links. 2025-05-05 23:56:12 -04:00
Ryan C. Gordon
ad46394e82 wikiheaders: README.md should be READMEs.md
So it doesn't conflict with the old README directory.
2025-05-05 23:49:06 -04:00
Ryan C. Gordon
2c97a48c51 wikiheaders: READMEs go in the base dir of the wiki now.
Reference PR #12529.

(and several other issues.)
2025-05-05 23:36:08 -04:00
Ryan C. Gordon
92a5417a98 docs: Tweak some minor things to keep wikiheaders happy.
You can't have two sections with the same name (so it can generate unique
page anchors), so fix one of these, and tweak another thing that _isn't_ a
header but wikiheader's quick-and-dirty parser thinks is one.
2025-05-05 23:34:20 -04:00
Sam Lantinga
d357aa29a3 Fixed initializing the OpenVR driver 2025-05-05 15:52:28 -07:00
Sam Lantinga
f8c77908ad Use motor sequence ID 0 in the HIDAPI GIP driver
Using a 0 sequence number is always allowed and avoids having to synchronize sequence numbers with the controller (and potentially confusing other things talking to the controller)

Also fixes occasional long running rumble at controller connection.
2025-05-05 15:06:54 -07:00
Frank Praznik
33e5f4885a x11: Don't update grab on enter when the mouse is captured
The xserver will still send EnterNotify events while the pointer is captured, and the grab shouldn't be updated in these cases, as it will cause the capture to be lost.
2025-05-05 12:25:50 -04:00
Frank Praznik
1abac3ccc3 Revert "x11: Better handle XInput2 mouse tracking outside the window"
This reverts commit 8c733d1f7b.
2025-05-05 12:25:50 -04:00
SDL Wiki Bot
85d2345bd8 Sync SDL3 wiki -> header
[ci skip]
2025-05-05 15:21:20 +00:00
SDL Wiki Bot
5bd886519b Sync SDL3 wiki -> header
[ci skip]
2025-05-05 15:10:37 +00:00
Frank Praznik
c6362b4788 tests: Revert some leftover testing code 2025-05-05 11:08:15 -04:00
Frank Praznik
c91f9f6968 x11: #ifdef the XRandR path in the message box code
The runtime check isn't sufficient as the functions are undefined if built without XRandR.
2025-05-05 10:45:54 -04:00
A. Wilcox
7490471796 cpuinfo: Use auxv for AltiVec on Linux if possible
The SIGILL handler is not very reliable and can cause crashes.

Linux provides the CPU's AltiVec support status in getauxval.
2025-05-04 13:52:21 -07:00
Ozkan Sezer
17bba029ba don't prototype strdup() for __clang_analyzer__ case in windows builds.
Fixes:  https://github.com/libsdl-org/SDL/issues/12948.
2025-05-04 10:35:31 -07:00
Katharine Chui
15c6acf74f capture g27 shifter r input
ref: d97f782315/pico_lgff_wheel_adapter/reports.h (L265-L310)
2025-05-03 08:10:41 -07:00
Ryan C. Gordon
795d1ae1fb testmessage: Don't push the event if "Retry" was chosen.
Otherwise, the message box thread goes back to blocking, but the app's main
thread progresses to SDL_WaitThread and won't pump the event queue anymore.

On iOS, this means the messagebox won't pop back up (because it uses
SDL_RunOnMainThread, which needs the event loop to pump), but it's just bad
practice on any platform to stop pumping the event queue for indefinite
lengths of time.
2025-05-02 21:42:47 -04:00
Frank Praznik
d73fe0bc53 win32: Hide the borders when showing a fullscreen window
If it is known that the window will immediately enter fullscreen upon being shown, set the borderless style when showing the window to hide the borders, or they may linger in the background if the client takes some time to draw the first frame.

Unnecessarily calling ShowWindow with SW_RESTORE when applying the window flags must be suppressed in this case, or the borders can reappear in a weird, partial state.
2025-05-02 14:21:36 -04:00
Sam Lantinga
ab12b7cbba Added support for the share button on the GameSir-K1 FLUX controller 2025-05-02 10:15:16 -07:00
Sam Lantinga
1e6a25324c Added support for the PowerA Battle Dragon Advanced Wireless Controller 2025-05-02 10:01:13 -07:00
Ryan C. Gordon
57346f2ba8 dialog: Cocoa backend should reactivate the app after the modal dialog.
Otherwise the window won't have focus until you click on it again. Calling
makeKeyAndOrderFront isn't enough to fix it, either.

This trick comes from a similar problem we solve in our
applicationDidFinishLaunching implementation: activate (give app focus to) the
system Dock, as something that definitely exists that isn't us and is harmless
to activate, and then activate us right afterwards. This unconfuses whatever
is getting confused inside Cocoa.

Fixes #12684.
2025-05-02 01:52:42 -04:00
Sam Lantinga
caf269ce00 Added a link to the GIP documentation 2025-05-01 21:35:10 -07:00
Sam Lantinga
34c045aa39 Fixed paddles on the Xbox Elite controller using the GIP driver 2025-05-01 21:35:10 -07:00
Cameron Gutman
0447c2f3c3 events: Add integer wheel fields for sdl2-compat
It's way simpler to just add them back to SDL3 than emulate them purely in sdl2-compat.
2025-05-01 22:50:52 -05:00
Sam Lantinga
ae251a05be Fixed warning: no previous prototype for function 'GIP_ParseMetadata' 2025-05-01 15:39:49 -07:00
Ryan C. Gordon
193b0c8963 uikit: Use SDL_RunOnMainThread instead of dispatch_sync for message boxes.
Reference Issue #12741.
2025-05-01 18:28:53 -04:00
Ryan C. Gordon
691cc5bb5e dialog: Cocoa shouldn't crash if there's a '.' in the filters.
So something like "index.pb" will now accept any file with a ".pb" extension,
to make macOS happy. This seems like a reasonable tradeoff.

Other minor cleanups.

Fixes #12778.
2025-05-01 18:11:36 -04:00
Temdog007
4ef8b6ce1b X11: Center Message Box on Multi Monitor Displays (#12819)
Use XRandr to find the position of the current screen to center the message box on that window
2025-05-01 13:38:52 -07:00
Frank Praznik
c5d5967c3a video: Store the preferred fullscreen display in a property for sdl2-compat
sdl2-compat will call SDL_GetDisplayForWindow() when querying the display to use for fullscreen, which won't always be correct if the backend can't actually reposition the window. When calling this function, get the ideal fullscreen display and store it in a property for retrieval by sdl2-compat.
2025-05-01 11:24:34 -07:00
SDL Wiki Bot
11e1d4a145 Sync SDL3 wiki -> header
[ci skip]
2025-05-01 18:05:25 +00:00
Vicki Pfau
00f3a82ada Joystick: Add new GIP driver to replace old Xbox One wired driver
This new driver is based on official documentation released by Microsoft in
September, though it still lacks several important features, notably the
Security handshake for wireless dongles and audio support. It is, however, more
reliable and extensible than the old driver.
2025-05-01 11:04:33 -07:00
Sam Lantinga
48dfc03a87 Added the gamepad hint SDL_GAMECONTROLLER_USE_GAMECUBE_LABELS
This is for internal use to signal that a mapping uses positional GameCube buttons. It's set so we know whether a mapping uses the older style labeled buttons or the newer style positional buttons. If a positional mapping is used with SDL2, then it will be ignored, since the hint is marked as defaulting true and the mapping conditional is that the hint is false.
2025-05-01 10:54:16 -07:00
Sam Lantinga
21a7bbbf14 Restore compatibility with older GameCube mappings
Restore the original button values for GameCube controllers, but swap labeled mappings to positional while loading mappings

Fixes https://github.com/libsdl-org/SDL/issues/12847
2025-05-01 10:54:16 -07:00
Dimitriy Ryazantcev
3730128e33 Simplify WIN_CreateHCursor (#12933) 2025-05-01 08:32:12 -07:00
Frank Praznik
6a0505c090 wayland: Remove unnecessary function call 2025-05-01 11:30:16 -04:00
Frank Praznik
fdd8b5d630 wayland: Query the mouse global button states from the seats
Mouse button events that trigger a hit test are not passed to the client, but the client may still query the global mouse button state from within the hit test handler, so the reported buttons need to be accurate. Query the buttons directly from the seat instead of the higher global mouse state to match the behavior of other platforms.
2025-05-01 11:26:32 -04:00
Sam Lantinga
e3df61b070 Fixed right mouse button emulation when using a pen
Pen button 1 is typically used as right click. Pen button 2 (Wacom eraser) doesn't have a specific mapping, but we'll use middle click for now.
2025-04-30 11:07:31 -07:00
Sam Lantinga
106ccc722e Fixed missing simulated mouse events using a Wacom tablet
The low 16-bits of the message extra info is an event sequence number when using the Wacom tablet with Windows Ink disabled. The high bits of normal mouse motion when using touch input match the touch signature, 0xFF515700. The high bits of raw input mouse motion when using touch input do not match that signature, so we have to check for the touch bit in that case.

Fixes https://github.com/libsdl-org/SDL/issues/12927
2025-04-30 11:07:31 -07:00
Sam Lantinga
8ae962c904 Fixed build 2025-04-29 19:06:42 -07:00
Sam Lantinga
e04064350f Fixed right click mouse emulation for the Wacom tablet
The problems are two-fold. When this happens a WM_POINTERDOWN event is sent with IS_POINTER_INCONTACT_WPARAM() evaluating as true. So when SDL_SendPenButton() is sent for the barrel button, there is no pen in contact yet, so the right mouse button is sent. Then SDL_SendPenTouch() is sent, which generates a left button press event.

Fixes https://github.com/libsdl-org/SDL/issues/12926
2025-04-29 19:03:42 -07:00
Evan Hemsley
a163257295 GPU: Validate that textures are not bound for both read and write on render passes (#12925) 2025-04-29 16:52:52 -07:00
Ryan C. Gordon
ea67133e4f pen: Windows can't check WM_POINTER[DOWN|UP] for touches directly.
These events fire for other things, such as pressing a barrel button while
the pen is hovering.

The correct thing to do is check IS_POINTER_INCONTACT_WPARAM in the event.

If the pen is already touching or not, SDL_SendPenTouch() will do the right
thing, so it's safe to call it even if we're already in the right state.
2025-04-29 18:53:38 -04:00
SDL Wiki Bot
f131791005 Sync SDL3 wiki -> header
[ci skip]
2025-04-29 22:48:45 +00:00