Commit Graph

7856 Commits

Author SHA1 Message Date
Ryan C. Gordon
f67059d3f7 raspberry: Actually commit the whole patch. :) (Thanks, Joe!)
Fixes Bugzilla #4699.
2019-07-02 16:49:35 -04:00
Ryan C. Gordon
2971b5bf20 cocoa: Don't report trackpad mouse events as synthesized touches.
Fixes Bugzilla #4690, sort of. I guess.
2019-07-02 12:29:36 -04:00
Ryan C. Gordon
8a8b69d9dc raspberry: Fixed missing mouse cursor (thanks, Joe!)
"Starting with changeset 12433, the mouse cursor is not displayed on the
Raspberry Pi platform, due to a bug in the handling of the new
"global_cursor" in RPI_ShowCursor(). Currently, if cursor == global_cursor,
the function immediately returns 0. The function should not return here.
Instead, if cursor == global_cursor, it shouldn't try to hide the current
cursor and update global_cursor = cursor. However, it *should* still continue
through the rest of the function."

Fixes Bugzilla #4699.
2019-07-02 10:26:54 -04:00
Ryan C. Gordon
2658dad202 dbus: Don't SimulateUserActivity if we're already inhibiting the screensaver. 2019-07-02 09:43:26 -04:00
Ryan C. Gordon
6104b8af01 dbus: Add org.freedesktop.ScreenSaver.SimulateUserActivity support. 2019-07-02 09:38:31 -04:00
Alex Szpakowski
52a6aac9d9 iOS: Fix the window size not being set properly when Split View is used on an iPad (bug #4586). 2019-07-01 14:52:56 -03:00
Sam Lantinga
481ef447de Fixed memory barrier macro check so it isn't quite so fragile 2019-06-30 23:58:31 -07:00
Sam Lantinga
1a545396f2 Limit the compile error to the case where we actually define the memory barrier macro as the function 2019-06-30 23:55:28 -07:00
Sam Lantinga
98d14c2c73 Fixed bug 4683 - SDL_atomic infinite recursion on armv6/armv5 w/ thumb
The real problem is that SDL_atomic.c was built in thumb mode instead of ARM mode, which is required to use the mcr instruction on ARM platforms. Added a compiler error to catch this case so we don't generate code that does infinite recursion.

I also added a potentially better way to handle things on Linux ARM platforms, based on comments in the Chromium headers, which we can try out after 2.0.10 ships.
2019-06-30 23:26:16 -07:00
Sam Lantinga
cbab0050dd Fixed bug 4436 - [OpenBSD] fix D-pad
daniel.c.sinclair

Hi, this patch breaks dpad/hat input on my PS4 controller.  The attached patch restores functionality.  Calling SDL_PrivateJoystickHat() at the end of BSD_JoystickUpdate was setting the hat state to zero on every kind of input, instead of just the HUG_DPAD events.
2019-06-30 22:48:13 -07:00
Sylvain Becker
379eb4adfa Android: concurrency issues, make sure Activity is in running State when calling
functions like SDL_CreateWindow, SDL_CreateRenderer, Android_GLES_CreateContext

Bugs 4694, 4681, 4142
2019-06-28 16:38:42 +02:00
Sylvain Becker
dc794bedf2 Add an "error" label in SDL_CreateRenderer (no op) 2019-06-28 16:14:50 +02:00
Sylvain Becker
03966e79b9 Android: explicitly expand Android_GLES_MakeCurrent/Android_GLES_CreateContext
from SDL_egl_c.h
2019-06-28 16:05:20 +02:00
Ryan C. Gordon
d821b82742 cocoa: Check for capslock in -[NSResponder flagsChanged], not with IOKit.
Using IOKit for this pops up a warning at startup on macOS 10.15 ("Catalina"),
asking the user to authorize the app to listen to all keyboard input in the
system, which is unacceptable.

I _think_ we were using IOKit under incorrect presumptions here; the Stack
Overflow link mentioned in it was complaining about not being able to use
flagsChanged to differentiate between left and right mod keys, but that's not
an issue for capslock.

It's also possible this code was trying to deal with capslock changing when
the window didn't have focus, but we handle this elsewhere now, if we didn't
at the time.
2019-06-26 13:21:43 -04:00
Ryan C. Gordon
55337ef6ef windows: Call GetWindowText() with the correct parameters (thanks, Zebediah!)
GetWindowText() wants you to tell it the size of the buffer--including the
terminating NULL char--but we weren't counting that last char, losing the
last char of the string in the process. This was only seen with the special
case of SDL_CreateWindowFrom() to use an existing native window, not
the usual SDL_CreateWindow() codepath.

Fixes Bugzilla #4696.
2019-06-26 01:29:01 -04:00
Sylvain Becker
869e4cd849 Android: export Lock/Unlock activity API 2019-06-24 18:08:11 +02:00
Ryan C. Gordon
98fba377ef direct3d: Use D3DPOOL_DEFAULT for vertex buffers after all, release correctly.
Fixes Bugzilla #4679.
Fixes Bugzilla #4537.
2019-06-21 15:07:39 -04:00
Cameron Gutman
9d146fcbc2 direct3d: Fix dirty textures failing to update
Even if the texture itself has not changed since last time, the data may have
so we must call UpdateDirtyTexture() to handle that possibility.
2019-06-20 19:51:00 -07:00
Sam Lantinga
e85562f2ac Fixed bug 4672 - Warnings in SDL_LogEvent() 2019-06-19 17:11:20 -07:00
Sam Lantinga
53c911510b Rolling back GameCube HIDAPI support
It causes the HIDAPI devices to always be opened on enumeration, which causes crashes in the Windows drivers when multiple applications are reading and writing at the same time. We can revisit this after 2.0.10 release.
2019-06-19 15:54:21 -07:00
Zack Middleton
01f6db4da1 Handle GameCube WaveBird controller differences
Make wireless GameCube controllers use unknown power level instead of
wired and don't allow rumble (it doesn't have hardware for it).
2019-06-19 06:43:54 -07:00
Zack Middleton
e455e20657 Make GameCube controllers only rumble if both USB cables are connected
The Nintendo USB GameCube Adapter has two USB connectors. Black for data
and grey for additional power for rumble. The Wii U and other software
require both cables to use rumble. The rumble is weaker without the
second USB cable. Other than that I don't know if there is any negative
side affects from using rumble with only one cable.
2019-06-19 06:43:36 -07:00
Zack Middleton
fb4bd5c5cb Fix GameCube controller power level being reset to unknown
HIDAPI_DriverGameCube_OpenJoystick() set power level to wired and then
it was set to unknown in SDL_JoystickOpen().
2019-06-19 06:43:04 -07:00
Sam Lantinga
90a66d8866 Use SDL C runtime functions 2019-06-19 06:40:50 -07:00
Sylvain Becker
786778fcbf KMSDRM: fix inverted strcmp, remove useless if test (Bug 4624) 2019-06-19 10:11:38 +02:00
Sylvain Becker
2d0ae536b5 KMSDRM: fix compilation on linux, no d_namlen (Bug 4624) 2019-06-19 09:16:53 +02:00
Ryan C. Gordon
b565cc4e26 wayland: Fixed C99-style variable declaration inside for-loop. 2019-06-19 00:52:34 -04:00
Ryan C. Gordon
3b0639ca7e opengl: Be more robust in failing cases.
Load all possible symbols, not just until one fails, in case they get used
during shutdown, etc.

Fixes Bugzilla #4093.
2019-06-18 18:58:39 -04:00
Sam Lantinga
5fadf0d09c Only warp the mouse to set focus if we're definitely going into relative mode 2019-06-18 14:24:26 -07:00
Sam Lantinga
bb57b9cc1a Fixed compiler warning 2019-06-18 14:24:24 -07:00
Sam Lantinga
756b70a93e Fixed bug 4624 - KMS/DRM fails on FreeBSD because /dev/dri/card* nodes are symlinks
Jan Martin Mikkelsen

Patch to scan /dev/dri based on names rather than file type

Loading KMS/DRM on FreeBSD fails because the "available" code in the driver checks for character device nodes under /dev/dri and the /dev/dri/card* files are symlinks rather than device nodes nodes on FreeBSD. The symlink points to /dev/drm/0.

The attached patch counts /dev/dri/card* entries rather than directory entries which are character devices.
2019-06-18 14:15:10 -07:00
Ryan C. Gordon
35052aeabf cocoa: Patched to compile and also handle possible malloc failure. 2019-06-18 16:53:49 -04:00
Sam Lantinga
99e6b0ef00 Fixed potential double-free in mouse cleanup code 2019-06-18 13:41:38 -07:00
Sam Lantinga
f56e16c87d Fixed 4669 - Using the software SDL_Renderer on Android leads to GL errors & black screen when window resizes
Sylvain

I think what happening with the software renderer is:

* you're somehow in background (so texture creation is not possible)
* it resizes and wants to push a SDL_WINDOWEVENT_SIZE_CHANGED
It call:
https://hg.libsdl.org/SDL/file/45b56ed51919/src/render/SDL_render.c#l683
* GetOutputSize
* SW_GetOutputSize
* SW_ActivateRenderer
* SDL_GetWindowSurface
* SDL_CreateWindowFramebuffer which is mapped to SDL_CreateWindowTexture
and it ends up re-creating the surface/a texture, while being in background
2019-06-18 10:08:19 -07:00
Sylvain Becker
756526a7d9 Android: resize with software rendering, reverted again (Bug 4669) 2019-06-18 18:53:58 +02:00
Sylvain Becker
c15d530a13 Android: try to fix resize with software rendering (bug 4669) 2019-06-18 18:40:40 +02:00
Sylvain Becker
93cf468756 Android: revert commit SW_GetOutputSize, again (Bug 4669) 2019-06-18 18:22:18 +02:00
Sylvain Becker
3f591fa6dc Android: prevent using SW_GetOutputSize with software renderer (Bug 4669) 2019-06-18 10:41:11 +02:00
Sylvain Becker
c60bd59822 Android: revert previous commit (Bug 4669)
(Refs #1)
2019-06-18 10:23:19 +02:00
Sylvain Becker
ba367bca49 Fixed bug 4669: Android software renderer, black screen when window resizes
Using the software SDL_Renderer on Android leads to GL errors & black screen when window resizes
2019-06-17 22:31:36 +02:00
Sam Lantinga
e8abb3a0e6 Removed extraneous fprintf() call 2019-06-17 11:10:20 -07:00
Sam Lantinga
f58c5223ab Updated version to 2.0.10 2019-06-17 10:13:28 -07:00
Sam Lantinga
74b4f7a68d Fixed bug 4667 - Build errors on Linux when building without Threads support
Manuel Sabogal

There is an issue on the latest commit of the mercurial repo when SDL_THREADS_DISABLED is set:

src/core/linux/SDL_threadprio.c:79:28: error: unknown type name 'Sint64'; did you mean 'int'
2019-06-17 08:38:33 -07:00
Alex Szpakowski
beb04e599a Fix synthetically generated mouse events getting lost forever after the device orientation changes (or the window is otherwise resized) while a finger is touching the screen. 2019-06-16 14:10:30 -03:00
Alex Szpakowski
d111cfcf38 iOS: remove some code which could affect the state of UIViews that aren't owned by SDL.
It was originally added to work around an input event problem in the code of a specific app which mixed SDL and native UIViews, but that app solved its problems in a better manner since then.
2019-06-16 13:52:27 -03:00
Ryan C. Gordon
f9f51a7c38 assert: Another attempt to quiet compiler warnings. 2019-06-14 22:29:13 -04:00
Ryan C. Gordon
5f36780e0b assert: Possibly fixing compiler warning on Android. 2019-06-14 21:39:51 -04:00
Ryan C. Gordon
f1c7594adc cocoa: ignore compiler warnings about OpenGL being deprecated. 2019-06-14 21:18:53 -04:00
Ryan C. Gordon
03aa6bb81a A few minor changes to placate static analysis. 2019-06-14 18:23:51 -04:00
Sam Lantinga
4b0e4b0723 Added support for Xbox and PS4 wireless controllers on iOS and tvOS
Also implemented SDL_JoystickGetDevicePlayerIndex() on iOS and tvOS, and added support for reading the new menu button state available in iOS and tvOS 13.
2019-06-14 13:56:52 -07:00