Commit Graph

14137 Commits (3976bbef2ad3896c4411c4fcd5bfc5e3bd64bb4b)

Author SHA1 Message Date
Sam Lantinga cdfc9634e1 Removed patch note for change already in SDL 2.x 2023-07-08 09:35:42 -07:00
Sam Lantinga 3a654b4b1c Added the hint SDL_HINT_JOYSTICK_WGI to control whether to use Windows.Gaming.Input for controllers 2023-07-08 09:32:24 -07:00
Mathieu Eyraud a4f3905bb6 Fix uninitialised variable 2023-07-08 08:36:36 -07:00
Sam Lantinga efed24850a Don't tickle Bluetooth PS4 controllers in simple mode with an effects packet
That will put the PS4 controller into enhanced mode, which breaks DirectInput games
2023-07-07 15:56:54 -07:00
Sam Lantinga 785f57eb91 Lazily initialize the WGI gamepad support
Initializing "Windows.Gaming.Input.Gamepad" will put Bluetooth PS4 controllers into enhanced report mode, which breaks any game using DirectInput. Let's wait to do this until absolutely necessary.
2023-07-07 15:56:54 -07:00
Sylvain aab3cbf207 SDL_thread.h: fix parameter name in comment 2023-07-07 21:55:20 +02:00
Sylvain 6763369f5b gendynapi.py: always check comment formatting of the public api 2023-07-07 21:55:20 +02:00
Frank Praznik b82d6b8e4e wayland: Set the source surface of the request when raising a window
The xdg_activation token requires specifying the surface that is the source of the activation request, not the surface of the target window. Setting this to the target window was causing raise requests to be blocked by the compositor, as if the surface noted as the origin of the request didn't currently have focus, it appeared to the compositor as though it was trying to 'steal' focus.
2023-07-07 14:30:02 -04:00
Mathieu Eyraud bcf239e413 Improve sensor detection for Linux gamepad v2
Detecting by name such as "Accelerometer and "Motion Sensor" may be too broad.
Sensors on Dualshock and Switch gamepad are correctly detected by SDL_EVDEV_GuessDeviceClass(). 
Use vendor and product ID for Wii extension controls.
2023-07-07 10:57:45 -07:00
Sam Lantinga ed6dc1cc05 Prefer using XInput for rumble over WGI, as it allows rumble in the background
(cherry picked from commit e16a83d393ae1784040519f42c482e2641b971a2)
2023-07-07 09:48:58 -07:00
Sam Lantinga 9f19b2bd97 Continue running XInput detection while RAWINPUT is active
This allows us to re-enable XInput correlation for RAWINPUT devices without reintroducing the controller shutdown bug for controllers using the wireless adapter in https://github.com/libsdl-org/SDL/issues/3468.

Fixes https://github.com/libsdl-org/SDL/issues/7940

(cherry picked from commit a0a3957eb65e22721a124476072af0f6f5a7ca18)
2023-07-07 09:48:58 -07:00
Sylvain ec90c2e26d Add 'return' comment to SDL_ClearClipboardData 2023-07-07 10:25:06 +02:00
Sam Lantinga d57249034a Fix Cocoa_RaiseWindow activating the app when SDL_HINT_WINDOW_ACTIVATE_WHEN_RAISED is false 2023-07-06 18:14:37 -07:00
Sam Lantinga c5bd2cba98 Fix passing of child window focus in WIN_ShowWindow/WIN_RaiseWindow
Keyboard focus was being passed to the child window being shown if SDL_HINT_WINDOW_ACTIVATE_WHEN_SHOWN is false and keyboard focus was not being passed to the child window being activated in WIN_RaiseWindow.
2023-07-06 18:14:34 -07:00
Sam Lantinga 565e95ac4e Fix windows created with SDL_WINDOW_MINIMIZED having inconsistent SDL_WINDOW_HIDDEN flag on Windows
- Windows created minimized are shown with SW_SHOWMINNOACTIVE which does not send WM_SHOWWINDOW leaving the window visible (but minimized)
  on desktop but still with the SDL_WINDOW_HIDDEN flag set. Now the hidden flag is cleared in this case but noted that this means it's not currently possible
  to create a window that is initially hidden that then is minimized once shown.
2023-07-06 18:14:27 -07:00
Sam Lantinga be79f62cb7 Fixed warning C4214: nonstandard extension used: bit field types other than int 2023-07-06 18:14:22 -07:00
Takase cb55ce70f0
video(wayland): use both --icon and --icon-name for Zenity (#7897)
video(wayland): use both --icon and --icon-name for Zenity

Many distros ship an older version of Zenity that supports GTK3, while some distros ship newer version of Zenity which uses libadwaita.

This command tries to use --icon and fall back to --icon-name when it fails.
2023-07-06 17:53:00 -07:00
Sam Clegg b42cb1c6f2
emscripten: Add JS library dependencies using EM_JS_DEPS macro
See https://github.com/emscripten-core/emscripten/pull/19780

(cherry picked from commit 042243471fb7ecf6ba5e53f0ba35e825a8bb066a)
2023-07-06 19:32:05 -04:00
Sam Lantinga 95033e87e1 SDL 3.0 video modes are sized in points, with a separate pixel density 2023-07-06 15:19:17 -07:00
Sam Lantinga dda474504f Fixed prototype definition 2023-07-06 13:00:03 -07:00
Sam Lantinga 1528e7c3c9 Fixed mapping a controller other than the first one 2023-07-06 12:36:26 -07:00
Frank Praznik 1bf7898ddf wayland: Remove leftover debug message 2023-07-06 13:56:22 -04:00
Frank Praznik d28e9960ce wayland: Use the implicit grab serial for setting the clipboard/primary selection data
Use the implicit grab serial, which includes keyboard key, mouse button, touch, and tablet tool events, for setting the clipboard and primary selection data, as these are all considered valid originating event serials.
2023-07-06 13:52:04 -04:00
Sam Lantinga badb7f1e8b Added notes about delayed clipboard rendering on Windows 2023-07-06 08:36:49 -07:00
Sam Lantinga 7890985629 Fixed windows debug message formatting 2023-07-06 08:33:12 -07:00
Sam Lantinga ddb817a1af Only clear the clipboard if setting empty text 2023-07-06 08:32:34 -07:00
Sam Lantinga f4bd17deee Fixed %p formatting when there is following text 2023-07-06 08:04:20 -07:00
SDL Wiki Bot 17e95345e3 Sync SDL3 wiki -> header 2023-07-06 03:08:15 +00:00
Sam Lantinga cc254d885d Fixed wayland clipboard not always updating in response to Ctrl-C 2023-07-05 20:06:59 -07:00
Sam Lantinga c1b11ad54e Expanded automated clipboard tests 2023-07-05 20:06:59 -07:00
Sam Lantinga c63aa9545e Fixed printf formatting for "%p" and added a unit test to check it 2023-07-05 20:06:59 -07:00
Sam Lantinga ecbbac7c72 Do a full UCS4 zero termination on iconv converted strings
We don't necessarily know the size of the output characters, so do a full 32-bit zero termination on the output string.

This fixes garbage at the end of Windows clipboard text
2023-07-05 20:06:59 -07:00
Sam Lantinga ae771d4710 Added test shortcuts Alt-C and Alt-V to test the primary selection functionality 2023-07-05 20:06:59 -07:00
Sam Lantinga 55ff09de38 Reimplement clipboard text in terms of clipboard data
This will simplify the X11 and Wayland implementations, which were doing that under the hood, and makes application interaction between the two APIs consistent.
2023-07-05 20:06:59 -07:00
Sam Lantinga c980ce2120 Removed SDL_EVENT_CLIPBOARD_CANCELLED in favor of the cleanup callback 2023-07-05 20:06:59 -07:00
Sam Lantinga 443868143c Added support for clipboard data on Windows
The only supported image format is image/bmp
2023-07-05 20:06:59 -07:00
Sam Lantinga 35876da3c4 Clipboard data API revamp
The clipboard data API is now supported on all platforms, at least for internal use.
2023-07-05 20:06:59 -07:00
Sam Lantinga 61ff86617a Added GetClientScreenRect() and fixed build for C89 compilers 2023-07-05 11:05:48 -07:00
expikr a7326b9396 center cursor to client area (excludes titlebar thickness) 2023-07-05 10:11:57 -07:00
Sam Lantinga f49f1434b9 Revert "Update SDL_windowswindow.c"
This reverts commit d0fdf6207b.
2023-07-05 09:22:09 -07:00
expikr d0fdf6207b Update SDL_windowswindow.c 2023-07-04 20:42:01 -07:00
Anonymous Maarten ffcd1c0c26 cmake: explicitly disable WINDOWS_EXPORT_ALL_SYMBOLS for SDL3-shared
This fixes the following errors when a dll attempts to link to SDL3::SDL3-shared:

m.c.obj : error LNK2019: unresolved external symbol __imp___acrt_iob_func referenced in function printf
m.c.obj : error LNK2019: unresolved external symbol __imp___stdio_common_vfprintf referenced in function _vfprintf_l
MSVCRTD.lib(init.obj) : error LNK2019: unresolved external symbol _CrtDbgReport referenced in function _CRT_RTC_INIT
MSVCRTD.lib(init.obj) : error LNK2019: unresolved external symbol _CrtDbgReportW referenced in function _CRT_RTC_INITW
MSVCRTD.lib(error.obj) : error LNK2019: unresolved external symbol strcpy_s referenced in function "void __cdecl _RTC_StackFailure(void *,char const *)" (?_RTC_StackFailure@@YAXPEAXPEBD@Z)
MSVCRTD.lib(error.obj) : error LNK2019: unresolved external symbol strcat_s referenced in function "void __cdecl _RTC_StackFailure(void *,char const *)" (?_RTC_StackFailure@@YAXPEAXPEBD@Z)
MSVCRTD.lib(error.obj) : error LNK2019: unresolved external symbol __stdio_common_vsprintf_s referenced in function _vsprintf_s_l
MSVCRTD.lib(error.obj) : error LNK2001: unresolved external symbol __C_specific_handler_noexcept
MSVCRTD.lib(pdblkup.obj) : error LNK2019: unresolved external symbol _wmakepath_s referenced in function "int __cdecl GetPdbDllPathFromFilePath(wchar_t const *,wchar_t *,unsigned __int64)" (?GetPdbDllPathFromFilePath@@YAHPEB_WPEA_W_K@Z)
MSVCRTD.lib(pdblkup.obj) : error LNK2019: unresolved external symbol _wsplitpath_s referenced in function "int __cdecl GetPdbDllPathFromFilePath(wchar_t const *,wchar_t *,unsigned __int64)" (?GetPdbDllPathFromFilePath@@YAHPEB_WPEA_W_K@Z)
MSVCRTD.lib(pdblkup.obj) : error LNK2019: unresolved external symbol wcscpy_s referenced in function "int __cdecl GetPdbDllPathFromFilePath(wchar_t const *,wchar_t *,unsigned __int64)" (?GetPdbDllPathFromFilePath@@YAHPEB_WPEA_W_K@Z)
MSVCRTD.lib(pdblkup.obj) : error LNK2019: unresolved external symbol __vcrt_GetModuleFileNameW referenced in function "struct HINSTANCE__ * __cdecl GetPdbDll(void)" (?GetPdbDll@@YAPEAUHINSTANCE__@@XZ)
MSVCRTD.lib(pdblkup.obj) : error LNK2019: unresolved external symbol __vcrt_GetModuleHandleW referenced in function "struct HINSTANCE__ * __cdecl GetPdbDll(void)" (?GetPdbDll@@YAPEAUHINSTANCE__@@XZ)
MSVCRTD.lib(pdblkup.obj) : error LNK2019: unresolved external symbol __vcrt_LoadLibraryExW referenced in function "struct HINSTANCE__ * __cdecl GetPdbDll(void)" (?GetPdbDll@@YAPEAUHINSTANCE__@@XZ)
2023-07-05 00:12:10 +02:00
Sam Lantinga 00fc50557e Make sure logical presentation is complete before destroying the logical render target
Fixes "testautomation --filter render_testLogicalSize"
2023-07-03 18:29:48 -07:00
Sam Lantinga 619f65af0c Fixed resource leak and crash at exit in the D3D11 renderer
Also, for some reason ID3D11DeviceContext_OMGetRenderTargets() was failing in the second read pixels call in the "testautomation --filter render_testViewport" test.

We already know the target view, so just use that.
2023-07-03 17:39:29 -07:00
Sam Lantinga 90262f274a Made error handling more consistent in D3D12_RenderReadPixels() 2023-07-03 17:37:17 -07:00
Sam Lantinga 304d425f99 The clip rect is defined in terms of the current viewport
Don't use the viewport offset when setting the clip rect in the D3D12 renderer.

This fixes "testautomation --filter render_testViewport" on Windows
2023-07-03 17:09:49 -07:00
Sam Lantinga b6645bb255 Retry to open the clipboard in case another application has it open
This fixes 'testautomation --filter clipboard_testClipboardTextFunctions' on Windows
2023-07-03 16:18:33 -07:00
Sam Lantinga 3bd5e5ca3c Removed spurious casts 2023-07-03 16:18:33 -07:00
luzpaz 37e567994d
Fix remaining typos (#7921)
* Fix remaining typos

Found via `codespell -q 3 -S *.hex,*.pdf,./src/libm,./src/hidapi,./src/stdlib/SDL_malloc.c,./src/video/x11/edid.h -L caf,currenty,datas,einstance,fo,hda,lod,mata,parm,parms,pevent,pevents,pixelx,requestor,ser,statics,te,texturers,thid,uscaled,windowz`
2023-07-03 12:46:47 -07:00
luzpaz 65e1d568ef Fix various typos (docs/build scripts/tests) 2023-07-03 08:35:37 -07:00