kc3-lang/SDL/src/video

Branch :


Log

Author Commit Date CI Message
7e88e772 2021-08-04 02:30:47 winrt: Fixed incorrect code in a Windows Phone #ifdef.
32f909f7 2021-08-03 13:30:57 wayland: Remove redundant waylanddyn.h includes. All files including waylanddyn.h already include waylandvideo.h first.
124405a0 2021-08-03 13:17:19 wayland: Fix building without Vulkan support
350ca0f9 2021-08-03 04:57:53 winrt: Don't register orientation hint callback in startup code. SDL_AddHintCallback() uses SDL_malloc(), which means this would run before main(), so the app wouldn't be able to supply its own replacement SDL_malloc() implementation in time. This code was moved to under SDL_Init. Since the hint callback already makes efforts to not override the app manifest's orientation settings, this is safe to move until after pre-main() startup. Fixes #4449.
7082fb04 2021-08-02 22:42:28 wayland: Only dispatch on fullscreen set when the window is visible. Fixes hang-on-startup described in #4572.
0f5b8a99 2021-08-02 19:48:31 wayland: For libdecor, dispatch immediately after setting fullscreen Reference: #4578
4562da62 2021-08-02 16:40:56 wayland: Make libdecor configure match xdg_toplevel
1fb1aa19 2021-08-02 12:57:28 wayland: Keep the fullscreen check for maximize/restore events
584673a5 2021-08-02 12:51:23 wayland: Don't ignore configs for non-fullscreen, non-resizable windows. This was causing configure events to not inform SDL of window size changes, even when they were based on resizes that we fully expected. The result was fullscreen->windowed not working at all, because it would retain the desktop resolution instead of reverting to the floating size that it had before moving to fullscreen mode. Fixes Super Hexagon fullscreen toggling.
25067298 2021-08-02 08:15:10 wayland: Flush in SetWindowFullscreen The flush has been removed in e5f9fae034df8ca305241c5a666e7702fcf9958f. Unfortunately, even though ideally the flush shouldn't be necessary, our resize sequence isn't... well, perfect, and removing that flush causes tons of troubles. We're also still flushing in other paths where the window size can be changed by the compositor and where we may potentially have to obey that change, like in Wayland_MaximizeWindow. This also removes the hack introduced in 7f261d3b7667978ced93a4fdc6aec2380df3d87f, which introduces problems with protocol violations and seems to not be necessary when flushing.
ea28187c 2021-08-02 08:07:23 wayland: Hack surface resize into compliance with set_window_geometry We have issues with correct resize sequence and happen to commit old-sized buffers even after configure event for the new size has been already acknowledged. While the reason for that stays unknown, let's at least workaround the problem by faking window geometry into expected size. This does not fix visual glitch on e.g. fullscreen toggling, but having a split-second glitch is still a much better outcome than being terminated by the compositor for protocol violation.
b5210cac 2021-08-02 13:47:32 wayland: Initialize floating size at window creation This allows the windowed size to be restored for windows initially created already in non-floating state.
dab33844 2021-08-02 11:58:47 wayland: Fix a warning in handle_configure_xdg_toplevel
754aa2d3 2021-08-02 11:55:02 Mostly revert cfcdfb7be9f5c97a51ddef9ad3677a604856266b. This was causing window changes to completely break, resulting in broken decorations and bizarre frame timing, I don't know what exactly it's doing but it's not good. Kept the libdecor_frame_is_floating logic, at least.
8803589f 2021-08-02 12:05:06 wayland: Avoid redundant SetWindowBordered for libdecor
b4c4060a 2021-08-02 04:52:25 wayland: Clean up Wayland_HandlePendingResize Commit 871c11191bfc7214061a3da37c112522a102ddf5 removed delayed resize handling, but it left the whole structure untouched that now became unnecessary. To help with code clarity, get rid of the structure where pending resize state used to be stored and pass all the data directly to Wayland_HandlePendingResize (now renamed to Wayland_HandleResize, since it's not "pending" anymore but applied immediately)
9bb24ad0 2021-08-02 05:49:35 wayland: Always call Wayland_SetWindowBordered when showing the window Otherwise our windows have no window decoration on compositors that support xdg-decoration-unstable-v1, but default to client-side mode. Contrary to what the comment was stating, there is nothing in the protocol that would make redundant calls to zxdg_toplevel_decoration_v1::set_mode problematic.
cfcdfb7b 2021-08-01 18:14:53 libdecor: use same fullscreen/maximised restore logic as for xdg-toplevel
42452f8c 2021-08-01 13:51:30 wayland: store and restore floating states Some Wayland compositors send (0,0) as "suggested" configure event sizes to indicate that the client has to decide on its own which sizes to used. This is commonly done when restoring from maximised, fullscreen or tiles states to fullscreen. We now store the last known floating states in a new set of variables and restore them when we receive such a (0,0) configure event.
54aea244 2021-08-01 05:36:12 wayland: Disable key repeat when repeat rate equals 0 This fixes a crash on pressing keyboard button when compositor sends zero as repeat rate, indicating that key repeat should be disabled. From Wayland protocol spec: > Negative values for either rate or delay are illegal. A rate of zero > will disable any repeating (regardless of the value of delay).
b033cd0d 2021-07-31 16:01:48 Fixed XSync sequence to match other cases where we set the X11 error handler
4c7825f6 2021-07-31 18:27:14 x11: XSync while trying to catch XRRSetScreenSize error. Reference issue #4561
d0effadf 2021-07-31 15:56:30 x11: Don't let XRRSetScreenSize fire a BadMatch error. This is a workaround and not a proper fix, but this is possibly complicated, and possibly a corner case, so this will do for 2.0.16, if not the foreseeable future. Reference issue #4561
e5594e66 2021-07-30 16:03:01 wayland: Prefer our SSD implementation if available
71897cc1 2021-07-30 15:51:43 wayland: Always trigger a resize when handling a configure event. When we removed the OpenGL resize workaround it introduced a problem for fullscreen windows in particular: When leaving fullscreen we tried to send a resize event, but UpdateFullscreenMode would send a SIZE_CHANGED immediately after, deleting our resize event and causing the following configure event's resize to be ignored. This timing issue resulted in fullscreen windows not being resized at all when becoming a floating window. By always forcing resize events from configure events, we ensure that RESIZED always makes it through. SetWindowSize-type changes should be unaffected as they do not fire configure events.
c20ab7da 2021-07-30 00:22:50 wayland: Fix GetWindowWMInfo for <2.0.15
6f684f67 2021-07-29 18:20:36 cocoa: Add keyboard grab support CGSSetGlobalHotKeyOperatingMode() is not a public API, so we will only compile this in if SDL_MAC_NO_SANDBOX=1 is defined during compilation.
69518b9e 2021-07-29 17:09:24 Make sure we don't send a resize event while a window is being destroyed This fixes https://github.com/libsdl-org/SDL/issues/3669
f20a8581 2021-07-29 00:13:17 commit after setting/unsetting limits
9984891b 2021-07-29 14:46:24 Use the wl_touch object as a touch ID on Wayland (thanks @russelltg!) This fixes https://github.com/libsdl-org/SDL/issues/4517
74162b74 2021-07-29 13:27:31 wayland: Add support for text-input-unstable-v3
8f38ba4d 2021-07-29 18:02:47 Fix casts that should be using uintptr_t This is needed to support CHERI, and thus Arm's experimental Morello prototype, where pointers are implemented using unforgeable capabilities that include bounds and permissions metadata to provide fine-grained spatial and referential memory safety, as well as revocation by sweeping memory to provide heap temporal memory safety. On most systems (anything with a flat memory hierarchy rather than using segment-based addressing), size_t and uintptr_t are the same type. However, on CHERI, size_t is just an integer offset, whereas uintptr_t is still a capability as described above. Casting a pointer to size_t will strip the metadata and validity tag, and casting from size_t to a pointer will result in a null-derived capability whose validity tag is not set, and thus cannot be dereferenced without faulting. The audio and cursor casts were harmless as they intend to stuff an integer into a pointer, but using uintptr_t is the idiomatic way to do that and silences our compiler warnings (which our build tool makes fatal by default as they often indicate real problems). The iconv and egl casts were true positives as SDL_iconv_t and iconv_t are pointer types, as is NativeDisplayType on most OSes, so this would have trapped at run time when using the round-tripped pointers. The gles2 casts were also harmless; the OpenGL API defines this argument to be a pointer type (and uses the argument name "pointer"), but it in fact represents an integer offset, so like audio and cursor the additional idiomatic cast is needed to silence the warning.
8e35ff5c 2021-07-28 14:20:29 By default minimize real fullscreen windows when they lose focus so the desktop video mode is restored. This fixes https://github.com/libsdl-org/SDL/issues/4039
1e07dba0 2021-06-09 15:26:38 x11: Use glXChooseFBConfig when available in X11_GL_GetVisual When choosing an X11 Visual for a window based on its GLX capabilities, first try glXChooseFBConfig (if available) before falling back to glXChooseVisual. This normally does not make a difference because most GLX drivers create a Visual for every GLXFBConfig, exposing all of the same capabilities. For GLX render offload configurations (also know as "PRIME") where one GPU is providing GLX rendering support for windows on an X screen running on a different GPU, the GPU doing the offloading needs to use the Visuals that were created by the host GPU's driver rather than being able to add its own. This means that there may be fewer Visuals available for all of the GLXFBConfigs the guest driver wants to expose. In order to handle that situation, the NVIDIA GLX driver creates many GLXFBConfigs that map to the same Visual when running in a render offload configuration. This can result in a glXChooseVisual request failing to find a supported Visual when there is a GLXFBConfig for that configuration that would have worked. For example, when the game "Unnamed SDVX Clone" [1] tries to create a configuration with multisample, glXChooseVisual fails because the Visual assigned to the multisample GLXFBConfigs is shared with the GLXFBConfigs without multisample. Avoid this problem by using glXChooseFBConfig, when available, to find a GLXFBConfig with the requested capabilities and then using glXGetVisualFromFBConfig to find the corresponding X11 Visual. This allows the game to run, although it doesn't make me any better at actually playing it... Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Fixes: https://forums.developer.nvidia.com/t/prime-run-cannot-create-window-x-glxcreatecontext/180214 [1] https://github.com/Drewol/unnamed-sdvx-clone
cc4ab101 2021-07-28 14:37:33 windows: convert "//" comment to "/**/", add a FIXME. Reference #4129 Reference #4177
a2031948 2021-07-28 14:06:51 Added in a MIME-type to the X11 clipboard. (#4385)
ad310d39 2021-07-28 12:31:25 wayland: libdecor support for SetWindowModalFor
93976ade 2021-07-28 12:22:09 wayland: libdecor support for GetWindowWMInfo
1fb4429b 2021-07-28 21:50:48 wayland: Avoid a pointer→TouchID cast warning As of [1], SDL now compiles with a warning in SDL_waylandevents.c on 32-bit systems under gcc 10.3.0: /tmp/SDL/src/video/wayland/SDL_waylandevents.c: In function 'seat_handle_capabilities': /tmp/SDL/src/video/wayland/SDL_waylandevents.c:958:22: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] 958 | SDL_AddTouch((SDL_TouchID)seat, SDL_TOUCH_DEVICE_DIRECT, "wayland_touch"); | ^ /tmp/SDL/src/video/wayland/SDL_waylandevents.c:964:22: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] 964 | SDL_DelTouch((SDL_TouchID)seat); | ^ This is due to SDL_TouchID always being 32-bit, but seat being a pointer which is (obviously) only 32-bit on 32-bit systems. The conversion is therefore harmless, so silence it with an extra cast via intptr_t. This is what the cocoa backend does (and is similar to what the Win32 backend does, except with size_t). Fixes: 03c19efbd1 ("Added support for multiple seats with touch input on Wayland") [1]: https://github.com/libsdl-org/SDL/commit/03c19efbd17f72f70ee021de6d2549eb0be3bb56
18303c92 2021-07-28 18:06:34 Wayland: Fix building with --disable-wayland-shared with libdecor. When wayland is not dynamically loaded (--enable-wayland-shared=no) libdecor.h is not included unless SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC is set, so it fails to build. We can't simply move the libdecor.h include above the #ifdef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC block, as libdecor.h itself #includes wayland headers we need to replace with #defines. Instead, duplicate the #include. Fixes https://github.com/libsdl-org/SDL/issues/4543 Note that this doesn't fix any of the underlying issues of libdecor being treated as part of wayland, it just fixes the build. A better solution would probably be to decouple the wayland dynamic loading from the libdecor dynamic loading completely, though that is a lot more work...
21cba924 2021-07-28 16:54:23 wayland: Don't create zxdg toplevel decoration twice Each window can have at most one zxdg toplevel decoration, but as of [1], we accidentally create two. (If libdecor is not in use). This causes wayland windows with server-side decorations (e.g. on KDE/KWin) to crash with the message: zxdg_decoration_manager_v1@7: error 1: decoration has been already constructed This extra zxdg_decoration_manager_v1.get_toplevel_decoration() call was introduced while deprecating wl-shell and xdg-shell-stable[1] support, and possibly was a bad interaction with [2], which moved the decoration creation around. Fixes: 6aae5b44f8 ("Remove wl-shell and xdg-shell-unstable-v6 support (#4323)") [1]: https://github.com/libsdl-org/SDL/pull/4323 [2]: https://github.com/libsdl-org/SDL/pull/4374
7b239edb 2021-07-28 01:00:00 wayland: Assign frame_callback on window creation. Fixes a crash when creating and destroying a window without calling SwapWindow.
41e1a236 2021-07-27 16:50:06 Correct the maximized size and position for borderless resizable windows This fixes bug https://github.com/libsdl-org/SDL/issues/4043
03185e74 2021-07-27 18:35:00 wayland: Tag/Check wl_output objects as well, fixes crashes when libdecor is in use
871c1119 2021-07-27 18:24:09 wayland: handle pending resizes immediately, not on SwapWindow. This was originally a workaround for an old Mesa bug, since fixed, apparently, and causes other problems. Fixes #4326.
51c61d7c 2021-07-27 14:57:18 Run the entire Cocoa messagebox function on the main thread. This fixes bug https://github.com/libsdl-org/SDL/issues/4420
dfd3f30e 2021-07-27 14:27:37 Make Cocoa_HandleTitleButtonEvent() static since it's not used anywhere else
a3eb297e 2021-07-27 17:17:19 wayland: Rework enter/leave and update_scale_factor to avoid bogus wl_output data. Also remove get_window_scale_factor() which was just pointless indirection.
6aae5b44 2021-07-27 17:12:26 Remove wl-shell and xdg-shell-unstable-v6 support (#4323) * wayland-protocol: update wayland.xml to 1.19.0 * wayland: remove shell_surface field from SDL_SysWMinfo * wayland: remove wl_shell support * waypand-protocols: update xdg-shell.xml to 1.20 * wayland: remove xdg-shell-unstable-v6 support * wayland: deprecate wl shell surface syswm info, add xdg surface
88e4755c 2021-07-27 12:43:00 Make sure we don't try to turn on relative mouse mode while clicking on the window title bar. This fixes bug https://github.com/libsdl-org/SDL/issues/4469
d80ef3e5 2021-07-26 22:51:24 SDL_VideoInit: silence 'may be used uninitialized' warning src/video/SDL_video.c:475: warning: 'i' may be used uninitialized in this function
5ec69285 2021-04-02 06:16:09 Support comma-separated lists in SDL_VIDEODRIVER
ac904b8e 2021-06-21 01:25:25 wayland: ignore resize in fullscreen or maximised mode
ee062c64 2021-05-19 00:13:39 wayland: implement toggling decorations
2b3cf36f 2021-05-22 00:49:10 wayland: forward window events
48066984 2021-04-05 14:09:03 wayland: enable/disable ACTION_RESIZE for fullscreen
9e6fcbe7 2020-06-11 22:10:28 wayland: client-side decoration
e5f9fae0 2021-05-16 23:19:45 wayland: don't flush after setting fullscreen
8e604a5f 2021-07-25 18:44:33 Fix error handling in X11_SetWindowTitle X11_XChangeProperty return 1 on success.
bc3b98f3 2021-07-25 03:33:44 Replace with SDL_SendKeyboardKeyAutoRelease
5cd37c0a 2021-07-25 01:04:51 Add Enter Key support to PSVita IME keyboard
3b85e3fd 2021-07-24 15:47:11 Fixed internal Windows key state when using Windows+Space or Windows+G shortcuts This fixes bugs: https://github.com/libsdl-org/SDL/issues/4369 https://github.com/libsdl-org/SDL/issues/4500
03c19efb 2021-07-24 15:25:50 Added support for multiple seats with touch input on Wayland This fixes bug https://github.com/libsdl-org/SDL/issues/4517
ff1b5e1b 2021-07-24 15:10:57 Implemented the window flash operations for X11
f1633127 2021-07-24 13:41:55 Added a window flash operation to be explicit about window flash behavior
e1c3a250 2021-07-24 12:11:27 Changed SDL_FlashWindow() so it doesn't take a flash count, and added the hint SDL_HINT_WINDOW_FLASH_COUNT to control behavior on Windows
7b0092db 2021-07-23 18:58:25 vita: touch: Mark the back panel as an indirect absolute touch device It's not a touchscreen, but an additional touch panel on the back of the device.
48bbe31b 2021-07-20 21:45:21 Add PreSwapCallback for updating SceCommonDialog
9c1306bc 2021-07-20 21:44:16 Add elgext.h header
4ada14a2 2021-07-21 13:39:10 Replace libc functions to SDL equivalent in wayland video subsystem Wayland video subsystem uses a mix of libc and SDL function. This patch switches libc functions to SDL ones and fixes a mismatch in memory allocation/dealoccation of SDL_Cursor in SDL_waylandmouse.c (calloc on line 201 and SDL_free on line 313) which caused memory corruption if custom memory allocator where provided to SDL.
d6641d71 2021-07-19 11:52:57 kmsdrm: Explicitly set the surface transform and alpha mode This is required by the specification. Set these to sensible defaults. Fixes a validation layer error that occurs otherwise.
76007427 2021-07-19 11:26:54 kmsdrm: Properly zero-initialize CreateInfo structs As written, these contain undefined stack contents, which in practice causes crashes/hangs and/or triggers the validation layers (they complain about `pNext` and `flags` not being NULL).
7fe6dbaf 2021-07-11 15:25:24 Reset rawInputEnableCount when RawInput is not supported
557d0f82 2021-03-11 13:36:56 Commenting a false alarm in WIN_GLES_SetupWindow. When hint SDL_HINT_OPENGL_ES_DRIVER is set to "1" (e.g. for ANGLE support), assertion due to !_this->gl_config.driver_loaded can be causes while EGL is available.
4359a47b 2021-04-02 12:48:16 Simplify ClipCursor behaviour when RelativeMouseMode is enabled The implementation of clip logic for relative mode seemed to unnecessarily limit the usable area to the middle of the window, in a 2x2 pixel region. This has the adverse side effect of moving the operating system cursor to that location, even if it is in a valid location in the window. While in most scenarios this is handled correctly (by storing the original position of the cursor in the window and restoring when leaving relative mode), there are edge cases where this clip operation can cause WM_MOUSEMOVE to fire at a point in time where it counts as a relative delta from SDL's perspective.
3720e254 2021-04-02 12:48:02 Trim some stray whitespace
16e3bfe8 2021-06-28 11:29:16 SetDisplayMode: Call XRRSetScreenSize before setting CRTC config X11_SetDisplayMode currently calls X11_XRRSetCrtcConfig alone. This results in the monitor's viewport getting changed, but the underlying screen dimensions stay the same. The spec indicates that RRSetCrtcConfig only changes the crtc mode and has no effect on the screen dimensions, only mentioning that the new crtc must fit entirely within the screen size. For the size to change, RRSetScreenSize also needs to be called. This affects Metro Exodus on Linux, when changing the resolution in the in-game settings Metro gets stuck in a loop waiting for the size of its vulkan surface to change. Because XRRSetScreenSize is not called the screen size is never changed, the vulkan surface dimensions do not change, and Metro hangs forever watching for a surface size update that will never come. This change disables the CRTC, calls XRRSetScreenSize, and then updates the CRTC configuration. This fixes changing the resolution from the Metro settings. Tested with: Metro Exodus, Portal 2
46f19c31 2021-07-08 07:23:29 Implemented mouse relative mode for iOS 14.1 and newer
9d452719 2021-06-21 15:42:47 Vita: append messagebox title
0994a758 2021-07-01 20:36:49 Don't hardcode message length
33b84c8d 2021-06-24 23:10:56 s/memcmp/SDL_memcmp/ for conistency
56b77b12 2021-06-04 19:51:58 cocoa: Implement FlashWindow
c2e8a791 2021-06-12 16:20:47 SDL_windowsevents: add support for multiple mice
c262569c 2021-06-22 00:03:18 kmsdrm: fix KMSDRM_SetDisplayMode being called for the default desktop mode doing nothing
98bda391 2021-06-23 00:21:31 kmsdrm: sync the display's current mode with what's set in KMSDRM_CreateSurfaces
d031a24e 2021-06-08 00:39:04 kmsdrm: defer surface recreation inside of KMSDRM_SetWindowSize and KMSDRM_SetWindowFullscreen as is done in KMSDRM_SetWindowDisplayMode
5a296e25 2021-06-08 20:48:24 kmsdrm: avoid overriding the mode requested by SDL_SetWindowDisplayMode when recreating surfaces
839387ed 2021-06-17 22:09:13 video/dummy: Don't zero out the fake display mode before adding it. The SDL_zero call was in the wrong place as a historical accident, I think.
268fbcd4 2021-06-17 11:23:47 Fixed compiler warning on Visual Studio
7f261d3b 2021-06-15 00:35:13 wayland: Fix returning to a window from fullscreen without calling SetWindowSize
bc9888c9 2021-06-12 14:55:24 OS2_GetDisplayModes: malloc a new copy of mode's driver data. Based on a patch by Jochen Schäfer <josch1710@live.de> : The problem is, that in the initialization code uses the same structure for desktop_mode and current_mode. See SDL_os2video.c:OS2_VideoInit(): stSDLDisplay.desktop_mode = stSDLDisplayMode; stSDLDisplay.current_mode = stSDLDisplayMode; ... stSDLDisplayMode.driverdata = pDisplayData; Then, if you call GetDisplayModes, current_mode will added to the modes list, with the same driverdata pointer to desktop_mode. SDL_AddDisplayMode( display, &display->current_mode ); When VideoQuit gets called, first the modes list gets freed including the driverdata, the desktop_mode gets freed. See SDL_video.c:SDL_VideoQuit(): for (j = display->num_display_modes; j--;) { SDL_free(display->display_modes[j].driverdata); display->display_modes[j].driverdata = NULL; } SDL_free(display->display_modes); display->display_modes = NULL; SDL_free(display->desktop_mode.driverdata); display->desktop_mode.driverdata = NULL; So, the display_modes[j].driverdata gets freed, but desktop_mode->driverdata points to the same memory, but is not NULL'ed. When desktop_mode->driverdata gets freed the memory is already freed, and libcx crashes the application on SDL_Quit.
eb15b4e9 2021-06-11 23:40:09 wayland: Drop SwapWindow calls for hidden windows
37d35a3e 2021-06-11 21:02:49 kmsdrm: hook up KMSDRM_GLES_DefaultProfileConfig for use. Fixes #3678.
bbdd08e0 2021-06-10 13:20:39 Build without PIB support by default and add flag to enable it
c2b8b556 2021-06-10 12:06:28 Older api, not needed
2f248a2a 2021-06-11 04:00:32 SDL_cocoaevents.m: fix build against SDK < 10.12 after commit 0dd7024d.
e65a6583 2021-06-09 22:10:20 x11: Add a hint to force override-redirect. Fixes #3776.
e13b43ac 2021-06-05 12:44:08 Don't skip sending wakeups for the current thread We can be in a situation where we receive a win32 hook callback on the same thread that is currently waiting. In that case, we do still need to trigger a wakeup when an event is pushed because the hook itself won't necessarily do that (depending on what we return from the hook).
85b51e6c 2021-06-05 11:46:47 Fall back to polling normally if not operating the win32 message loop In this condition, we cannot safely wait/wake on events.
d956636c 2021-06-04 18:39:47 wayland: Implement FlashWindow