Log

Author Commit Date CI Message
Sam Lantinga 73799917 2020-03-16T13:28:38 Fixed bug 3446 - The haptic API does not allow to select the direction axes Mathieu Laurendeau Consider a device supporting effects on multiple axes. There's currently no way to play effects against a single-axis direction. A device supporting effects against X and Y may not allow to play effects with a two-axis direction coordinate, even if one of the coordinates is null. My current (ugly) work around for this is to add a direction type SDL_HAPTIC_X_FORCE to play effects against a X-axis only direction (patch attached). This issue impacted two GIMX users using the following wheels: - Leo Bodnar SimSteering force feedback wheel - Accuforce direct drive wheel Playing constant/spring/damper effects against a X-axis direction worked well for the first wheel, but not for the second one. A better strategy seems to play the effects against the first axis reported by the DirectInput enumeration. This strategy also works with Logitech wheels (at least the DFGT). It's been more than a year that I have the latest patch (playing effects against the first axis only) in the GIMX software. It's being used by thousands of people, mostly for adapting their FFB wheel to the PS4. I had no report that proves this strategy to be wrong.
Sam Lantinga 543994b1 2020-03-16T12:25:02 Fixed bug 4477 - Support more than 4 XInput-capable devices on Windows Jimb Esser Add new RawInput controller API, and improved correlation with XInput/WGI Reorder joystick init so drivers can ask the others if they handle a device reliably Do not poll disconnected XInput devices (major perf issue) Fix various cases where incorrect correlation could happen Simple mechanism for propagating unhandled Guide button presses even before guaranteed correlation Correlate by axis motion as well as button presses Fix failing to zero other trigger Fix SDL_HINT_JOYSTICK_HIDAPI not working if set before calling SDL_Init() Add missing device to device names Disable RawInput if we have a mismatch of XInput-capable but not RawInput-capable devices Updated to SDL 2.0.13 code with the following notes: New HID driver: xbox360w - no idea what that is, hopefully urelated SDL_hidapijoystick.c had been refactored to couple data handling logic with device opening logic and device lists caused some problems, yields slightly uglier integration than previously when the 360 HID device driver was just handling the data. SDL_hidapijoystick.c now often pulls the device off of the joystick_hwdata structure for some rumble logic, but it appears that code path is never reached, so probably not a problem. Looks like joystick_hwdata was refactored to not include a mutex in other drivers, maintainers may want to do the same refactor here if that's useful for some reason. Something changed in how devices get names, so getting generic names. Had to fix a (new?) bug where removing an XInput controller caused existing controllers (that moved to a new XInput index) to get identified as 0x045e/0x02fd ("it's probably Bluetooth" in code), rendering the existing HIDAPI_IsDevicePresent and new RAWINPUT_IsDevicePresent unreliable.
Sam Lantinga 4dea340c 2020-03-16T12:23:38 Fixed bug 4477 - Support more than 4 XInput-capable devices on Windows Jimb Esser Add new RawInput controller API, and improved correlation with XInput/WGI Reorder joystick init so drivers can ask the others if they handle a device reliably Do not poll disconnected XInput devices (major perf issue) Fix various cases where incorrect correlation could happen Simple mechanism for propagating unhandled Guide button presses even before guaranteed correlation Correlate by axis motion as well as button presses Fix failing to zero other trigger Fix SDL_HINT_JOYSTICK_HIDAPI not working if set before calling SDL_Init() Add missing device to device names Disable RawInput if we have a mismatch of XInput-capable but not RawInput-capable devices Updated to SDL 2.0.13 code with the following notes: New HID driver: xbox360w - no idea what that is, hopefully urelated SDL_hidapijoystick.c had been refactored to couple data handling logic with device opening logic and device lists caused some problems, yields slightly uglier integration than previously when the 360 HID device driver was just handling the data. SDL_hidapijoystick.c now often pulls the device off of the joystick_hwdata structure for some rumble logic, but it appears that code path is never reached, so probably not a problem. Looks like joystick_hwdata was refactored to not include a mutex in other drivers, maintainers may want to do the same refactor here if that's useful for some reason. Something changed in how devices get names, so getting generic names. Had to fix a (new?) bug where removing an XInput controller caused existing controllers (that moved to a new XInput index) to get identified as 0x045e/0x02fd ("it's probably Bluetooth" in code), rendering the existing HIDAPI_IsDevicePresent and new RAWINPUT_IsDevicePresent unreliable.
David Ludwig cc37ee8a 2020-03-16T00:21:22 virtual joysticks: add autotools-build support (Bug 5028) Autotools support for virtual-joysticks turns it OFF by default. To turn it on, pass the following into configure: --enable-joystick-virtual
David Ludwig 40625c4e 2020-03-15T16:01:19 virtual joysticks: MSVC support part 2/2, add file refs to MSVC projects (bug 5028)
David Ludwig b2296506 2020-03-15T15:05:36 virtual joysticks: MSVC support part 1/2, make driver's .c file be uniquely named
David Ludwig 513730c4 2020-03-15T14:40:51 iOS: fixed build error when building test apps via Xcode CoreBluetooth.framework needed to get linked into test apps, all of which are currently using statically-linked SDL.
David Ludwig 9b1ea290 2020-03-15T14:21:05 virtual joysticks: added source files to Xcode projects (Bug 5028)
David Ludwig d6476155 2020-03-15T13:35:03 virtual joysticks: improved docs for SDL_JoystickSetVirtual* functions
David Ludwig cc908756 2020-03-15T13:25:49 virtual joysticks: removed ball support (Bug 5028)
Sam Lantinga 151c8fbf 2020-03-14T17:45:00 Fixed build error Malte Kie?ling I get a build error in SDL_sysjoystick.c:74 for the merged patch, but its nothing to sweat about, just -Werror=declaration-after-statement doing its usual stuff.
Sam Lantinga 1ff483d1 2020-03-13T21:28:09 Added SDL_GetErrorMsg() to get the error message in a thread-safe way
Sam Lantinga 19c34844 2020-03-13T19:19:29 Fixed slow enumeration when Apple Cinema HD display 30" is plugged in
Sam Lantinga 2be75c6a 2020-03-13T19:08:45 Fixed bug 5028 - Virtual Joysticks (new joystick backend) David Ludwig I have created a new driver for SDL's Joystick and Game-Controller subsystem: a Virtual driver. This driver allows one to create a software-based joystick, which to SDL applications will look and react like a real joystick, but whose state can be set programmatically. A primary use case for this is to help enable developers to add touch-screen joysticks to their apps. The driver comes with a set of new, public APIs, with functions to attach and detach joysticks, set virtual-joystick state, and to determine if a joystick is a virtual-one. Use of virtual joysticks goes as such: 1. Attach one or more virtual joysticks by calling SDL_JoystickAttachVirtual. If successful, this returns the virtual-device's joystick-index. 2. Open the virtual joysticks (using indicies returned by SDL_JoystickAttachVirtual). 3. Call any of the SDL_JoystickSetVirtual* functions when joystick-state changes. Please note that virtual-joystick state will only get applied on the next call to SDL_JoystickUpdate, or when pumping or polling for SDL events (via SDL_PumpEvents or SDL_PollEvent). Here is a listing of the new, public APIs, at present and subject to change: ------------------------------------------------------------ /** * Attaches a new virtual joystick. * Returns the joystick's device index, or -1 if an error occurred. */ extern DECLSPEC int SDLCALL SDL_JoystickAttachVirtual(SDL_JoystickType type, int naxes, int nballs, int nbuttons, int nhats); /** * Detaches a virtual joystick * Returns 0 on success, or -1 if an error occurred. */ extern DECLSPEC int SDLCALL SDL_JoystickDetachVirtual(int device_index); /** * Indicates whether or not a virtual-joystick is at a given device index. */ extern DECLSPEC SDL_bool SDLCALL SDL_JoystickIsVirtual(int device_index); /** * Set values on an opened, virtual-joystick's controls. * Returns 0 on success, -1 on error. */ extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualAxis(SDL_Joystick * joystick, int axis, Sint16 value); extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualBall(SDL_Joystick * joystick, int ball, Sint16 xrel, Sint16 yrel); extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualButton(SDL_Joystick * joystick, int button, Uint8 value); extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualHat(SDL_Joystick * joystick, int hat, Uint8 value); ------------------------------------------------------------ Miscellaneous notes on the initial patch, which are also subject to change: 1. no test code is present in SDL, yet. This should, perhaps, change. Initial development was done with an ImGui-based app, which potentially is too thick for use in SDL-official. If tests are to be added, what kind of tests? Automated? Graphical? 2. virtual game controllers can be created by calling SDL_JoystickAttachVirtual with a joystick-type of SDL_JOYSTICK_TYPE_GAME_CONTROLLER, with naxes (num axes) set to SDL_CONTROLLER_AXIS_MAX, and with nbuttons (num buttons) set to SDL_CONTROLLER_BUTTON_MAX. When updating their state, values of type SDL_GameControllerAxis or SDL_GameControllerButton can be casted to an int and used for the control-index (in calls to SDL_JoystickSetVirtual* functions). 3. virtual joysticks' guids are mostly all-zeros with the exception of the last two bytes, the first of which is a 'v', to indicate that the guid is a virtual one, and the second of which is a SDL_JoystickType that has been converted into a Uint8. 4. virtual joysticks are ONLY turned into virtual game-controllers if and when their joystick-type is set to SDL_JOYSTICK_TYPE_GAMECONTROLLER. This is controlled by having SDL's default list of game-controllers have a single entry for a virtual game controller (of guid, "00000000000000000000000000007601", which is subject to the guid-encoding described above). 5. regarding having to call SDL_JoystickUpdate, either directly or indirectly via SDL_PumpEvents or SDL_PollEvents, before new virtual-joystick state becomes active (as specified via SDL_JoystickSetVirtual* function-calls), this was done to match behavior found in SDL's other joystick drivers, almost all of which will only update SDL-state during SDL_JoystickUpdate. 6. the initial patch is based off of SDL 2.0.12 7. the virtual joystick subsystem is disabled by default. It should be possible to enable it by building with SDL_JOYSTICK_VIRTUAL=1 Questions, comments, suggestions, or bug reports very welcome!
Sam Lantinga 879f137a 2020-03-13T19:00:24 Added support for the older Xbox One S Bluetooth controller report format
Sam Lantinga d662a659 2020-03-13T19:00:22 Fixed crash if manufacturer or product string is NULL
Sam Lantinga 255c9c23 2020-03-13T13:28:33 Fixed bug 4921 - Do not swap B/X buttons on GameCube controller unless it's requested The binding for the Mayflash GameCube controller adapter now respects the SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS hint
Sam Lantinga 6318765d 2020-03-13T13:05:43 Handle entirely duplicated joystick product names, as well as vendor and product names that start with the name of the vendor, but with different case (e.g. 8bitdo 8BitDo)
Sam Lantinga de2001ee 2020-03-13T13:05:40 Fixed binding the D-PAD on the 8BitDo M30 controller
Sam Lantinga cb2f78b1 2020-03-13T13:05:38 Updated 8BitDo SF30 Pro mapping with hint support, added Android binding for the 8BitDo M30 Gamepad
Sam Lantinga cb986aff 2020-03-13T13:05:32 Fixed exception at shutdown if the controllers are closed after the HIDDeviceManager is shutdown
Sam Lantinga 80d075a0 2020-03-13T09:43:48 Fixed compiler warnings
Sam Lantinga 5722e884 2020-03-12T19:49:33 Fixed build warnings
Sam Lantinga c44473ba 2020-03-12T19:47:30 Unified code to standardize joystick names
Sam Lantinga db3b3a1d 2020-03-12T19:47:28 Added support for SDL hints in the game controller mapping database
Ethan Lee 133b4755 2020-03-11T14:17:19 Use LIBUSB_CALL for hidapi's read_callback function
Sam Lantinga 1102678b 2020-03-10T18:35:53 Added tag release-2.0.12 for changeset 7715fef44900
Sam Lantinga 983bbf9e 2020-03-10T18:35:31 Backed out changeset 51622f74dc85
Sam Lantinga 9fdc6cf3 2020-03-10T18:34:33 Removed Xbox HIDAPI debug code
Sam Lantinga 93ed3c8b 2020-03-10T18:25:47 Updated SDL to version 2.0.13 for development builds
Sam Lantinga 4fb06a2a 2020-03-10T18:25:47 Updated SDL to version 2.0.13 for development builds
Sam Lantinga 5c87b8e1 2020-03-10T18:17:41 Added tag release-2.0.12 for changeset 6915d6569091
Sam Lantinga fe979921 2020-03-10T17:35:14 Read the buttons on Nintendo Switch and GameCube controllers as they are labeled, and swap them if the applications wants positional button data instead.
Sam Lantinga 4caa6a06 2020-03-10T16:41:42 Fixed bug 4921 - Do not swap B/X buttons on GameCube controller unless it's requested Ethan Lee Basically replicating the solution of the Switch Controller's button label issue. Physical layout should take priority unless it's explicitly requested by the user or application!
Sam Lantinga 342f62ca 2020-03-10T16:29:28 Fixed bug 5022 - SDL_iconv_string can get stuck in an infinite loop when encountering invalid characters ciremo6483 In `SDL_iconv_string` the `while (inbytesleft > 0)` loop can end up in a state where it never terminates because the library `iconv` function called from `SDL_iconv` doesn't consume any bytes. This happened when a `WCHAR_T` input string was being converted to `UTF-8` but contained invalid characters. It would first It would first skip a few bytes due to `case SDL_ICONV_EILSEQ` but when there were 3 bytes remaining of `inbytesleft` `iconv` just didn't consume anything more (but didn't throw an error either). It just so happens that the Microsoft Classic IntelliMouse `product_string` contains such invalid characters (`"Microsoft? Classic IntelliMouse?"`), meaning the function would get stuck with said mouse plugged in. A fix for this would be to check if `inbytesleft` was unchanged after an iteration and in that case either decrement the counter like when `SDL_ICONV_EILSEQ` is returned or simply break the loop.
Sam Lantinga 1f4965c8 2020-03-08T21:24:06 Fixed warnings building with mingw64
Sam Lantinga 611403dd 2020-03-08T21:02:40 Clarified that the clip rectangle is defined relative to the viewport, and added a clip test to testviewport.c
Sam Lantinga c8c05a9f 2020-03-08T19:23:21 Fixed bug 4991 - Pixel shader problem when recreating a texture for direct3d renderer cmediaplayer Hi, i already mentioned in the SDL discourse a bug that recreating of a texture occours pixel shader problem on direct3d renderer. There is no problem for direct3d11. You can see the issue by using my app named C Media Player which is available for Windows for free using my web site www.cmediaplayer.com. Just follow the steps: *Open a media file *When playing the file change the scale quality under the video menu. *You will see the problem.
Sam Lantinga 367a3561 2020-03-08T18:56:07 Don't release the backbuffer on error, we didn't acquire it.
Cameron Gutman 4e0fb110 2020-03-07T19:21:21 Clear the old player index slot when moving to a new one
Cameron Gutman 165ccaa8 2020-03-07T17:20:04 Fix incorrect player index when assigning a joystick the same index twice Prior to this fix, we would hit the existing_instance >= 0 case and move the joystick again to a different index than the one requested by the caller. It also breaks the assumption that a SDL_JoystickID is only present in SDL_joystick_players at one location.
Cameron Gutman e152a3ce 2020-03-07T13:59:42 direct3d: Don't attempt to create zero sized vertex buffer
Cameron Gutman 467434b9 2020-03-07T13:17:28 Added support for indicating player index on DS4 controllers
Sam Lantinga 82be6dd7 2020-03-07T08:48:04 Fixed regression in bug 4966 - KMSDRM: Add dynamic modeset support Anthony Pesch I was just communicating with one of the Retropie developers regarding this. This change removed the forced window focus change on creation (https://github.com/inolen/SDL-mirror/commit/3534cb3793f4744509f020f1267f510ec7099366) as part of the change no longer assumes there's only a single window being created. This was perhaps an over-aggressive removal. Due to that change, joystick events are only received if SDL_SetKeyboardFocus is called explicitly, or if the app has specified SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS. I think that part of my change should be reverted to continue setting mouse / keyboard focus to the window being created. If SDL_WINDOW_INPUT_FOCUS is to be used as an input flag the code could be conditional, but that would still leave existing software broken.
Sam Lantinga 37faac0d 2020-03-05T08:43:16 Fixed java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.WindowManager android.app.Activity.getWindowManager()' on a null object reference
Sam Lantinga e9bc21fb 2020-03-04T17:10:37 Fixed rumble for third-party Nintento Switch Pro controllers The 8BitDo SF30 Pro Gamepad will generate a single motor pulse for each rumble message, so we need to do this frequently to have continous rumble on this device.
Sam Lantinga 428cfddb 2020-03-04T14:59:44 Fixed crash when a controller is disconnected while rumble is pending
Sam Lantinga 281d05a6 2020-03-04T09:42:10 Fixed handling the guide button with both V1 and V2 of the Xbox One Bluetooth wireless protocols
Sam Lantinga 69a8c846 2020-03-04T09:42:08 Fixed using more than one Xbox Bluetooth controller Don't prevent duplicate devices using hidraw, instead libusb takes precedence and all hidraw devices that aren't handled by libusb are available
Sam Lantinga 2a91f682 2020-03-03T17:56:33 Fixed bug 5012 - KaiOS keycodes support pelya KaiOS is an OS for feature phones, with numeric keypad and non-touch screen, and typically 512 Mb RAM and 4 Gb flash. It is based on Firefox OS, all apps are made with HTML5 and Javascript. SDL can be cross-compiled using emscripten and packaged as native app. This patch adds support for star '*' and pound '#' keys on such phones to generate SDL events.
Ethan Lee 27889d02 2020-03-03T12:31:41 winrt: Wait for EnumerationCompleted before leaving WASAPI_EnumerateEndpoints
Sam Lantinga 96836ec6 2020-03-03T09:22:43 Add 500ms max wait time for hid_write to complete on Windows It appears that with some (presumably) flaky drivers or hardware that the WriteFile in hid_write never completes leading to GetOverlappedResult to block forever waiting for it.
Sam Lantinga 07000bfc 2020-03-02T17:31:58 Fixed bug 5010 - SDL_Init with SDL_INIT_JOYSTICK hangs for 10 seconds when playing audio from another application Jake Breen I have tracked it down to a call on hid_device_info() -> HidD_GetManufacturerString (Line 499 in src\hidapi\windows\hid.c)
Sam Lantinga c7a739be 2020-03-02T15:24:10 Fixed bug 4643 - Append EGL CFLAGS in CheckOpenGLESX11 Danilo Spinella EGL need -DMESA_EGL_NO_X11_HEADERS in systems without X11 installed. Make CMake checks import EGL CFLAGS. Relevant bug: https://bugzilla.libsdl.org/show_bug.cgi?id=4243
Sam Lantinga aa384ad0 2020-03-02T15:21:07 Fixed bug 5001 - Feature request: SDL_isupper & SDL_islower
Sam Lantinga a8f91340 2020-03-02T15:14:52 Updated configure with change from last commit
Paul Cercueil 11b63fac 2020-03-02T15:14:02 Prevent Mesa from including X11 headers if X11 is disabled This fixes compilation errors that occur when trying to compile SDL2 for a X11-less target. The errors were due to the fact that Mesa will include X11 headers unless a couple of macros are defined. Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Sam Lantinga 3b3ae4d1 2020-03-02T15:06:47 Possible fix for bug 5010 - SDL_Init with SDL_INIT_JOYSTICK hangs for 10 seconds when playing audio from another application Jake Breen When I run SDL_INIT with SDL_INIT_JOYSTICK it stalls for about 10 seconds (last report was 10,615ms), but only if I'm currently playing audio. (Like in Spotify for example.) querying something related to device access (last dll loaded) 'BabbysFirst64.exe' (Win32): Loaded 'C:\Windows\SysWOW64\deviceaccess.dll'. I use a USB DAC because my mobo's audio out is pretty not great. And I've noticed unplugging it seems to solve the issue. I haven't noticed any other issues that are caused by my DAC. My DAC is the Sound BlasterX G1 https://us.creative.com/p/gaming-headsets/sound-blasterx-g1 Vid = 041E PID = 3249 My system specs: - Windows 10 Pro - Ryzen 2700x - 16GB Ram - Nvidia 2070 RTX Additional USB devices plugged in: - Valve Index - Xbox One Elite Controller
Sam Lantinga a19757ac 2020-03-02T14:55:40 Fixed bug 5007 - Segfault in KMSDRM_VideoQuit() on Raspberry Pi Zero with no display attached Charles Huber This patch fixes the segfault on my Pi, though the valid display index range reported by the CHECK_DISPLAY_INDEX() macro in src/video/SDL_video.c is a little weird: $ SDL_VIDEO_EGL_DRIVER=libEGL.so SDL_VIDEO_GL_DRIVER=libGLESv2.so ./a.out SDL_Init(): displayIndex must be in the range 0 - -1
Sam Lantinga f00ddd0a 2020-03-02T11:39:44 Updated WhatsNew.txt with SDL 2.0.12 release notes
Sam Lantinga 25061816 2020-03-02T10:58:08 Fixed compile warning
Sam Lantinga eb19631a 2020-03-02T10:57:57 This controller firmware is supported on Windows, and is covered by the Bluetooth check on Mac OSX
Sam Lantinga 49564c8b 2020-03-02T10:47:48 Added support for the PDP Victrix Pro FS with Touch Pad for PS4
Sam Lantinga 4572dd2a 2020-03-02T10:37:28 Fixed bug 4854 - Add a way to extend the values in controller_type.h Added a hint SDL_HINT_GAMECONTROLLERTYPE to allow overriding the built-in controller type database
Sam Lantinga 27f346a0 2020-03-02T09:46:37 Fixed compile warning
Sam Lantinga 339612d5 2020-03-02T09:35:12 ControllerList: add support for Victrix Pro FS w/ Touchpad for PS4
Sam Lantinga 52be6633 2020-03-02T09:35:09 Use SDL math functions in Steam Controller support
Sam Lantinga 756d2073 2020-03-02T09:26:12 Updated the HIDAPI Xbox One driver with support for Bluetooth Xbox One controllers
Sam Lantinga 997f3e9e 2020-03-02T09:03:55 Fixed build warnings
Sam Lantinga 11a84e4f 2020-03-01T18:16:15 Make sure hidapi is built for the release DMG
Sam Lantinga bebc4867 2020-03-01T17:53:30 We already have a hidapi implementation for Windows, we don't need libusb
Sam Lantinga 74ed2156 2020-03-01T14:58:16 Updated version to 2.0.12 for release candidate build
Sam Lantinga 6590d078 2020-03-01T14:52:49 Fixed bug 4996 - Mac: XBoxOne Bluetooth rumble isn't working rofferom I have an annoying issue on MacOS about XBoxOne Bluetooth rumble (Vendor: 0x045e, Product: 0x02fd). When 360controller is installed, rumble is working correctly. However, Bluetooth rumble isn't working at all, with or without 360controller installed (although it is working with Chrome + https://html5gamepad.com). I looked at the code, and it seems that XBox controllers are managed in MacOS in this file: SDL_hidapi_xbox360.c. The XBoxOne file is disabled for MacOS in SDL_hidjoystick_c.h. The function HIDAPI_DriverXbox360_Rumble() is called correctly, and hid_write() returns no error. I have tried a stupid test. I took the rumble packet from 360controller: https://github.com/360Controller/360Controller/blob/ec4e88eb2d2535e9b32561c702f42fb22b0a7f99/XBOBTFF/FFDriver.cpp#L620. With the patch I have attached, I manage to have rumble working on Bluetooth (with some stupid vibration level, but it proves it can if the packet is changed). But it breaks the USB rumble with 360controller. A comment in the function makes an explicit reference to 360controller, I think that's why I have broken this specific usecase. I don't know what is the correct way to fix this, but it seems that the current implementation has a missing case for Bluetooth support. Note that I also tested master this morning, and I have another issue: if (!device->ffservice) { return SDL_Unsupported(); } test fails in DARWIN_JoystickRumble(). This test has been done quickly, I'm not totaly confident about its accuracy.
Romain Roff? 53462163 2020-03-01T13:01:53 mac: Fix gamepad detection
Sam Lantinga 51e9e984 2020-03-01T13:00:50 Fixed whitespace
Sam Lantinga 8a6f1aa5 2020-03-01T12:58:50 Fixed bug 4369 - Going fullscreen with green knob in MacOS freezes app for 15 seconds. Elmar creating a fullscreen window with SDL_CreateWindow(..SDL_WINDOW_FULLSCREEN_DESKTOP..) in MacOS works fine, except if it was triggered by the user with the green knob in the top left window title bar. Then "something" is different, and SDL_CreateWindow hangs for 15-20 seconds (tested in MacOS 10.13 and 10.14). Responsible for the hang is this code in SDL_cocoawindow.m - Cocoa_SetWindowFullscreenSpace: const int maxattempts = 3; int attempt = 0; while (++attempt <= maxattempts) { /* Wait for the transition to complete, so application changes take effect properly (e.g. setting the window size, etc.) */ const int limit = 10000; int count = 0; while ([data->listener isInFullscreenSpaceTransition]) { if ( ++count == limit ) { /* Uh oh, transition isn't completing. Should we assert? */ break; } SDL_Delay(1); SDL_PumpEvents(); } if ([data->listener isInFullscreenSpace] == (state ? YES : NO)) break; /* Try again, the last attempt was interrupted by user gestures */ if (![data->listener setFullscreenSpace:(state ? YES : NO)]) break; /* ??? */ } One trivial workaround is to change 'const int limit = 10000' to 500. Then the freeze is so short that it doesn't look like a freeze to the user. Looking further into the problem, I observed that the function Cocoa_SetWindowFullscreenSpace recursively calls itself via some ObjectiveC messages. I managed to extract a callstack for this (copied below): Note how Cocoa_SetWindowFullscreenSpace in stack line 22 calls SDL_PumpEvents, which eventually arrives at SDL_SendWindowEvent, which calls SDL_UpdateFullscreenMode (stack line 0), which then calls Cocoa_SetWindowFullscreenSpace again (not shown). This recursive second call is the one that hangs. Another "solution" that worked for me was to add a flag to SDL_Window that is set in Cocoa_SetWindowFullscreenSpace and causes this function to return immediately if called from itself. Obviously, this is also an ugly hack, but I don't have enough time to dive into this crazy Cocoa/ObjectiveC business deep enough to find a proper solution. But hopefully it's easy for one of the experts around. Note that there is a "failure to go fullscreen"-message involved, maybe using the green knob causes this failure at first. I can unfortunately not provide a minimum example. Best regards, Elmar 0 com.yasara.View 0x00000001007495af SDL_UpdateFullscreenMode + 207 1 com.yasara.View 0x00000001006e2591 SDL_SendWindowEvent + 401 2 com.yasara.View 0x0000000100775a72 -[Cocoa_WindowListener windowDidResize:] + 370 3 com.yasara.View 0x0000000100776550 -[Cocoa_WindowListener windowDidExitFullScreen:] + 512 4 com.apple.AppKit 0x00007fff3180a2a4 -[_NSWindowEnterFullScreenTransitionController failedToEnterFullScreen] + 692 5 com.apple.AppKit 0x00007fff31c59737 -[_NSEnterFullScreenTransitionController _doFailedToEnterFullScreen] + 349 6 com.apple.AppKit 0x00007fff3172aa53 __NSFullScreenDockConnectionSendEnterForSpace_block_invoke + 135 7 libxpc.dylib 0x00007fff6114b9b1 _xpc_connection_reply_callout + 36 8 libxpc.dylib 0x00007fff6114b938 _xpc_connection_call_reply_async + 82 9 libdispatch.dylib 0x00007fff60ec7e39 _dispatch_client_callout3 + 8 10 libdispatch.dylib 0x00007fff60ede3b0 _dispatch_mach_msg_async_reply_invoke + 322 11 libdispatch.dylib 0x00007fff60ed2e25 _dispatch_main_queue_callback_4CF + 807 12 com.apple.CoreFoundation 0x00007fff33d39e8b __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9 13 com.apple.CoreFoundation 0x00007fff33d3959a __CFRunLoopRun + 2335 14 com.apple.CoreFoundation 0x00007fff33d38a28 CFRunLoopRunSpecific + 463 15 com.apple.HIToolbox 0x00007fff32fd1b35 RunCurrentEventLoopInMode + 293 16 com.apple.HIToolbox 0x00007fff32fd1774 ReceiveNextEventCommon + 371 17 com.apple.HIToolbox 0x00007fff32fd15e8 _BlockUntilNextEventMatchingListInModeWithFilter + 64 18 com.apple.AppKit 0x00007fff3128deb7 _DPSNextEvent + 997 19 com.apple.AppKit 0x00007fff3128cc56 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1362 20 com.yasara.View 0x000000010076fab2 Cocoa_PumpEvents + 290 21 com.yasara.View 0x00000001006dd1c7 SDL_PumpEvents_REAL + 23 22 com.yasara.View 0x00000001007795cf Cocoa_SetWindowFullscreenSpace + 223 23 com.yasara.View 0x000000010074970b SDL_UpdateFullscreenMode + 555 24 com.yasara.View 0x00000001006e2476 SDL_SendWindowEvent + 118 25 com.yasara.View 0x0000000100774ff7 -[Cocoa_WindowListener resumeVisibleObservation] + 135 26 com.yasara.View 0x000000010077664c Cocoa_ShowWindow + 188 27 com.yasara.View 0x0000000100749492 SDL_FinishWindowCreation + 546 28 com.yasara.View 0x0000000100748da5 SDL_CreateWindow_REAL + 1573 29 com.yasara.View 0x000000010010d9b1 vga_setvideomode + 1347 30 com.yasara.View 0x00000001003f0d46 mod_initscreen + 2614 31 com.yasara.View 0x00000001003f344b mod_reinitscreen + 460 32 com.yasara.View 0x00000001003f370d mod_resizescreen + 383 33 com.yasara.View 0x0000000100418e39 mod_main + 815 34 com.yasara.View 0x000000010029ca5d main2 + 5766 35 com.yasara.View 0x000000010011d1b7 main.main_cpuok + 19
Sam Lantinga bd5da73a 2020-03-01T12:50:42 Fixed bug 4992 - UWP/WinRT does not set thread priority when using SDL_SetThreadPriority Ethan Lee Attached is a diff that I used to get SetThreadPriority working locally. I still have no idea what the minimum SDK version is since Microsoft never documented it, but it's worth pointing out that they're much more aggressive about using the latest VS and UWP SDK anyway (for example, an updated Xbox is no longer compatible with VS2017, and updates are required to have a network connection of any kind).
Sam Lantinga 1af31a26 2020-02-27T13:53:32 Fixed trying to handle the HORI Wireless Switch Pad when connected via USB
Sam Lantinga 20d67446 2020-02-27T09:33:32 Xbox One controller rumble doesn't need synchronization if you use a packet counter of 0
Sam Lantinga 2cd88ddf 2020-02-27T09:32:03 Temporarily disabled NEON optimizations added for bug 4365 The ABGR to ARGB blit results in an empty surface, this needs to be looked at.
Sam Lantinga 9013c916 2020-02-27T08:20:34 Fixed bug 5005 - warnings in kmsdrm Malte Kie?ling At the moment i get following warnings from kmsdrm: * in SDL_kmsdrmvideo.c KMSDRM_DestroySurfaces is return type int, but thats never returned or checked against * in SDL_kmsdrmvideo.c KMSDRM_DestroySurfaces the variable viddata is not used * in SDL_kmsdrmopengles.c KMSDRM_GLES_LoadLibrary a cast to NativeDisplayType is missing I attached a patch for them :)
Sam Lantinga 7f26ff23 2020-02-27T08:18:20 Fixed bug 4987 - Can't build on MinGW a recent state (15'th February, 2020): conflicting types
Ryan C. Gordon cbd1a2f7 2020-02-25T14:52:03 cmake: Forgot to add this file to revision control. Fixes Bugzilla #5003.
Sylvain Becker 21a2e0c7 2020-02-25T06:53:51 Fix compilation C90 mixed declarations and code (Thanks Cameron Gutman !)
Sylvain Becker e2b132ca 2020-02-24T21:57:03 Better fix to set the palette opaque, when there is also a colorkey (see bug 3827)
Sam Lantinga e3b0713e 2020-02-24T12:07:18 Don't call setPreferredOutputNumberOfChannels on iOS, it breaks audio output
Sam Lantinga 2c9871a4 2020-02-24T10:25:57 Fixed surround sound support on Apple TV
Sylvain Becker f4857660 2020-02-23T23:07:15 Fix: set to opaque when a palette surface is converted to an alpha format.
Sylvain Becker bf8aa1ed 2020-02-23T22:38:08 Fix regression: when a palette + colorkey is converted, it needs a blend mode. - Regression of test_1.c of bug 3827, after fix from bug 4798. - Blending is also needed when the palette contains alpha value, but not necessarily colorkey. - Clean up SDL_ConvertColorkeyToAlpha which doesn't seem to need 'ignore_alpha' parameter any-more. (see bug 3827)
Ryan C. Gordon 094655cf 2020-02-23T14:49:03 cocoa: Make sure wait for button enable can't be infinite.
Ryan C. Gordon 72316518 2020-02-23T14:48:48 cocoa: Removed a debug printf that was accidentally committed.
Sylvain Becker 9a7c2b22 2020-02-23T09:59:52 Fixed bug 4999 - Palette surface always promoted to alpha (Thanks Cameron Gutman!) MSVC Static analysis: Incorrect alpha_value check in SDL_render.c (see also bug 4425)
Ryan C. Gordon dd1d8ab6 2020-02-21T15:52:35 cmake: more proper sdl2-config.cmake work (thanks, Alexander!) Fixes Bugzilla #4970.
Ryan C. Gordon be4d488e 2020-02-21T15:51:04 cmake: Backed out changeset 9009d85d3762 This is being replaced by a different patch (see Bugzilla #4970).
Ryan C. Gordon 4d9e6e5f 2020-02-21T14:50:09 cocoa: When exiting a fullscreen space, wait for window state to normalize. A good metric of this is when the titlebar's "minimize" button is reenabled, which doesn't happen by the time windowDidExitFullscreen triggers. This fixes minimizing a fullscreen window on macOS. Fixes Bugzilla #4177.
Sam Lantinga 8d146363 2020-02-19T08:26:00 Fixed support for third party Xbox 360 wireless controller dongle
Ryan C. Gordon 44698c49 2020-02-18T01:44:07 dynapi: Fixed build on non-Android platforms.
Sam Lantinga ad225047 2020-02-17T14:15:47 Added Android SDK conditionals to game controller mappings The Nintendo Switch Pro controller has a different mapping on Android 10 and newer
Sam Lantinga d7ece7ee 2020-02-17T13:54:45 Made SDL_GetAndroidSDKVersion() available for applications
Ryan C. Gordon 93b26f17 2020-02-17T16:15:04 opengl: Backed out hg changeset 94f9f40a957f This is the OpenGL line drawing fix for Bugzilla #3182, but there's some disagreement about what the renderers should do here, so I'm backing this out until after 2.0.12 ships, and then we'll reevaluate all the renderer backends to decide what's correct, and make them all work the same.