Commit Graph

7318 Commits

Author SHA1 Message Date
Sam Lantinga
6de33c0945 Clarify why we're skipping Game Controller framework supported devices in hid.c 2021-06-03 09:05:33 -07:00
Patrick Hogan
28da6c5ddb Have HIDAPI skip MFI supported HID devices on macOS to avoid duplicate devices. 2021-06-03 09:03:11 -07:00
Ethan Lee
2af3f64ecf wayland: Activate the window on first ShowWindow, if possible 2021-06-02 12:59:07 -07:00
Ethan Lee
151f953815 wayland: Implement RaiseWindow with xdg-activation 2021-06-02 12:59:07 -07:00
Ozkan Sezer
f498c281e1 fixed build with SDL_JOYSTICK_RAWINPUT enabled after commit b81969d46f
See: https://github.com/libsdl-org/SDL/pull/4388#issuecomment-852713792
2021-06-02 14:10:50 +03:00
Sylvain
f5b87273e1
Fixed bug #4397 - update IOS documentation 2021-06-02 08:32:43 +02:00
Kyle Schaefer
4522cb1df9 Changing variable from float to int, this way we can check it's value without having to do an unnecessary conversion. Then do explicit conversions later on if we need. 2021-06-01 16:53:39 -07:00
Kyle Schaefer
c289bad900 In x11, GetDisplayDPI can give incorrect or unusable DPI information. Using XGetDefaults to get the Xft DPI if it's available and returning that. This could allow you to figure out DPI scale. 2021-06-01 16:53:39 -07:00
Nicolas Caramelli
6a2af48ad7 CMake: Generic check for desktop GL and EGL on Linux systems 2021-06-01 16:50:28 -07:00
Benson Muite
fd121b5ec0 development list has moved to forum 2021-06-01 16:49:13 -07:00
Cacodemon345
ded023870d Make CMake script more accurate to autoconf script
DBus, IBus and inotify is now able to be used outside Linux like in configure.
KMSDRM input is now working on FreeBSD with CMake compilation.
2021-06-01 15:34:52 -07:00
Ethan Lee
d32440359a wayland: Add support for maximized/restored events 2021-06-01 15:33:45 -07:00
Anthony Pesch
fc508eabe2 kmsdrm: remove redundant modeset_pending flag
this variable was added in commit 2067a7db8e and
ultimately tracks if this is a surface's first present. checking if the current
bo is NULL provides the same functionality and cuts down on a redundant piece
of state potentially getting out of sync in the future
2021-06-01 15:32:02 -07:00
Anthony Pesch
4c965b7a8d kmsdrm: fix SetDisplayMode binding the the wrong surface / context
SetDisplayMode needs to recreate the EGL surfaces, which then need to be
bound along with the correct context in each rendering thread

commit 3a1d7d9c9a removed this behavior which
has broken using SetDisplayMode when rendering with multiple contexts

the commit message was rather vague, but if the surfaces do need to be
created immediately, this process probably needs to be split such that
surface is created immediately, but the binding is deferred
2021-06-01 15:32:02 -07:00
Anthony Pesch
0219928dd5 kmsdrm: honor mode previously set by SDL_SetWindowDisplayMode when enabling fullscreen
and remove duplicate SDL_WINDOWEVENT_RESIZED event

commit 2067a7db8e made SDL_SetWindowSize and
SDL_SetWindowFullscreen modify the display mode previously set by a call to
SDL_SetWindowDisplayMode

as far as I understand the SDL API, calling SDL_SetWindowDisplayMode followed
by calling SDL_SetWindowFullscreen(..., SDL_WINDOW_FULLSCREEN) is the correct
way to mode set / switch to fullscreen

this change restores that functionaliy when switching to SDL_WINDOW_FULLSCREEN,
but other cases are still modifying the display mode set by the user. rather
than modifying the display mode set by the user, it seems this logic inside of
KMSDRM_ReconfigureWindow should be pushed further down into KMSDRM_CreateSurfaces
(as it was originally) to only modify the final mode that's set (based on the
fullscreen flags), but not override the mode requested by the user
2021-06-01 15:32:02 -07:00
Anthony Pesch
fd5de93a02 kmsdrm: fix gbm surface dimensions not matching the mode being set
commit 2067a7db8e introduced new surface_w and surface_h
variables which were passed to gbm_surface_create rather than the dimensions from the
drmModeModeInfo structure. commit 5105ecf8b1 further
refactored this code and no longer synchronized these variables inside
KMSDRM_SetDisplayMode, breaking it

this change removes the variables since they're seemingly redundant to begin with
2021-06-01 15:32:02 -07:00
Sylvain
30359a689f
Android: document workaround to use JNI on native thread (see bug #4406) 2021-06-01 20:11:59 +02:00
Timo Gurr
b63cb822bf Added T500RS to known wheel list 2021-06-01 09:54:58 -07:00
Dimitriy Ryazantcev
b81969d46f Be more explicit about Xbox 360/One device ids.
When Xbox One/Series Controllers are connected via USB on Windows they all are using `XBOXGIP` driver and produce a special ProductID `0x02FF` (GIP software PID) for any connected controller.

On the other hand `Xbox 360 Wireless Controller Reciever` (PID 0x0719) is using `XUSB` driver and produces special ProductID `0x02A1` (XUSB software PID) for each connected Xbox 360 Wireless Controller.

Also fixed Xbox One Series X Controller comment.
2021-06-01 09:54:13 -07:00
Per Nyblom
86ee383fdd Removed duplicate SDL_AtomicGet() 2021-05-28 12:29:54 -04:00
Ryan C. Gordon
fed8465085
loadbmp: Attempt to handle small palettes better.
Only adjust the biClrUsed field if it is set to zero in the bitmap, and make
some effort to make sure we don't overflow a buffer in any case.

This was triggering an issue with the sailboat bmp used for testpalette.c in
SDL 1.2, which is an 8-bit paletted image with 66 palette entries instead of
256. See discussion at https://github.com/libsdl-org/sdl12-compat/issues/63

This change might be a problem, but there's no indication this code, which
originally landed in SDL_image 17 years ago with a large rewrite, is actually
fixing a specific issue. I'm also not sure we should actually make an effort
to accept a bmp that has a biClrUsed field that is both non-zero and _also_
incorrect.
2021-05-27 10:49:25 -04:00
Sam Lantinga
db146e66c6 Fixed warnings building with Visual Studio 2021-05-25 10:34:04 -07:00
Sam Lantinga
3fcaf5b4b3 Fixed incorrect axis scaling for Nintendo Switch controllers 2021-05-25 10:33:30 -07:00
Ozkan Sezer
75725608f3 SDL_thread.h: move libc header includes before begin_code.h. 2021-05-25 14:56:56 +03:00
Ozkan Sezer
7a7cba4b73 config.guess, config.sub: fix permissions 2021-05-25 14:56:37 +03:00
Sam Lantinga
157c3f8097 [SDL] Minimize number of system calls when handling WM_INPUT raw input messages.
Details:
Currently doing 4 system calls per WM_INPUT message, which can cause the thread handling the message loop to be swapped out several times:
* GetProp - to get window data from the window handle
* GetRawInputData - to retrieve the raw input data
* 2 calls to GetMessageExtraInfo - to ignore synthetic mouse events generated for touchscreens

In this change:
* Replaced GetProp by iterating the list of windows maintained by SDL (with a fallback to GetProp). Note that this will affect all messages and not just WM_INPUT
* only calling GetMessageExtraInfo if a touchscreen has been detected

Fix for https://jira.valve.org/browse/CSGO-4855
@saml
2021-05-21 09:45:08 -07:00
Cacodemon345
dbbc725f5e Remove WSCONS mouse scaling 2021-05-19 21:09:19 -04:00
Cacodemon345
2aa14b3806 Add missing key to WSCONS-to-SDL conversion table 2021-05-19 21:09:19 -04:00
Ozkan Sezer
c63a62ae49 updates to config.guess and config.sub from mainstream. 2021-05-18 23:51:50 +03:00
Sam Lantinga
333c8e75f1 The PS5 driver supports Joystick LED 2021-05-17 11:54:05 -07:00
Ozkan Sezer
b5b7804ed4 minor update to os2 makefile. (binary output doesn't change.) 2021-05-15 00:50:20 +03:00
Ozkan Sezer
646ddfb782 minor watcom build fixes. 2021-05-15 00:22:50 +03:00
Ethan Lee
be5356af93 winrt: Fix support for multiple simultaneous mouse button presses 2021-05-14 13:33:59 -07:00
Sylvain
62a562dea2
X11: use x11sym loaded functions (see bug #3978) 2021-05-12 23:37:18 +02:00
Sylvain
531d83bf6a
X11: allow using touchscreen, while pointer is grabbed (see bug #3978) 2021-05-12 23:13:48 +02:00
Cacodemon345
ddc6be3559 KMSDRM on Dragonfly BSD doesn't work without being root 2021-05-12 09:26:23 -07:00
Kimplul
9e1d7baef1 Added T300RS to known wheel list 2021-05-12 09:25:57 -07:00
Ryan C. Gordon
e1db4b82ec
egl: Don't crash if we failed halfway through SDL_CreateWindow. 2021-05-11 14:08:17 -04:00
Ethan Lee
f2f451a59d wayland: Call SetWindowBordered at the end of ShowWindow 2021-05-10 11:11:38 -07:00
Fredrick Brennan
c5dd9964c1 Copied X11 error handler code from SDL_x11opengl.c
Avoids needing to malloc to hold the error string.
2021-05-10 13:31:39 -04:00
Fredrick Brennan
b3b4677e32 (X11) Set _NET_WM_NAME properly, fixes Unicode window titles
Removes deprecated code meant to support extremely ancient, pre-UTF-8
versions of Xorg. Uses new xlib API's for doing this same thing.

Closes #4288.
2021-05-10 13:31:39 -04:00
Ryan C. Gordon
f4ab1c94f9
gamecontrollerdb: Add entry for the 8BitDo Receiver for Linux.
Fixes #3048.
2021-05-10 13:08:34 -04:00
Ryan C. Gordon
bedc509afc
gamecontrollerdb: added entry for PowerA XBox One Controller for Linux.
Fixes #3910.
2021-05-10 13:04:59 -04:00
Ethan Lee
efbb6ff9d7 wayland: Create the server decorations after the toplevel has been configured 2021-05-10 12:49:26 -04:00
Ryan C. Gordon
9dc97afa71 cocoa: Report an error if SDL_SetClipboardText() isn't using UTF-8 encoding.
Fixes #4110.
2021-05-08 12:39:50 -04:00
Sam Lantinga
107db2d899 Enable TV game mode by default on Android 2021-05-07 12:43:35 -07:00
Sam Lantinga
9231f1f1cf Added support for the PS5 controller on iOS and tvOS 2021-05-07 12:29:03 -07:00
Sam Lantinga
2ad73db6e2 Merge commit '889cebb7c20d4195e5d4ac344a2175f2490354cc' into main 2021-05-07 12:28:57 -07:00
Sam Lantinga
e589810cc4 Merge commit '31637ddeea1e302c77193341b2006d45dc54de98' into main 2021-05-07 12:28:55 -07:00
Sam Lantinga
6d4991b87b Merge commit 'f309d0649d37022ad49bc468c77dd87bf82f261b' into main 2021-05-07 12:28:53 -07:00