Commit Graph

12860 Commits (d44ada59fba93a56a5a39bf4d87157fa4e851caf)

Author SHA1 Message Date
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
Ryan C. Gordon c0bd18f023
khronos: Fixed a typo in a Vulkan header, to match upstream.
Fixes #7916.
2023-07-03 11:03:20 -04:00
Sam Lantinga f010411492 Rename SDL_strtokr() to SDL_strtok_r()
Fixes https://github.com/libsdl-org/SDL/issues/7914
2023-07-03 06:20:06 -07:00
SDL Wiki Bot b8d6023a91 Sync SDL3 wiki -> header 2023-07-03 01:49:13 +00:00
Sam Lantinga 3c04be4486 The rectangles passed to SDL_BlitSurfaceUnchecked() and SDL_BlitSurfaceUncheckedScaled() are const.
The destination rectangle passed to SDL_BlitSurface() and SDL_BlitSurfaceScaled() is non-const and filled in with the final destination rectangle after clipping, and now documented as such.

Fixes https://github.com/libsdl-org/SDL/issues/7911
2023-07-02 18:45:11 -07:00
Sam Lantinga ced153a24a Fixed reference to old function (thanks @tom-seddon!)
Fixes https://github.com/libsdl-org/SDL/issues/7912
2023-07-02 18:24:53 -07:00
Sam Lantinga 4aee17b039 Resorted symbols alphabetically
This can be be done now, before the ABI is frozen
2023-07-02 00:06:55 -07:00
Sam Lantinga 50b6e5eb7e Implemented SDL_LoadBMP() and SDL_SaveBMP() as functions
Fixes https://github.com/libsdl-org/SDL/issues/7902
2023-07-02 00:00:06 -07:00
Sam Lantinga e264bb5178 Rename SDL_PIXELFORMAT_RGB888 and SDL_PIXELFORMAT_BGR888 to SDL_PIXELFORMAT_XRGB8888 and SDL_PIXELFORMAT_XBGR8888 for clarity
Fixes https://github.com/libsdl-org/SDL/issues/7903
2023-07-01 17:58:34 -07:00
scribam d85e327c92 cmake: use SDL_CPU_ARM32 instead of CMAKE_GENERATOR_PLATFORM STREQUAL "ARM" 2023-07-01 23:25:49 +02:00
Ryan C. Gordon 9d39e50f29
rwops: Use SetFilePointerEx on Windows for appending writes.
Fixes #7900.

(cherry picked from commit 769bf2ebcca8f0cbcde4ec50008942f4eda57f4a)
2023-07-01 00:37:18 -04:00
Sam Lantinga 5b9fdc9dd1 Revert "Zenity has deprecated --icon-name in favor of --icon"
This reverts commit 55c3c1b05c.

It turns out many Linux distributions are shipping zenity which doesn't support the new --icon option. We'll need a more robust fix for this.
2023-06-29 23:01:36 -07:00
Sam Lantinga 55c3c1b05c Zenity has deprecated --icon-name in favor of --icon
Fixes https://github.com/libsdl-org/SDL/issues/7895
2023-06-29 22:45:59 -07:00
Sam Lantinga 18ff0d1878 Fixed build 2023-06-29 22:40:57 -07:00
Sam Lantinga 69c7a49990 Fixed build warnings 2023-06-29 22:15:23 -07:00
Sam Lantinga 97380dcdab We don't need to reserve window flag bits for sdl2-compat
sdl2-compat does the appropriate bit twiddling to preserve compatibility
2023-06-29 22:02:24 -07:00
Sam Lantinga 8da9b22c17 The SDL_WINDOW_SKIP_TASKBAR flag has been replaced by the SDL_WINDOW_UTILITY flag
The SDL_WINDOW_UTILITY flag has the same functionality, and is now implemented on Windows.
2023-06-29 21:43:17 -07:00
Sam Lantinga 675fc8c38f Added Linux mapping for the Logitech Chillstream
Fixes https://github.com/libsdl-org/SDL/issues/7829
2023-06-29 16:10:55 -07:00
Sam Lantinga ba9e924e57 Added additional debug logging for Linux joysticks 2023-06-29 16:09:55 -07:00
Sam Lantinga ffa146f0bc On Windows the mouse speed is affected by the content scale
Fixes https://github.com/libsdl-org/SDL/issues/7802
2023-06-29 14:38:26 -07:00
Anonymous Maarten 4d23eaf81e cmake: only define _FILE_OFFSET_BITS and _TIME_BITS for glibc 2023-06-29 14:55:43 +02:00
Anonymous Maarten c3be4bc18d cmake: Compile with 64-bit time stamps where possible
On platforms where time_t is a signed 32-bit integer, most notably i386 Linux,
various functions stop working when dealing with a timestamp
beyond January 2038.

glibc has an opt-in mechanism that redefines time_t to be 64-bit,
and correspondingly increases the size of all system data
structures that contain a time_t, such as struct timeval and struct stat.
This is necessary to allow timestamps beyond January 2038 to be represented;
as well as things that obviously deal with timestamps, this affects functions
like stat(), which will fail with EOVERFLOW if asked to inspect a file whose
correct timestamp does not fit in time_t. This in turn can cause unexpected
problems for "filesystem APIs" of the form "if /run/foo exists, then ..."
when accessed by 32-bit code, if the check for existence is done with stat()
rather than access().

Using 64-bit timestamps in glibc is an opt-in and not the default, because
if done carelessly it can change libraries' ABIs. However, SDL mostly doesn't
use system headers or types in its own headers. I

Co-authored-by: Simon McVittie <smcv@collabora.com>
2023-06-28 19:47:52 -07:00
Sam Lantinga baa9c57581 Added support for the Nintendo Online Famicom controllers 2023-06-28 19:15:43 -07:00
Simon McVittie 10fc3b3db7 evdev: Use time64-friendly accessors for struct input_event
On 32-bit platforms such as i386, if SDL is compiled with -D_TIME_BITS=64
to opt-in to ABIs that will not stop working in 2038, the fields in
this struct change their naming and interpretation.

The Linux header <linux/input.h> defines macros input_event_sec and
input_event_usec which resolve to the right struct field to look at.
The actual field names and types are an implementation detail,
historically signed 32-bit time.tv_sec and time.tv_usec on 32-bit
platforms, but becoming unsigned __sec and __usec when using 64-bit
time (which makes them able to represent times up to 2106).

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-06-28 12:35:12 -07:00
Frank Praznik e7327b6c73 wayland: Flush cached themes on a theme change
Flush the cached themes when the system cursor theme changes so that the stale cached value won't be used.
2023-06-28 14:53:11 -04:00
capehill 8315a00a01 Fix crash in AudioConvertByteswap 2023-06-28 14:47:10 -04:00
Frank Praznik fd6cb4dc86 wayland: Add a DBus message handler for the cursor size and theme properties.
Add a DBus message handler to watch and respond to changes to the system cursor size and theme properties. Upon these settings being changed, a cursor refresh will be triggered so the new changes will take effect immediately, without the cursor having to leave and re-enter the window surface.
2023-06-28 13:58:05 -04:00
Sam Lantinga e643d28d9c Set the hint value before calling hint callbacks
This allows the hint callbacks to perform more complicated logic involving multiple hints without worrying about which hint has been changed.
2023-06-28 08:53:48 -07:00