Commit Graph

7245 Commits

Author SHA1 Message Date
Sam Lantinga f1fa836b2e Merge commit '13472cec6764aec2e06a3c66ec1b139baa680aa3' into main 2021-05-07 12:28:35 -07:00
Sam Lantinga cf1e850303 Merge commit 'a74f888ff9ed1254e9b9965a27d68e0526e2c0f8' into main 2021-05-07 12:28:33 -07:00
Sam Lantinga 63015e44c7 Merge commit '8ac0fb52cb13e5856aa7f4a3fd0598d3ec58283f' into main 2021-05-07 12:28:32 -07:00
Sam Lantinga 0ebf56b5f1 Merge commit '1f3df900f919e7177e480e63c07447db232564a1' into main 2021-05-07 12:28:30 -07:00
Sam Lantinga 5a95ff8002 Merge commit 'fcbf19b764a9f6fed1db6a1d79a2f2f3fa1338d6' into main 2021-05-07 12:28:28 -07:00
Sam Lantinga 572dfb4f6e Merge commit 'c93e3b36074ddb2ed986cbacc5e9d4f3a60db343' into main 2021-05-07 12:28:27 -07:00
Sam Lantinga a734ccec9a Merge commit 'b62642974595976a0c47c5b854eea51b2703fbeb' into main 2021-05-07 12:28:25 -07:00
Sam Lantinga 4c7f8a7497 Merge commit 'f8695185331460106f34286ebe466cb605f85bb6' into main 2021-05-07 12:28:23 -07:00
Sam Lantinga 9cf1b39162 Merge commit '21349901ea250483600cbe4771d865cc06f6b538' into main 2021-05-07 12:28:22 -07:00
Sylvain 13472cec67
Fixed bug #4228: move from jcenter() to mavenCentral()
SDL can use relinker. If it's enabled on your project, you need to update to version 1.4.3
2021-04-30 09:48:29 +02:00
Sylvain a74f888ff9
Fixed bug #4337 - compilation of 'SDL_vulkan_utils' fails with 'VK_ERROR_INCOMPATIBLE_VERSION_KHR' undeclared 2021-04-29 22:25:00 +02:00
Sylvain 8ac0fb52cb
OpenSLES: CloseDevice() is called at higher level, if OpenDevice() fails
- explicit initialization of static variables
2021-04-29 09:29:02 +02:00
Sylvain 1f3df900f9
Error missing 'flags' initialization (see bug #2881) 2021-04-28 23:40:26 +02:00
Sylvain fcbf19b764
AAudio: make sure stream is not null to prevent crash in RequestStop (see #3710) 2021-04-28 21:04:47 +02:00
Sylvain c93e3b3607
Fixed bug #2881 - SDL_RLEsurface may encode RGB888 if it has no color key (Thanks Simon Hug)
To encode with BLEND mode, it needs a valid alpha channel
2021-04-28 10:43:28 +02:00
Sylvain b626429745
Merge remote-tracking branch 'refs/remotes/origin/main' 2021-04-27 11:10:41 +02:00
Sylvain f869518533
Audio: normalize conversion Stereo to 5.1, Quad to 7.1, 5.1 to 7.1 (bug #4104) 2021-04-27 11:07:51 +02:00
Sylvain 21349901ea
Audio: convert 5.1 to 7.1, use right-surround for r-front and r-back (see #4104) 2021-04-27 10:57:48 +02:00
Ryan C. Gordon 8527c583f4 cocoa: Fix recreated windows that are both borderless and resizable.
These would accidentally get a titlebar because the "borderless" style mask
is zero but the resizable attribute adds a bit. I assume this happens because
you used to need window decoration to resize a window in macOS, but this
changed in later releases.

This only caused problems when recreating a window (you had an
SDL_WINDOW_OPENGL window and tried to create a Metal SDL_Renderer on it, etc).

Fixes #4324.
2021-04-27 01:36:23 -04:00
Ethan Lee 40210f8945 winrt: Always use a thread for joystick support 2021-04-26 21:29:56 -04:00
Ryan C. Gordon 2fdbae22cb cocoa: Remove mouse event tap.
It doesn't appear to work anymore, and was disabled by default anyhow, since
the needed APIs are forbidden on the Mac App Store.

A better solution to lock the mouse to the window on macOS would still be
welcome. CGAssociateMouseAndMouseCursorPosition() works fine for relative
mouse mode, this was just a question of SDL_SetWindowGrab(). As it stands
now, a grabbed mouse can briefly break out of the window, causing varying
degrees of chaos.
2021-04-26 18:43:28 -04:00
Sylvain 9727655b89
SDL_test_common: add other window flags: --shown, --hidden, --input-focus, --mouse-focus 2021-04-26 14:22:19 +02:00
Sylvain d62ebec260
SDL_test_common: replace 'resize' by 'resizable' 2021-04-26 14:10:39 +02:00
Ryan C. Gordon 1f482174b5
x11: Mark backing_store as NotUseful when creating windows.
This can give some performance boost, and save some resources, as there's no
reason to keep a copy of an SDL window's contents on the server: most SDL
apps are redrawing completely every frame, and the API allows for expose
events to tell an app a redraw is needed anyhow.

(And compositors are free to ignore this setting if it makes sense to do so,
according to the Xlib docs.)

Reference Issue #3776.
2021-04-25 12:44:35 -04:00
Ryan C. Gordon 9c063468d6
x11: call XSync before XSetInputFocus during SDL_ShowWindow.
This only happens when using a non-NET_WM window manager, as we might try to
set the focus before the window is mapped.

Fixes #3949.
2021-04-24 19:55:41 -04:00
Ozkan Sezer 89a2980a6d CMake: fixes to pthreads detection.
changes unnecessary check_c_source_runs to check_c_source_compiles,
removes the reduntant cross-compile check, and defines _GNU_SOURCE
for PTHREAD_MUTEX_RECURSIVE checks just like the autotools version.

Fixes: https://github.com/libsdl-org/SDL/issues/4262
Closes:  https://github.com/libsdl-org/SDL/pull/4282
2021-04-25 01:28:03 +03:00
Ivan Epifanov ca969eb2be Remove gles2 vita render 2021-04-24 14:13:09 -07:00
Ivan Epifanov 058bbe0286 Set volume on device open 2021-04-24 14:13:09 -07:00
Ivan Epifanov e3ea5b6468 Migrate to lightweight mutexes 2021-04-24 14:13:09 -07:00
Steven Noonan f1ad942a11 SDL_windows_main: use HeapAlloc/HeapFree for command line arguments
If a developer uses SDL_SetMemoryFunctions, we can't rely on SDL_free()
working when SDL_main() returns.

Signed-off-by: Steven Noonan <steven@valvesoftware.com>
Signed-off-by: Sam Lantinga <slouken@libsdl.org>
2021-04-22 17:26:13 -07:00
Steven Noonan 17d8479d98 hidapi/libusb: maintain in-memory cache of vendor/product strings
The get_usb_string call is rather expensive on some USB devices, so we
cache the vendor/product strings for future lookups (e.g. when
hid_enumerate is invoked again later).

This way, we only need to ask libusb for strings for devices we haven't
seen since before we started.

Signed-off-by: Steven Noonan <steven@valvesoftware.com>
Signed-off-by: Sam Lantinga <slouken@libsdl.org>
2021-04-22 16:40:23 -07:00
Steven Noonan 4535d65491 HIDAPI_UpdateDiscovery: only treat "add" and "remove" events as relevant
I have a buggy system which reports a udev "change" event for an empty
USB-C port every 0.14 seconds, which causes annoying frame hitches
because SDL decides that means it needs to do a libusb hid_enumerate,
which is slow (~25ms!) because of the get_usb_string() calls in there.

We only need to re-enumerate if we've seen a device added or removed, so
let's filter out the change event first.

Signed-off-by: Steven Noonan <steven@valvesoftware.com>
Signed-off-by: Sam Lantinga <slouken@libsdl.org>
2021-04-22 16:40:16 -07:00
Steven Noonan b15bbd4e3f SDL_udev: check for NULL return value from udev_device_get_action
Signed-off-by: Steven Noonan <steven@valvesoftware.com>
Signed-off-by: Sam Lantinga <slouken@libsdl.org>
2021-04-22 16:39:22 -07:00
Sylvain cf05a5eb0c
eglChooseConfig: only add EGL_DEPTH_SIZE if non 0
and fix static / shadowed variables warnings for dump configs
2021-04-22 21:40:57 +02:00
Sylvain 98a966d1c2
Android: don't need to set the SurfaceHolder format from java code
It's already set with ANativeWindow_setGeometry, and eventually set/changed also by eglCreateWindowSurface.
 - avoid issues with older device where SurfaceView cycle create/changed/destroy appears broken:
   calling create/changed/changed, and leading to "deuqueBuffer failed at server side, error: -19", with black screen.
 - re-read the format after egl window surface is created, to report the correct one (sometimes, changed from RGBA8888 to RGB24)
2021-04-22 18:06:17 +02:00
Ethan Lee 8e3ec34d34 wayland: Refactor toplevel mapping, implement HideWindow 2021-04-21 13:11:47 -04:00
Cacodemon345 0838f53d5a Implement SDL_SetWindowAlwaysOnTop for X11 2021-04-21 13:09:10 -04:00
Mathieu Eyraud a5825576fb Fix error handling of wayland message box
Zenity return a small integer on success which may be the same as EXIT_FAILURE. Use a bigger integer for error reporting from child process.
2021-04-21 09:53:39 -04:00
Mathieu Eyraud 12dd412b0b Fix icon of wayland message box
Also add some comments and silence a warning.

Co-authored-by: Ethan Lee <flibitijibibo@gmail.com>
2021-04-21 09:53:39 -04:00
meyraud705 d0cf3b7555 Return correct button id 2021-04-21 09:53:39 -04:00
meyraud705 1fd95c53b6 Disable pango markup in wayland massage box
Zenity support pango markup, add --no-markup to disable it.
2021-04-21 09:53:39 -04:00
meyraud705 0cd0e9ba98 Reimplement wayland message box function with execvp.
Previous version used 'popen' which required to sanitize user provided text. Not
sanitizing text could cause failure if user provided text included a " or command
injection with `cmd`.
2021-04-21 09:53:39 -04:00
Cacodemon345 99ef03b96e KMSDRM: Only use OpenBSD-specific defines on pre-6.9 releases 2021-04-20 19:44:55 -07:00
Joseph Lyncheski a0a5da5d91 Add SDL_SetWindowAlwaysOnTop() 2021-04-20 08:45:28 -07:00
Sylvain 6be9c00970
Android: prevent error EGL_BAD_DISPLAY while getting egl version without display
There is an error "E libEGL  : validate_display:91 error 3008 (EGL_BAD_DISPLAY)"
that occurs when calling "eglQueryString(display, EGL_VERSION)", with EGL_NO_DISPLAY.

Khronos says "EGL_BAD_DISPLAY is generated if display is not an EGL display connection, unless display is EGL_NO_DISPLAY and name is EGL_EXTENSIONS."
but this was added in SDL with "EGL 1.5 allows querying for client version"
( 56363ebf61 )

In fact:
- it actually doesn't work on Android that has 1.5 egl client
- it works on desktop X11 (using SDL_VIDEO_X11_FORCE_EGL=1)

The commit moves the version call where it's used, eg inside the "if (platform) {"
and checks that "eglGetPlatformDisplay" has been correctly loaded.
2021-04-20 13:46:25 +02:00
Ryan C. Gordon 03503423e9
filesystem: Better OpenBSD support for SDL_GetBasePath().
Fixes #3752.
2021-04-19 23:32:45 -04:00
ReNoM de6d290266 Fix keymap updating for X11 backend 2021-04-19 15:54:09 -04:00
Ethan Lee 509228c423 wayland: Implement GetDisplayDPI 2021-04-19 00:14:15 -04:00
Ethan Lee fcbfe33ce5 wayland: Implement SetWindowModalFor 2021-04-19 00:14:15 -04:00
Ethan Lee 213bfc194e wayland: Implement RestoreWindow for xdg/zxdg 2021-04-19 00:14:15 -04:00