Commit Graph

20231 Commits

Author SHA1 Message Date
Evan Hemsley
e1a41c1c97 GPU Vulkan: Add locks for layout object lookups (#12924) 2025-04-29 15:43:28 -07:00
SDL Wiki Bot
fd5380ffc6 Sync SDL3 wiki -> header
[ci skip]
2025-04-29 16:04:31 +00:00
Frank Praznik
b871ac0d97 Add support for non-constrained and non-grabbing popups
By default, popups are automatically constrained to be completely within display bounds, so as not to cut off information and result in an unusable menu, or unreadable tooltip. In some cases, however, this is not wanted, so a property to toggle this behavior is added.

There are also cases where the client may not want a popup menu to implicitly grab the keyboard focus, as is the default behavior, so popup menus now respect the focusable flag/property, as well as being able to toggle focus grabbing via SDL_SetWindowFocusable().
2025-04-29 12:02:14 -04:00
Sam Lantinga
8abcc27535 Removed timeout in SDL_RunOnMainThread()
Fixes https://github.com/libsdl-org/SDL/issues/12923
2025-04-29 08:56:56 -07:00
Sam Lantinga
ef54c3bf18 Always enable D3D12 GPU on Windows
This isn't dependent on the render subsystem

Fixes https://github.com/libsdl-org/SDL/issues/12922
2025-04-29 08:51:26 -07:00
Cameron Gutman
39d3148185 events: Fix undefined behavior when disabling some event types
Shifting a signed int left by 31 is UB.
2025-04-29 00:10:33 -05:00
expikr
510c7edd9b migrate usage of SetCursor(NULL) to RedrawCursor() 2025-04-28 09:41:44 -07:00
expikr
4779499048 Split the redraw effect to own function 2025-04-28 09:41:44 -07:00
expikr
6c172e5220 SDL_SetCursor should not skip focus check 2025-04-28 09:41:44 -07:00
Maia
cbf44700d8 bytepusher example: always render text to render target and remove unused variable 2025-04-28 09:40:07 -07:00
SDL Wiki Bot
faddff1bcc Sync SDL3 wiki -> header
[ci skip]
2025-04-27 18:02:41 +00:00
Sam Lantinga
31650d566c Added SDL_GAMEPAD_TYPE_GAMECUBE
The GameCube controller has a different face button layout than the Xbox or Nintendo Switch style controllers. It has the B button on the left and the X button on the right, so we should map those to SDL_GAMEPAD_BUTTON_WEST with SDL_GAMEPAD_BUTTON_LABEL_B and SDL_GAMEPAD_BUTTON_EAST with SDL_GAMEPAD_BUTTON_LABEL_X respectively.

Fixes https://github.com/libsdl-org/SDL/issues/12847
2025-04-27 11:01:50 -07:00
expikr
c4d5cc358f streamline boolean logic 2025-04-27 10:25:43 -07:00
expikr
441e7e488f invert cursor_visible to hide_cursor 2025-04-27 10:25:43 -07:00
expikr
d553372682 rename cursor_shown to cursor_visible 2025-04-27 10:25:43 -07:00
Ozkan Sezer
016ba86f93 tray, unix: make pointers g_object_ref and g_object_ref_sink static
Fixes:  https://github.com/libsdl-org/SDL/issues/12908.
2025-04-27 11:34:40 -04:00
Frank Praznik
6f5892e543 cocoa: Immediately update the mouse focus when showing/hiding a popup menu
When showing or hiding a popup menu, manually check and set the focus if the new topmost window under the cursor is an SDL window. Otherwise, the focus won't be updated until the cursor is actually moved.
2025-04-27 09:38:52 -04:00
Frank Praznik
8c733d1f7b x11: Better handle XInput2 mouse tracking outside the window
There is a quirk with XInput2 mouse capture that causes a leave event to be sent if the pointer moves out->in->out, which breaks mouse tracking outside the window. If the mouse leaves the window with buttons pressed, continue tracking it until the buttons are released.
2025-04-26 11:20:37 -04:00
Ozkan Sezer
0dbf585ace fix SDL_audiocvt.c MSVC build. 2025-04-26 05:50:00 +03:00
Ryan C. Gordon
af0972c33f audio: SDL_PutAudioStreamPlanarData should take a channel count.
Fixes #12894.
2025-04-25 21:13:04 -04:00
Ryan C. Gordon
5f03cb3882 d3d12: Patched to compile with GDK builds.
Fixes #12899.
2025-04-25 20:07:35 -04:00
Ozkan Sezer
360cc2791f test/msdf_font.bmp: mark as non-executable. 2025-04-26 02:39:20 +03:00
SDL Wiki Bot
34fe967f3e Sync SDL3 wiki -> header
[ci skip]
2025-04-25 23:31:01 +00:00
Ryan C. Gordon
22692e308f events: Added SDL_GetEventDescription().
Fixes #12877.
2025-04-25 19:30:05 -04:00
Sam Lantinga
c2ed58db7b windows: Fix stale zoom/iconic state in WM_WINDOWPOSCHANGED handler
- IsIconic/IsZoomed must be checked after sending SDL_EVENT_WINDOW_SHOWN as that may trigger window operations if any are pending from when
  the window was hidden. e.g. the window may be shown, which triggers SDL_MaximizeWindow and a new WM_WINDOWPOSCHANGED where
  SDL_EVENT_WINDOW_MAXIMIZED is sent, then control returns to the original WM_WINDOWPOSCHANGED which would not think the window is zoomed
  and send SDL_EVENT_WINDOW_RESTORED.
2025-04-25 16:21:44 -07:00
Austin Almond
14ae45c2b8 GDK: Handle ProjectDir with space
The call to compile_shaders_xbox.bat fails if ProjectDir contains a space. Wrapping the command in quotes fixes the issue.
2025-04-25 15:00:51 -07:00
Ryan C. Gordon
faa2e40406 gpu: Warn about Direct3D 12 texture alignment requirements.
Fixes #12835.
2025-04-25 15:09:13 -04:00
SDL Wiki Bot
2e45198299 Sync SDL3 wiki -> header
[ci skip]
2025-04-25 18:14:48 +00:00
Ryan C. Gordon
608f706a95 audio: Added SDL_SetAudioIterationCallbacks(). 2025-04-25 14:13:53 -04:00
Ryan C. Gordon
18a86ea6bb testaudio: Use SDL_SetAppMetadata at startup.
This helps in finding its outputs in system lists of PipeWire streams, etc.
2025-04-25 13:03:09 -04:00
Ryan C. Gordon
a9bee3c0bf pipewire: Use a more specific stream name than "Audio Stream".
This info shows up in `pw-top` ...Gnome's sound preferences (etc) would
already show something more app-specific, but this command line tool shows
specific stream names.
2025-04-25 13:03:08 -04:00
Ryan C. Gordon
2767c1a440 aaudio: We PlayDevice first and WaitDevice after; reduce semaphore count by 1.
Previously, we would WaitDevice first, but that would feed a silent buffer
to AAudio upfront, introducing latency. When this change was made, the
semaphore count should have been adjusted, since we're waiting on one less
buffer.

Fixes #12882.
2025-04-25 13:03:08 -04:00
Sam Lantinga
7642c0468d Log information about Wayland environment detection 2025-04-25 10:02:03 -07:00
Anonymous Maarten
5b1e92ae88 cmake: use CMAKE_ANDROID_NDK variable as root of Android ndk
This variable is always defined when targeting Android:
- when using the toolchain file shipped along the ndk
  (using  -DCMAKE_TOOLCHAIN_FILE=$ENV{ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake)
- when using the toolchain file provided by CMake
  (using -DCMAKE_SYSTEM_NAME=Android)
2025-04-25 07:58:16 -07:00
Frank Praznik
09b2aae47e cocoa: Popup menus always accept first click 2025-04-25 09:34:29 -04:00
SDL Wiki Bot
29ef31d589 Sync SDL3 wiki -> header
[ci skip]
2025-04-25 03:49:37 +00:00
SDL Wiki Bot
15cb9bd610 Sync SDL3 wiki -> header
[ci skip]
2025-04-25 03:42:51 +00:00
Ryan C. Gordon
b28449a58c audio: Tweak SDL_GetAudioDeviceName.
- Add checks that ObtainPhysicalAudioDevice() was previously doing
  (is subsystem initialized, is device valid).
- Remove optimizations that copy string to stack to release device_hash_lock
  before SDL_GetPersistentString is called. Probably not necessary, and made
  the code more complex.
2025-04-24 22:17:13 -04:00
Sam Lantinga
da3c864d4c Reset the keyboard when entering a modal loop on Windows
Fixes https://github.com/libsdl-org/SDL/issues/12876
2025-04-24 13:58:17 -07:00
expikr
a82f70dc21 use GetMessagePos instead of GetCursorPos 2025-04-24 13:27:22 -07:00
expikr
bfbeaca29f inline WIN_UpdateMouseCapture 2025-04-24 13:27:22 -07:00
Christoph Schied
de2c5c33b7 SDL_hidapi_steamdeck: report touch controller events
Previously, touchpad events were not reported to the application.
This patch exposes two touchpads and forwards x/y/pressure information
from the HIDAPI packet.

This fixes issue #12855
2025-04-24 13:18:24 -07:00
kiddkaffeine
5cacdf2513 Fix crash in UIKit indirect pointer handling 2025-04-24 13:04:43 -07:00
Alynne
32bbabe2a5 Add Padix Rockfire devices (#12884) 2025-04-24 11:28:37 -07:00
Robert Müller
7e1d4f843c Emscripten: fix incorrect error check for WebGL context creation
According to the documentation and testing the `emscripten_webgl_create_context` function returns `0` on error as oppposed to a negative number. This was causing the error message to be empty when the later `emscripten_webgl_make_context_current` call fails given the invalid context.

See https://emscripten.org/docs/api_reference/html5.h.html#c.emscripten_webgl_create_context
2025-04-24 11:25:58 -07:00
Sam Lantinga
fcdaff4110 Fixed compiler warning 2025-04-24 10:36:49 -07:00
expikr
dd625a6763 defer clipcursor refresh unto pump finish 2025-04-24 10:36:29 -07:00
expikr
c84c2aa2c4 pass ground-truth cursor pos to WIN_UpdateFocus 2025-04-24 10:36:29 -07:00
Frank Praznik
11a3296a42 x11: Handle size/position events arriving before state events
Xfce, unlike every other window manager in existence, sends ConfigureNotify events before PropertyNotify events when toggling the fullscreen and maximized window state. Check the window state when handling ConfigureNotify events, and defer emitting SDL size/position events until the corresponding PropertyNotify event arrives, since SDL and clients expect to get the window state before the new size and position.
2025-04-24 12:28:40 -04:00
Maia
d50520462a Add and use SDL_HapticEffectID typedef 2025-04-24 08:51:55 -07:00