Make use of check_include_files to be able to also include
stdint.h when checking for the headers. Fixes detection of
usbhid.h on OpenBSD.
/usr/include/usbhid.h:40:2: error: unknown type name 'uint32_t'
40 | uint32_t _usage_page;
| ^
Otherwise, the quit event can be sent prematurely. The topmost status must be queried and cached before sending the close request event, as the window may be destroyed in an event handler.
As suggested in #14843, pass vertex tex_coord to vertex shader and to fragment shader even when no texture is bounded so they can be used by custom fragment shaders.
Stop the frame callback and flag the cursor for a refresh when the pointer re-enters the surface, but don't set a null cursor, as it may have already been set after entering a surface that is part of the window decorations, resulting in an unwanted invisible cursor.
Avoids UBSan warning (among other similar ones in SDL_thread.c):
src/thread/SDL_thread.c:109:13: runtime error: index 1 out of bounds for type 'struct (unnamed struct at src/thread/SDL_thread_c.h:70:5)[1]'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/thread/SDL_thread.c:109:13
Requesting certain MIME types (e.g. EPS formats offered by KDE) can be *very* slow, on the order of multiple seconds, due to requiring significant processing. Only try to load image MIME types that SDL is known to support (BMP and PNG).
The default timeout value of 14ms is ideal when querying clipboard data while polling events, to prevent excessive lag if the source takes a long time to respond, however, when reading from SDL_GetClipboardData(), the timeout can be too short if a large amount of data must be processed or transferred. SDL_GetClipboardData() is not called while polling events, so using a longer read timeout to greatly increase the chance of success is acceptable.
Use a 5 second timeout when reading from SDL_GetClipboardData() and GetPrimarySelectionText() to greatly increase the chances of a successful read, even if the requested format requires heavy processing.
Clients that defer repainting may hang in SDL_WaitEvent() while interactively resizing if they only redraw when an appropriate event is received, as resizing defers the new state until a frame callback is received, and if too much time elapsed since the last redraw, the last frame callback may have already occurred. Send an exposure event when deferring resizes so the client will make forward progress and trigger a frame callback to ack the pending configure state.
Prevent mouse and keyboard events from being processed twice by
skipping [super sendEvent:] for events SDL has already handled via
Cocoa_DispatchEvent. Other event types still go through AppKit's
normal handling.