kc3-lang/SDL/src/video

Branch :


Log

Author Commit Date CI Message
a7a54e64 2021-11-18 00:43:55 wayland: Add support for display connect/disconnect events
5cc23868 2021-11-15 11:52:43 wayland: Add support for SDL_DisplayOrientation
cc094f4d 2021-11-14 20:15:48 Fixed building with the macOS 10.8 SDK
1cd3e837 2021-11-14 15:51:38 cocoa: Fix abort on touch event types without a subtype macOS 10.6 has some touch NSEvents which do not have a subtype (Begin/EndGesture, Magnify, Rotate, Swipe) and cause an uncaught exception which triggers SIGABRT and the program exits. As it is, none of the macOS 10.6 touch events are detected as a trackpad (including Gesture due to using different subtypes).
781caec2 2021-11-15 00:55:24 SDL_waylandevents.c (keyboard_handle_keymap): silenced -Wwrite-strings .
8a6e48d4 2021-11-14 04:40:50 constified SDL_RegisterApp()
7dfd22ac 2021-11-14 02:32:00 fix XGetDefault signature - its first and second params are _Xconst
674f361d 2021-11-13 11:44:04 wayland: Fix memory leaks in clipboard code
eb3f1462 2021-11-12 18:26:15 x11: Fix memory leak in X11_CreatePixmapCursor()
3dc7813a 2021-11-12 20:47:02 more whitespace tidy-ups in SDL_os2messagebox.c
c2dd50a9 2021-11-12 08:28:02 Fixed whitespace
074e613b 2021-11-12 03:03:56 Fixed typo
35d90f17 2021-11-12 03:00:57 Better implementation of SDL_SetWindowMouseGrab() and SDL_SetWindowMouseRect() on macOS
3bf7994f 2021-09-27 14:38:12 Add and use `SDL_FALLTHROUGH` for fallthroughs Case fallthrough warnings can be suppressed using the __fallthrough__ compiler attribute. Unfortunately, not all compilers have this attribute, or even have __has_attribute to check if they have the __fallthrough__ attribute. [[fallthrough]] is also available in C++17 and the next C2x, but not everyone uses C++17 or C2x. So define the SDL_FALLTHROUGH macro to deal with those problems - if we are using C++17 or C2x, it expands to [[fallthrough]]; else if the compiler has __has_attribute and has the __fallthrough__ attribute, then it expands to __attribute__((__fallthrough__)); else it expands to an empty statement, with a /* fallthrough */ comment (it's a do {} while (0) statement, because users of this macro need to use a semicolon, because [[fallthrough]] and __attribute__((__fallthrough__)) require a semicolon). Clang before Clang 10 and GCC before GCC 7 have problems with using __attribute__ as a sole statement and warn about a "declaration not declaring anything", so fall back to using the /* fallthrough */ comment if we are using those older compiler versions. Applications using SDL are also free to use this macro (because it is defined in begin_code.h). All existing /* fallthrough */ comments have been replaced with this macro. Some of them were unnecessary because they were the last case in a switch; using SDL_FALLTHROUGH in those cases would result in a compile error on compilers that support __fallthrough__, for having a __attribute__((__fallthrough__)) statement that didn't immediately precede a case label.
abc12a83 2021-11-11 15:58:44 Revert "Add and use `SDL_FALLTHROUGH` for fallthroughs" This reverts commit 66a08aa3914a98667f212e79b4f0b9453203d656. This causes problems with older compilers: https://github.com/libsdl-org/SDL/pull/4791#issuecomment-966630997
63ae103c 2021-11-11 13:16:34 wayland: QTWAYLAND_CONTENT_ORIENTATION can support multiple values as bitmasks
11ae43ca 2021-11-11 07:49:38 Only lock the pointer for mouse relative mode, there isn't really a concept of grab and confinement on iOS Locking the pointer prevents the on-screen cursor from moving, which isn't what we want with a grab behavior. Fixes https://github.com/libsdl-org/SDL/issues/4941
66a08aa3 2021-09-27 14:38:12 Add and use `SDL_FALLTHROUGH` for fallthroughs Case fallthrough warnings can be suppressed using the __fallthrough__ compiler attribute. Unfortunately, not all compilers have this attribute, or even have __has_attribute to check if they have the __fallthrough__ attribute. [[fallthrough]] is also available in C++17 and the next C2x, but not everyone uses C++17 or C2x. So define the SDL_FALLTHROUGH macro to deal with those problems - if we are using C++17 or C2x, it expands to [[fallthrough]]; else if the compiler has __has_attribute and has the __fallthrough__ attribute, then it expands to __attribute__((__fallthrough__)); else it expands to an empty statement, with a /* fallthrough */ comment (it's a do {} while (0) statement, because users of this macro need to use a semicolon, because [[fallthrough]] and __attribute__((__fallthrough__)) require a semicolon). Applications using SDL are also free to use this macro (because it is defined in begin_code.h). All existing /* fallthrough */ comments have been replaced with this macro. Some of them were unnecessary because they were the last case in a switch; using SDL_FALLTHROUGH in those cases would result in a compile error on compilers that support __fallthrough__, for having a __attribute__((__fallthrough__)) statement that didn't immediately precede a case label.
eda4c407 2021-11-10 12:46:54 Make sure the X event is an Xkb event before checking the Xkb event type
98c98362 2021-11-10 11:04:51 Don't clobber the error in SDL_ShowMessageBox() if one has been set at the platform level Fixes https://github.com/libsdl-org/SDL/issues/4760
6c4b4ee7 2021-11-10 09:41:43 Don't assert on API parameters This causes lots of spam in test automation and it's not clear it's useful to developers. If we need this level of validation, we should add a log category for it.
fed85778 2021-11-10 08:47:39 Update the orientation and display modes when the display settings change on Windows Fixes https://github.com/libsdl-org/SDL/issues/1061
c0f1109b 2021-11-10 06:03:01 Implemented querying the orientation of displays on Windows
27ce9144 2021-11-09 20:51:42 Send absolute mouse motion when in normal mouse mode and relative mouse motion when in relative mode on iOS This keeps the SDL cursor in sync with the visible cursor when in normal mouse mode.
19c129fa 2021-11-09 20:32:16 Added documentation that the UIApplicationSupportsIndirectInputEvents key must be set to true in your application's Info.plist in order to get real Bluetooth mouse events.
d2f75636 2021-11-09 11:53:59 When making the window centered it should use windowed mode size since it doesn't affect fullscreen windows Fixes bug https://github.com/libsdl-org/SDL/issues/4750
1fc25bd8 2021-11-08 22:04:34 Properly position the IME window(s) on windows
ae67c7d2 2021-11-09 01:30:00 Implemented SDL_SetWindowMouseRect() on Wayland
18e69827 2021-11-08 22:29:02 Fixed Linux build
881f747d 2021-11-09 13:35:18 Always destroy icon
7fea557b 2021-11-09 12:03:09 SDL_windowsmouse.c: Remove LR_COPYDELETEORG flag
67c42cb4 2021-11-08 22:16:01 Fixed Windows build
fd79607e 2021-11-08 21:34:48 Added SDL_GetWindowMouseRect() Also guarantee that we won't get mouse movement outside the confining area, even if the OS implementation allows it (e.g. macOS)
4db546b0 2021-11-08 20:35:12 Implemented SDL_SetWindowMouseRect() on macOS
9c95c249 2021-11-08 20:01:56 x11: Use XCheckIfEvent() instead of XNextEvent() for thread-safety A racing reader could read from our fd between SDL_IOReady()/X11_Pending() and our call to XNextEvent() which will cause XNextEvent() to block for more data. Avoid this by using XCheckIfEvent() which will never block. This also fixes a bug where we could poll() for data, even when events were already read and pending in the queue. Unlike the Wayland implementation, this isn't totally thread-safe because nothing prevents a racing reader from reading events into the queue between our XCheckIfEvent() and SDL_IOReady() calls, but I think this is the best we can do with Xlib.
2d23d66a 2021-11-08 16:33:50 Fixed SetWindowMouseRect return value on Windows
7d21322d 2021-11-08 16:29:19 Implemented SDL_SetWindowMouseRect() on Windows
4b42c05b 2021-11-08 13:52:48 video: Add SDL_SetWindowMouseRect. This API and implementation comes from the Unreal Engine branch of SDL, which originally called this "SDL_ConfineCursor". Some minor cleanup and changes for consistency with the rest of SDL_video, but there are two major changes: 1. The coordinate system has been changed so that `rect` is _window_ relative and not _screen_ relative, making it easier to implement without having global access to the display. 2. The UE version unset all rects when passing `NULL` as a parameter for `window`, this has been removed as it was an unused feature anyhow. Currently this is only implemented for X, but can be supported on Wayland and Windows at minimum too.
d95a52c9 2021-11-08 09:39:21 Fixed comment typo
fc998b8e 2021-11-08 12:37:10 wayland: Return true for HasScreenKeyboardSupport only if no physical keyboard exists
6c56e275 2021-11-08 07:05:17 Set both _NET_WM_NAME and WM_NAME so SDL windows can be shared in the browser. Fixes https://github.com/libsdl-org/SDL/issues/4924
301819cd 2021-11-08 20:34:20 SDL_windowsmouse.c: Fix WIN_CreateCursor does not scale with system cursor size preference
94c1276a 2021-11-07 20:49:32 emscripten: Decrease vertical scroll speed by using deltaMode Reference issue #4623.
2248a549 2021-11-05 22:48:46 Update the focus in case we changed focus to a child window and then away from the application In this case we'll get WM_KILLFOCUS when the child window is focused, but we'll retain focus on the top level window, but when we Alt-Tab away, we won't get another WM_KILLFOCUS or WM_NCACTIVATE, we get WM_ACTIVATE instead, so we need to check for focus updates in response to that as well.
a01aaf05 2021-10-30 21:42:07 Fixed compiler warning
4d3da5b7 2021-10-26 21:51:29 riscos: Disable the mouse pointer for now
1c256b89 2021-10-26 13:42:34 riscos: Fix enumerating screen modes
5a3c97f3 2021-10-25 22:55:02 riscos: Fix detection of the current mode
53b3db0c 2021-09-28 17:59:16 Handle the KMOD_SCROLL modifier on RISC OS
1268984e 2021-09-09 21:09:50 Implement mouse input on RISC OS
f7f54f0d 2021-08-06 23:38:46 Implement keyboard input on RISC OS Partially based on a patch from http://www.riscos.info/websvn/listing.php?repname=gccsdk&path=%2Ftrunk%2Fautobuilder%2Flibraries%2Fsdl%2Flibsdl2%2F&rev=7174#a6401c766f408f1ea356e6977894cc6a5 Currently lacks support for mapping scancodes to keycodes.
f8a8ca3e 2021-08-05 23:16:29 Support proper mode switching on RISC OS
fe9bb747 2021-02-12 23:46:11 riscos: Refactor framebuffer code
25c71748 2020-02-13 21:55:08 Add a barebones RISC OS video driver
a5598649 2021-10-30 19:30:34 x11/wayland: Fix signal handling while blocking in WaitEventTimeout() Add a new flag to avoid suppressing EINTR in SDL_IOReady(). Pass the flag in WaitEventTimeout() to ensure that a SIGINT will wake up SDL_WaitEvent() without another event coming in.
c97c4687 2021-10-30 15:56:54 core: Convert SDL_IOReady()'s 2nd parameter to flags
2bf36bfa 2021-10-24 21:28:04 wayland: Implement WaitEventTimeout() and SendWakeupEvent() We can have spurious wakeups in WaitEventTimeout() due to Wayland events that don't end up causing us to generate an SDL event. Fortunately for us, SDL_WaitEventTimeout_Device() handles this situation properly by calling WaitEventTimeout() again with an adjusted timeout.
9c799802 2021-10-26 15:18:26 Vita: fix IME input languages
408a93a1 2021-10-23 15:43:04 wayland: Use multi-thread event reading APIs Wayland provides the prepare_read()/read_events() family of APIs for reading from the display fd in a deadlock-free manner across multiple threads in a multi-threaded application. Let's use those instead of trying to roll our own solution using a mutex. This fixes an issue where a call to SDL_GL_SwapWindow() doesn't swap buffers if it happens to collide with SDL_PumpEvents() in the main thread. It also allows coexistence with other code or toolkits in our process that may want read and dispatch events themselves.
23e252bf 2021-10-02 14:57:40 DirectFB: provide RenderCopyEx via RenderGeometry
f499168c 2021-10-24 15:54:57 x11: Use SDL_IOReady() instead of calling select() directly SDL_IOReady() properly handles EINTR and can use poll() if available.
ba4ef461 2021-10-23 15:28:13 macOS: Fix implicit integer downcast warnings
a76b73dd 2021-10-22 19:04:32 kmsdrm: Use SDL_PremultiplySurfaceAlphaToARGB8888() for cursor surface Instead of taking a direct copy of the mouse cursor surface, and then premultiplying on every BO upload (using the custom legacy_alpha_premultiply_ARGB8888 function), use the new SDL_PremultiplySurfaceAlphaToARGB8888() function, which converts a whole surface at a time, once and save the result. The already-premultiplied data is then copied from that to the BO on each upload, adjusting for the stride (which the previous implementation required to be equal to the width), thereby making the extra copy slightly useful.. This also adds support for non-SDL_PIXELFORMAT_ARGB8888 surfaces.
b528d484 2021-10-22 16:59:46 wayland: Wayland cursors should use premultiplied alpha It turns out that Wayland's WL_SHM_FORMAT_ARGB8888 format (and, indeed, all wayland RGBA formats) should be treated as premultiplied. SDL surfaces tend not to be premultiplied, and this is assumed by other backends when dealing with cursors. This change premultiplies the cursor surface in Wayland_CreateCursor() using the new SDL_PremultiplySurfaceAlphaToARGB8888(). In so doing, it also adds support for a wider range of input surfaces, including those with non-ARGB8888 pixel formats, and those which don't have pitch==width. This should fix #4856
84808ea4 2021-10-22 17:48:32 video: Add SDL_PremultiplySurfaceAlphaToARGB8888() A number of video backends need to get ARGB8888 formatted surfaces with premultiplied alpha, typically for mouse cursors. Add a new function to do this, based loosely on legacy_alpha_premultiply_ARGB8888() from the KMSDRM backend. The new function, SDL_PremultiplySurfaceAlphaToARGB8888() takes two arguments: - src: an SDL_Surface to be converted. - dst: a buffer which is filled with premultiplied ARGB8888 data of the same size as the surface (assuming pitch = w). This is not heavily optimised: it just repeatedly calls SDL_GetRGBA() to do the conversion, but should do for now.
007b5463 2021-10-21 22:50:33 video/uikit: Do not use setNeedsUpdateOfPrefersPointerLocked on iOS SDKs older than 14
19dee1cd 2021-10-22 06:37:20 Add SDL_GetWindowICCProfile(). (#4314) * Add SDL_GetWindowICCProfile * Add new SDL display events * Implement ICC profile change event for macOS * Implement ICC profile notification for Windows * Fix SDL_GetWindowICCProfile() for X11 * Fix compile errors
bfd2f899 2021-10-19 17:29:23 Fixed grab handling when focus changes between windows in the same application
d9c44b65 2021-10-19 10:49:17 Allow Cocoa_VideoInit to succeed when current display mode has invalid flags This fixes a specific issue seen on macOS 10.14.6 where a DELL E248WFP Display connected to a 2014 Mac Mini with a scaled 1920x1080 resolution selected and SDL_Init(SDL_INIT_VIDEO) failed with the error: "The video driver did not add any displays". The underlying cause was that the current 1080p display mode did not have the flag kDisplayModeSafeFlag, the check for which was added in a963e36, with the idea that certain display modes should not be candidates for switching to in fullscreen exclusive mode. That may well be the right thing to do for filtering down a list of candidate modes, but it doesn't pay to be so picky about the current mode. After all, this current mode was set by System Preferences, the picture does appear correctly on screen, and other non-SDL based applications launch and run correctly in this mode. Therefore the fix is to have GetDisplayMode only filter out a mode based on flags if it's part of a candidate list, but if it's the current mode and it can possibly be converted to an SDL_DisplayMode, do so.
649a33ae 2021-10-18 23:00:43 X11: remove redundant 'wakeup_lock' mutex creation
0a0f6854 2021-10-18 14:10:56 SDL_os2video.c: missed replacing a use of libc function
7fb43643 2021-10-17 13:56:31 Don't process WM_INPUT when handling relative mode by warping the mouse cursor
06824b18 2021-10-17 19:50:39 Cleanup windows events after recent changes Improves clarity without any functional changes
50f969c1 2021-10-17 22:02:19 Fixed bug #4841 - Out of bounds read (by 1 byte) in yuvnv12_rgb24_sseu
1c5b3e0e 2021-10-15 18:12:18 Don't center the mouse when gaining focus unless we're using relative mode warping This is necessary now that we actually change the mouse position when calling SDL_WarpMouseInWindow() in relative mode.
a70a94e0 2021-10-15 18:11:19 Don't send a mouse leave event if the mouse is outside the window when gaining focus and in relative mode.
c583055a 2021-10-15 10:11:24 SDL_windowsevents.c (WIN_WindowProc): remove SAFE_AREA_X and SAFE_AREA_Y Not used since commit https://github.com/libsdl-org/SDL/commit/a1fabca162091b50d6f7dd71879d028319e09d80
a1fabca1 2021-10-14 16:52:21 Removed mouse warping for local mice and improved warp handling for mouse over RDP
5e89b3c8 2021-10-14 11:46:07 Don't need to use raw input to track the mouse during mouse capture (thanks Brick!)
0b6a8211 2021-10-12 14:08:20 Messages posted on the same tick are not new
0789610c 2021-10-14 00:52:05 Add SDL_HINT_WINDOW_NO_ACTIVATION_WHEN_SHOWN
2423c514 2021-10-13 09:33:51 Work around hang in AAudioStream_write() during extended shared object loading while running in a debugger. Observed on a OnePlus 8T (KB2005) running Oxygen OS 11.0.10.10.KB05AA. The observed behavior is that any nonzero timeout value would hang until the device was paused and resumed. And a zero timeout value would always return 0 frames written even when audio fragments could be heard. Making a manual timeout system unworkable. None of the straightforward systems imply that there's a detectable problem before the call to AAudioStream_write(). And the callback set within AAudioStreamBuilder_setErrorCallback() does not get called as we enter the hang state. I've found that AAudioStream_getTimestamp() will report an error state from another thread. So this change codifies that behavior a bit until a better fix or more root cause can be found.
6149e601 2021-10-13 00:03:56 remove IsWin10FCUorNewer() -- not used since commit 40ed9f75c9e1ed
311671a0 2021-10-12 23:50:02 fixed build after commit 6e356e20ad
6e356e20 2021-10-12 18:35:52 Fix mouse focus being set to null when a captured mouse cursor leaves the window.
40ed9f75 2021-10-08 10:05:27 Workaround for Windows occasionally ignoring SetCursorPos() calls Also, since we're flushing mouse motion before and including the warp, we don't need the isWin10FCUorNewer hack to simulate mouse warp motion. Fixes https://github.com/libsdl-org/SDL/issues/4339 and https://github.com/libsdl-org/SDL/issues/4165
16aeb8d0 2021-10-07 15:04:06 Guarantee that we don't dispatch any mouse motion from before or including the last mouse warp
649466f4 2021-10-07 13:28:44 Flush any pending mouse motion when warping the mouse cursor Fixes https://github.com/libsdl-org/SDL/issues/4165
ad520573 2021-10-06 09:52:06 wayland: Only dispatch frame events in Wayland_GLES_SwapWindow Dispatching all events in Wayland_GLES_SwapWindow leads to resizes being acked before the program has a chance to handle the resize. This change reduces jumping on fullscreen transition with apps that call SDL_PollEvent before issuing any render calls.
dd95c9c8 2021-10-06 09:09:39 Moved focus click check into WIN_UpdateFocus() so we have the correct state when setting keyboard focus Fixes https://github.com/libsdl-org/SDL/issues/4817
0d541e5a 2021-10-06 00:36:27 Revert "Fixed relative mode mouse events stopping if you click on the title bar" This has been better fixed by b28ed02 or another related relative mouse mode change of @slouken in SDL 2.0.17 and as such can be reverted to reduce unneeded processing in WM_MOUSEMOVE
c542de92 2021-10-05 14:08:36 React to WM_NCACTIVATE instead of WM_SETFOCUS or WM_ACTIVATE for focus changes See https://github.com/libsdl-org/SDL/pull/4293 and https://github.com/libsdl-org/SDL/issues/4450 for details
e92a639b 2021-10-04 23:00:28 replaced many uses of libc calls with SDL_ counterparts in os2 sources. TODO: core/os2 and geniconv sources _must_ be updated, as well..
eadc8f93 2021-10-02 23:08:39 wayland: Cleanup some SDL_TryLockMutex() calls. Check the result of these against 0 explicitly, so that it's obvious we're bailing out on failure, not success.
25f9e32b 2021-10-02 16:52:43 wayland: Don't let multiple threads dispatch wayland events at once wl_display_dispatch() will block if there are no events available, and while we try to avoid this by using SDL_IOReady() to verify there are events before calling it, there is a race condition between SDL_IOReady() and wl_display_dispatch() if multiple threads are involved. This is made more likely by the fact that SDL_GL_SwapWindow() calls wl_display_dispatch() if vsync is enabled, in order to wait for frame events. Therefore any program which pumps events on a different thread from SDL_GL_SwapWindow() could end up blocking in one or other of them until another event arrives. This change fixes this by wrapping wl_display_dispatch() in a new mutex, which ensures only one thread can compete for wayland events at a time, and hence the SDL_IOReady() check should successfully prevent either from blocking.
632aca29 2021-10-01 16:17:38 Window input focus is based on WM_SETFOCUS and WM_KILLFOCUS as WM_ACTIVATE doesn't necessarily imply focus. Hopefully resolves https://github.com/libsdl-org/SDL/issues/4450 and https://github.com/libsdl-org/SDL/pull/4293
77acd44f 2021-10-01 22:30:51 DirectFB: fixed creation of palette textures
83d60090 2021-09-30 23:47:37 DirectFB: add partial support for RenderGeometry allow to fill triangles with color or texture but only uniform vertex color is handled (not per vertex color)
c270949b 2021-09-28 18:07:22 Add a fast path for ARGB888->(A)BGR888 blending with pixel alpha
0fc43504 2021-09-27 16:41:43 wayland: Add support for XCURSOR_THEME/SIZE