Commit Graph

6590 Commits (d5572559a5016d8068706de4614496a19f8970d4)

Author SHA1 Message Date
Ryan C. Gordon c2f26087c8
Merge branch 'main' into em-webgl-selector-hint 2022-11-23 13:22:23 -05:00
Yevhen Babiichuk (DustDFG) a05b2fbeee Use alias types for `which` members of event structs instead of plain types
Signed-off-by: Yevhen Babiichuk (DustDFG) <dfgdust@gmail.com>
2022-11-23 10:19:13 -08:00
Susko3 8f991d7576 Define `TOUCHEVENTF_PEN` if not defined 2022-11-23 10:09:08 -08:00
Susko3 42796c56a9 Differentiate between Windows Ink (pen) and regular touch input 2022-11-23 10:09:08 -08:00
Ozkan Sezer 34231f5ba0 reverted opengles removal. 2022-11-23 18:50:02 +03:00
Ozkan Sezer 016b757311 reverted jack audio backend removal. 2022-11-23 06:50:20 +03:00
Ethan Lee ecc4b8773c
wasapi: Removed WinRT PrivateAudioData members 2022-11-22 17:12:56 -05:00
Ethan Lee 57458588ee wasapi: Merge wasapi_win32.c into wasapi.c 2022-11-22 16:46:12 -05:00
Ozkan Sezer dc2a3e06e9 removed WinRT support. 2022-11-22 23:36:24 +03:00
Ozkan Sezer 7df102d220 reverted sndio backend removal. 2022-11-22 22:04:10 +03:00
Sam Lantinga 3b318f981e Removed G29 from controller_type.c
We don't want the G29 to show up as a gamepad, Steam will create a virtual Xbox controller for it, which breaks racing games.

(cherry picked from commit dce6ed56d72b436f15c044b05097ddebbc166701)
2022-11-22 10:57:45 -08:00
Sam Lantinga 189f71efb3 Revert "Added Linux mappings for the Logitech G29 in PS3 and PS4 modes"
This reverts commit 33a68f575f.

We don't want the G29 to show up as a gamepad, Steam will create a virtual Xbox controller for it, which breaks racing games.

(cherry picked from commit e3d430b83eb7c754c789fb23184feb745c2b99a8)
2022-11-22 10:57:39 -08:00
Ozkan Sezer 30b1ab2add removed opengles. 2022-11-22 21:48:40 +03:00
Ozkan Sezer 3cccaeba6c removed jack audio remnants. 2022-11-22 20:51:07 +03:00
Ozkan Sezer 3aea865cdf removed directfb support. 2022-11-22 20:45:45 +03:00
Ozkan Sezer 5cedc2f1ff removed QNX support. 2022-11-22 20:23:40 +03:00
Ozkan Sezer e89a1f9157 removed NaCL support. 2022-11-22 20:10:47 +03:00
Ozkan Sezer cdb54ad21e removed arts, esd, fusionsound, nas, paudio, sndio, sunaudio, winmm audio backends. 2022-11-22 19:51:56 +03:00
Ozkan Sezer 8d6fda4810 removed os2 support & support for building SDL with watcom. 2022-11-22 19:18:47 +03:00
Ozkan Sezer 63243eb3a5 removed pandora support 2022-11-22 18:50:00 +03:00
Sam Lantinga 2c4159b99a First pass at changing SDL 2.0 to SDL 3.0 2022-11-21 20:28:58 -08:00
Sam Lantinga 0bfeed061b Updated to version 2.26.0 for release 2022-11-21 16:15:58 -08:00
Sam Lantinga d167cd6715 Added the Gunfighter Mk.III ‘Space Combat Edition’ as a flight stick 2022-11-21 09:02:10 -08:00
Sam Lantinga 8b20b568b0 Don't report battery level for disconnected batteries
Fixes https://github.com/libsdl-org/SDL/issues/6536
2022-11-21 07:42:14 -08:00
Frank Praznik fe396e306e wayland: Use the cached window size when switching from non-floating to floating window state
When changing the window state from non-floating to floating (e.g. leaving fullscreen), libdecor can send bogus content sizes that are +/- the height of the window title bar and start 'walking' the window height in one direction or the other with every transition.

The floating window size is known, so use the cached value instead of the size reported by libdecor when restoring the floating state.
2022-11-19 09:15:27 -08:00
Sam Lantinga 509939b1b6 Disable the third party PS3 HIDAPI driver by default, the L3/R3 buttons are unknown 2022-11-18 18:20:53 -08:00
Sam Lantinga ff99e56d3a Fixed KMSDRM window creation failing if OpenGL libraries are not available, but GLES 2.0 libraries are 2022-11-18 12:54:55 -08:00
Sam Lantinga da9ba3a2a1 If a CRTC doesn't have a mode configured, use the preferred or largest mode as the default mode
Fixes https://github.com/libsdl-org/SDL/issues/6421
2022-11-18 12:17:27 -08:00
Sam Lantinga ea4ea27a59 Don't trigger an error if we try to delete a touch device after shutting down the touch system
This can happen on Raspberry Pi if the display system fails to initialize.
2022-11-18 11:14:14 -08:00
David Gow 81479d8784 wayland: keyboard: Cache text input parameters.
Some applications (and embarrassingly, testime is one of them) call
SDL_StartTextInput() or SDL_SetTextInputRect() every frame. On KDE/KWin
with fcitx5, this causes there to be several preedit events every frame
(particularly given some of the workarounds in Wayland_StartTextInput),
which slows testime down to an unusable crawl.

Instead, make SDL_StartTextInput() a no-op if text input is already
enabled, and cache the input rect, only changing it when the new rect is
actually different.

With these changes, we only get preedit events (and hence
SDL_TEXTEDITING events) when the preedit string actually changes. This
matches the behaviour under XWayland, and works very smoothly.
2022-11-18 07:18:36 -08:00
Ozkan Sezer 6dc96aa745 SDL_UDEV_DelCallback: return early if _this is NULL
Fixes https://github.com/libsdl-org/SDL/issues/6548
2022-11-18 18:02:10 +03:00
Sylvain 16824865c2 Cleanup of SDL_SetError that already return -1 value 2022-11-18 06:59:10 -08:00
Sylvain 3e70553c48 Unneed test before calling SDL_FreeSurface 2022-11-18 06:58:34 -08:00
Sam Lantinga 78ea6af2cd Updated to version 2.25.1 for release candidate 2022-11-17 09:01:35 -08:00
Sylvain 89572af6a8
Fixed bug #6537 - AIX: use PAUDIO_WaitDevice 2022-11-17 11:43:46 +01:00
Sylvain cd0d5a5fc5
Don't compare pointer against '0', but NULL 2022-11-17 11:23:15 +01:00
Sylvain ddad901c0d
Remove unneeded semicolon 2022-11-17 10:43:45 +01:00
Sylvain 60c6cd554d
Fixed bug #6533 - PS2_JoystickUpdate: some invalid condition 2022-11-17 09:34:27 +01:00
Sam Lantinga 77bcd269be Allow creating an empty surface with pitch 0
This fixes Maelstrom, which creates an empty staging surface and then uses it for transfer to texture
2022-11-16 22:23:16 -08:00
Ryan C. Gordon a1702d463c
ibus: Try to use org.freedesktop.portal.IBus first if available.
This should fix apps that want ibus support inside sandboxed environments
like FlatPak or Snaps.

Fixes #4706.
2022-11-16 23:39:41 -05:00
Ryan C. Gordon bb0b8adacc mac: Fix handling of deprecated symbol.
This needs to check what our deployment target is, not what SDK
is available, since this is a linker symbol and not an enum
value or whatever.

Also removed a copy/paste error that mentioned CoreAudio in
the haptic subsystem.

Fixes #6534.
2022-11-16 22:04:04 -05:00
Sam Lantinga 913e403f2a Fixed error message when trying to create an OpenGLES2 renderer on macOS
Testing: testsprite2 --renderer opengles2

OpenGLES2 isn't available by default, and we want to see the error "Could not load EGL library"
2022-11-16 18:03:29 -08:00
Sam Lantinga fcc994e132 ensure that SDL2 does not set conflicting window flags (thanks @pionere!) 2022-11-16 17:40:32 -08:00
Sylvain ce5da5d579
Don't compare pointer against '0', but NULL 2022-11-16 21:47:43 +01:00
Sylvain 1d7966df15
Remove un-needed check for NULL pointer. They were previously checked just before. 2022-11-16 21:27:16 +01:00
Frank Praznik 8ea96f365f events: Remove X and XKB keysym constants and headers
The XKB_KEY_* and XK_* macros resolve to the same constant values, so use the raw values and note what keys they correspond to in the comments, as is done for the other keysym values in this file.

This completely eliminates the need for any X or XKB system headers along with the if/else defines.
2022-11-16 11:42:53 -08:00
Ryan C. Gordon 389ffab733 Code style fixes, etc.
Reference PR #6345.
2022-11-16 12:53:48 -05:00
ulatekh ec58a817ef Fixes made in response to running a static code analyzer under MS Windows.
Most of these are probably harmless, but the changes to SDL_immdevice.c and SDL_pixels.c appear to have fixed genuine bugs.

SDL_audiocvt.c: By separating the calculation of the divisor, I got rid of the suspicion that dividing a double by an integer led to loss of precision.
SDL_immdevice.c: Added a missing test, one that could have otherwise led to dereferencing a null pointer.
SDL_events.c, SDL_gamecontroller.c, SDL_joystick.c, SDL_malloc.c, SDL_video.c: Made it clear the return values weren't used.
SDL_hidapi_shield.c: The size is zero, so nothing bad would have happened, but the SDL_memset() was still being given an address outside of the array's range.
SDL_dinputjoystick.c: Initialize local data, just in case IDirectInputDevice8_GetProperty() isn't guaranteed to write to it.
SDL_render_sw.c: drawstate.viewport could be null (as seen on line 691).
SDL.c: SDL_MostSignificantBitIndex32() could return -1, though I don't know if you want to cope with that (what I did) or SDL_assert() that it can't happen.
SDL_hints.c: Replaced boolean tests on pointer values with comparisons to NULL.
SDL_pixels.c: Looks like the switch is genuinely missing a break!
SDL_rect_impl.h: The MacOS static checker pointed out issues with the X comparisons that were handled by assertions; I added assertions for the Y comparisons.
SDL_yuv.c, SDL_windowskeyboard.c, SDL_windowswindow.c: Checked error-result returns.
2022-11-16 12:43:20 -05:00
Ryan C. Gordon 7ebdae5dc9 cocoa: Fix OpenGL deprecation warning. 2022-11-16 11:45:41 -05:00
Ryan C. Gordon 7c760f7f79 cocoa: Update CVDisplayLink timing when screen changes.
This handles both the window moving to a new display and
changing the current display's refresh rate in System
Preferences

Reference Issue #4918.
2022-11-16 11:35:27 -05:00