Previously it was using setTimeout, not setInterval, so it would only fire
once, which was obviously a mistake.
(cherry picked from commit fb79211732d0cdf17a250a43c619b6938842cfaf)
Since the top-level table is getting undefined, all the things in it will
be unreachable and eligible for garbage collection without explicitly
nulling them out.
(cherry picked from commit 5191b20541fce0e3b3071124ced69c31fcaeb783)
Now, if the AudioContext starts in a "suspended" state, because the browser
blocked it from playing by default, we we run the audio "thread" in a timer
and throw away the generated audio. Once the AudioContext is allowed to
resume, we clear this timer.
The end result is that the app will continue to drain its audio queue
instead of consuming more memory over time (and, if it relies on an audio
callback to make progress, continue to run!), with the effect that the
page is merely silent but otherwise functioning as intended.
Once the user interacts with the page and the browser permits the the
AudioContext to run for real, audio should still be in sync, instead of
just starting to play audio that might now be at least several seconds behind.
(cherry picked from commit fd75a4ca05bdbd7b0fecf781e59c77a07d264b16)
An overflow occured in the stdlib_sscanf test, when using msys2 clang32 toolchain.
(cherry picked from commit 342ec5113171214154cb197bb3e0e3a0056ea2ad)
Applications that don't specify a rendering flag are likely handling Vulkan/GL themselves, so SDL loading OpenGL by default in this case is unnecessary overhead, and if a render backend requires it, the window will be recreated with the appropriate flags when the renderer is initialized.
(cherry picked from commit 9ab20251277d001ee34caeb59a7eaa54b40af622)
Many of the Flydigi controllers use the same VID/PID and have different mappings, so let's revisit this once we have more data.
(cherry picked from commit 5388edd5494030b8c43b2f79e3f5c9b71f57a703)
as offscreen is enabled in CMakeLists.txt, we get a blanks window
otherwise.
From a patch by Silvan Scherrer, at Bitwiseworks' fork.
(cherry picked from commit 66d5ad19f0260f42426a66fe664b6e98291faa37)
When a hardware keyboard is attached, it can take over 100 ms for the keyboard event to generate text input. In that case we want to record that we recently received a keyboard event so we don't synthesize duplicate virtual key press/release events for the input text.
(cherry picked from commit 648de4f9b8ebcf9e794aba2ec2955d129167c48b)
When a hardware keyboard is attached to an iPad, you can easily trigger a set of on-screen keyboard transitions that will take place over time, and we need to track whether we're currently showing or hiding the keyboard and make sure we don't clobber the existing state during those transitions.
Testing:
* Connected a hardware keyboard to an iPad
* Launched checkkeys
* Noted the keyboard bar was active at the bottom of the screen and text input was active
* Tapped with both fingers to quickly toggle text input off and back on
* Noted the keyboard bar slid down and then back up, and text input was active
* Tapped on the keyboard bar to bring up the full on-screen keyboard and then closed it so the keyboard bar was still active, and text input was still active
* Tapped on the screen to turn text input off, noted the keyboard bar slid down
* Tapped with both fingers to quickly toggle text input on and back off
* Noted that the keyboard bar slid up and then back down, and text input was inactive
* Tapped on the screen to turn text input on, tapped on the keyboard bar to bring up the full on-screen keyboard, and text input was active
* Pressed a key on the physical keyboard, the on-screen keyboard closed, the key press and release was delivered (with no text input) and then the keyboard bar slid up, and text input was active again
Fixes https://github.com/libsdl-org/SDL/issues/7979
(cherry picked from commit c3288d113e434b20d2f0dda73210d3a52504d199)
This is another attempt to make sure we don't cause beeps from unhandled key presses while still allowing full text input functionalty.
If this isn't selective enough, we might need to go up the responder chain to see what's going to handle the event before passing it along.
Fixes https://github.com/libsdl-org/SDL/pull/6962
(cherry picked from commit a8abe612ed5597cbaabb903c0121b5b48baee91d)
This reverts commit bbf38bbbc334bc0ee90d3eec228a968d8fc1689e, which prevented text input from working when a hardware keyboard was connected, since key strokes don't get to the text input field.
Fixes https://github.com/libsdl-org/SDL/issues/7958
(cherry picked from commit f5ea6ae18d860796184b9b31a2005957cb7e30a2)
This can happen if a monitor is in the process of becoming primary because another monitor was disconnected.
(cherry picked from commit 07578fde3dad2dadd605f5b18399c8d021f6ae5d)
This fixes video initialization on headless systems with VNC
Fixes https://github.com/libsdl-org/SDL/issues/8054
(cherry picked from commit 71099149b8fc062ea0ece232ccdd9f0ee9b3588b)
This adds support for the back paddles, and the "..." key
which are not automatically detected.
* "Back" is mapped to the top left "two windows" key.
* "Start" is mapped to the top right "hambuger menu" key.
* "Guide" is mapped to the "Steam" key.
* The "..." key is just a generic button.
When looking at the screen, paddles are number
* P1: Top right
* P2: Top left
* P3: Bottom right
* P4: Botom Left
The new controller mapping was created with the SDL3 gamepadmap tool.
(cherry picked from commit 27b8abb0562f46e64337d5d799b877c357001254)
- Fixed audio device detection and usage.
- Implemented audio capture support
- Refactored buffer handling to separate pointers to fill and drain buffers.
Based on patches by josch1710 and Lars Erdmann:
https://github.com/bitwiseworks/SDL2-os2/pull/7
This call is actually a left-over when porting from fcitx4 service to the new org.freedesktop.portal.Fcitx supported by both fcitx4/fcitx5. CloseIC is actually never a part of the new interface on org.freedesktop.portal.Fcitx. It cause any issue user visible effect.
In this case we know the controller has been on for a while and the Bluetooth connection LED cycle is complete.
Also fixed the timestamp being zero the first time it is checked
(cherry picked from commit bd4f155bbbdc4be34505535e4bd936ae12671925)
That will put the PS5 controller into enhanced mode, which breaks DirectInput games
(cherry picked from commit 2fef0be2f646ae048e239aa6694e632081c85238)
If, in the case where all displays has been disconnected, and some window state change occurs before an active display is re-added and finalized, the pointer returned by SDL_GetDisplayForWindow() will be null necessitating that the returned pointer be checked for validity before dereferencing it.
- Make sure the hotplug thread has hit its main loop before letting
DetectDevices continue.
- Don't unref the context subscription operation until it completes
(or we are shutting down).
I'm not sure which change fixed the problem, but at least one of them
appears to have done so.
Reference Issue #7971.