This reverts commit b9ab326982.
@rainerdeyke pointed out:
"This commit is incorrect. Flipping both horizontally and vertically is not equivalent to flipping diagonally."
On Android, HIDAPI prompts for permissions and acquires exclusive access to the device, and on Apple mobile platforms it doesn't do anything except for handling Bluetooth Steam Controllers.
Fixes https://github.com/libsdl-org/SDL/issues/9241
Previously there were two different paths for renderer creation, and the HDR metadata initialization was missing when creating a software renderer for a surface. Now all the cases are handled in a single path, so regardless of whether you create a software renderer by name, a software renderer for a surface, or fall back to a software renderer, you'll get the correct initialization in all cases.
Fixes https://github.com/libsdl-org/SDL/issues/9221
Since SDL_RenderFlip is an enum, SDL_FLIP_HORIZONTAL and SDL_FLIP_VERTICAL can not be OR'ed to get the "SDL_FLIP_DIAGONAL".
Render code is actually able to perform these 3 kind of "flipping" so I just added a new enum called SDL_FLIP_DIAGONAL with the OR'ed value (3) so it can be used.
Since commit 0dfdf1f3 "Fixed crash if joystick functions are passed a
NULL joystick", we've already done this check by the time we get to
this point.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Separately checking the state of a file before operating on it may allow
an attacker to modify the file between the two operations. (CWE-367)
Fix by using fstat() instead of stat().
Found in the wild from minidump reports. Unclear displaydata is null, but according
to the API it is possible for this call to return null so it seems like a valid check.
When the titlebar drage region is clicked two actions are triggered:
* The WM transfers focus to the application
* The application starts a drag operation because the drag region was clicked
When the drag operation starts before input has been transferred to the application the
window manager gets in a bad state where mouse clicks don't work and the system isn't
actually dragging.
In this CL we delay drag operations until after the application has acquired active focus.
This fixes the problems outlined above.