src/video/wayland


Log

Author Commit Date CI Message
Luis Cáceres 5c78df9c 2021-04-14T00:56:50 Support key composing (i.e. dead keys) in Wayland driver (#4296) Based on an old patch by chw from the old Bugzilla issue tracker. Authored-by: chw Co-authored-by: Sam Lantinga <slouken@libsdl.org>
Ethan Lee f88d91d5 2021-04-12T23:47:23 wayland: Minor whitespace fix
Ethan Lee d785dab5 2021-04-12T23:37:53 wayland: Add unscaled resolutions to the display mode list
Ethan Lee dfcd5fbc 2021-04-08T21:57:58 wayland: Set the keymap in keyboard_handle_modifiers
Ethan Lee c59d4dcd 2021-04-08T15:32:33 wayland: Dramatically lower the timeout when reading/writing pipes
Ethan Lee cf124963 2021-04-08T15:29:54 wayland: Fall back to clipboard source data if offer came up empty
Ethan Lee 282c0524 2021-04-08T14:59:04 wayland: Another strlen->SDL_strlen
Ethan Lee bec133d7 2021-04-08T14:16:32 wayland: Use SDL_strlen instead of strlen
Ethan Lee e28d9785 2021-04-08T14:16:21 wayland: Minor whitespace cleanup in clipboard.c
Ethan Lee 875f839d 2021-04-08T14:14:46 wayland: A bunch of clipboard safety fixes. Also removed Wayland_get_data_device because it was a pointless getter function.
Ethan Lee 7510245a 2021-04-08T14:08:35 wayland: Create the data_device only after both device_manager and input exist. There is no guarantee on what order the Wayland interfaces will come in, but the callbacks were assuming that wl_data_device_manager would could before wl_seat. This would cause certain desktops to not have any data_device to work with, meaning certain features like the clipboard would silently no-op.
David Edmundson 6fd37194 2021-04-07T16:03:41 wayland: Fix leaked zxdg_decoration_manager
David Edmundson f6a09ef1 2021-04-07T16:16:23 wayland: Drop support for kwin specific decoration management KWin has supported the shared and formalised zxdg_decoration since Plasma 5.16 which came out mid 2019. Whilst it made sense to support them both for a while, it should not be needed for future SDL releases.
Ethan Lee a92cca1a 2021-04-07T16:44:10 wayland: Use the window's display to get wl_output rather than fullscreen_mode. Because Wayland only supports FULLSCREEN_DESKTOP, fullscreen_mode never gets assigned at all, meaning driverdata is always NULL! Depending on what the compositor does this can lead to dramatically different results. GNOME was fine without this, but Plasma would trip an event that unintentionally unset the fullscreen mode and caused the game to fire a configure event _every frame_, and of course the configure would send the fullscreen_mode output which was still empty. The fix is to just use the SDL_VideoDisplay directly, which will always have a valid wl_output.
Ethan Lee c7e29a9e 2021-04-06T18:10:40 wayland: Fix toggling fullscreen with fixed-size windows
meyraud705 413a2306 2021-04-04T10:47:06 NULL passed to strcmp in Wayland_ShowMessageBox
Ryan C. Gordon dbdbae44 2021-04-02T14:35:11 linux: (de)initialize d-bus at init and quit. Previously we had different subsystems quitting it, in conflict, and risked multiple threads racing to init it at the same time. Fixes #3643.
Ethan Lee eeee7308 2021-03-29T16:57:03 wayland: Implement IME support. Note that this is purely to make it possible to enter text that requires composition - for example, before this commit Kanji input didn't work at all. The big problem this still has is that we need the window position, and this is still not implemented. Once we have this information we can do the equivalent of XTranslateCoordinates to put the rectangle where we want it.
Ethan Lee 07ba13b7 2021-03-26T00:40:05 wayland: Pass --no-wrap to Zenity. There seems to be a bug where it can wrap the text based on the minimum possible window size, which can be worked around with --no-wrap. This technically uncaps the width entirely, but this isn't wildly different from what other backends do.
Ethan Lee 54719a9d 2021-03-25T23:58:12 wayland: Assign output_len in ShowMessageBox
Ethan Lee 27b74d33 2021-03-25T23:25:34 Implement Wayland_ShowMessageBox using Zenity
Ethan Lee 57a927e8 2021-02-12T14:27:58 wayland: Explicitly set min/max size for xdg-shell
Cameron Gutman 8c5b7af2 2021-02-25T19:30:47 Wayland: Fix mouse pointer hiding on Plasma Wayland Unlike Mutter and Sway, KWin actually checks the serial passed in wl_pointer_set_cursor(). The serial provided is supposed to be the serial of the pointer enter event, but We were always passing 0. This caused KWin to drop our requests to hide the cursor. Thanks to the KDE folks for spotting this in my debug logs. Fixes #3576
Ethan Lee a99eec77 2021-02-12T14:31:43 wayland: Minor whitespace fix
Ethan Lee cad67082 2021-02-04T19:04:56 wayland: Check for both _WAYLAND_CLIENT_H and WAYLAND_CLIENT_H
Sam Lantinga 629334f2 2021-02-09T15:02:55 Fixed bug 5543 - Wayland: Fix waylandvideo.h warnings wahil1976 This patch fixes the warnings seen when compiling the Wayland backend. This will also be required in the future to avoid issues with compilation.
Sam Lantinga d9ba2044 2021-02-08T16:55:01 Backed out changeset 852a7bdbdf4b This causes a use-after-free memory error
Christian Rauch 4183211a 2021-02-08T16:01:37 free the 'display' after it was added to global list
Sam Lantinga ff297753 2021-02-04T10:46:34 Fixed compiler warning
Sebastian Krzyszkowiak e862856e 2021-02-01T08:57:39 wayland: Don't crash when the properties of already existing wl_output change
Christian Rauch 0ed16ced 2021-01-31T19:10:02 free 'outputs' in 'Wayland_DestroyWindow'
Christian Rauch a4467846 2021-01-31T19:09:44 free the 'data_device_manager'
Sebastian Krzyszkowiak 3ae2ec34 2021-01-31T19:06:37 wayland: Fix transform and scale handling when setting display mode
Cameron Gutman a0d3c6c6 2021-01-25T21:42:14 Rename SetWindowGrab() to SetWindowMouseGrab()
Cameron Gutman d133a5f6 2021-01-24T17:19:48 wayland: cancel key repeat when keyboard focus is lost SDL_SetKeyboardFocus(NULL) will lift any keys still pressed when keyboard focus leaves the window, but then key repeat comes behind our backs and presses the key down again. This results in an infinite stream of SDL_KEYDOWN events when focus leaves the window with a key down (particularly noticeable with Alt+Tab).
Cameron Gutman e1f73e64 2021-01-23T16:22:44 Refactor keyboard grab to be managed by the video core This gives us flexibility to add others hints to control keyboard grab behavior without having to touch all of the backends. It also allows us to possibly expose keyboard grab separately from mouse grab for applications that want to manage those independently.
Ethan Lee e787282b 2021-01-23T15:40:22 Implement Wayland_SetWindowResizable
Simon McVittie c16cfc0e 2021-01-23T11:22:35 waylandtouch: Don't export interface structs These are explicitly written in C code rather than generated at build time, so they weren't affected by changing how we invoke wayland-scanner. Signed-off-by: Simon McVittie <smcv@collabora.com>
Cameron Gutman bd553ea8 2021-01-20T21:17:20 Implement support for inhibiting the screensaver on Wayland We support both the org.freedesktop.ScreenSaver D-Bus API (same as the X11 backend) and the Wayland idle_inhibit_unstable_v1 protocol. Some Wayland compositors only support one or the other, so we need both to for broad compatibility.
Cameron Gutman 7ff3832e 2021-01-22T19:22:17 Fix continuous scrolling speed on Wayland Wayland compositors seem to have standardized on 10 units per "wheel tick" for continuous scroll events, so we need to convert these axis values to ticks by dividing by 10 before reporting them in SDL_MOUSEWHEEL events.
Cameron Gutman 19236b46 2021-01-21T21:49:13 Implement support for minimizing windows on Wayland This required a bit of extra code to deal with the transition from minimized back to fullscreen
Cameron Gutman cf84ec44 2021-01-20T23:19:24 Improve reliability of cursor hiding on GNOME Wayland Hiding the cursor doesn't appear to work reliably on GNOME when another window steals mouse focus right as we call SDL_ShowCursor(SDL_DISABLE). This can happen when the keyboard shortcut inhibition permission prompt appears in response to a call to SDL_SetRelativeMouseMode() with SDL_HINT_GRAB_KEYBOARD=1. The result is that the default cursor is stuck locked in position and visible on screen indefinitely. By redrawing the cursor on pointer focus enter, the cursor now disappears upon the first mouse motion event. It's not perfect but it's way better than the current behavior.
Cameron Gutman d789ba83 2021-01-19T18:20:07 Implement keyboard grab support for Wayland Use zwp_keyboard_shortcuts_inhibit_manager_v1 to allow SDL applications to capture system keyboard shortcuts like Alt+Tab when keyboard grab is enabled via SDL_HINT_GRAB_KEYBOARD.
Sam Lantinga 6a342954 2021-01-14T14:42:53 Fixed bug 5451 - Can't create EGLSurface in Wayland from SDLWindow (no EGLNativeWindow pointer) sashikknox In some cases, need create EGLWindow with SDLWindow. In X11 i can get pointer to NativeWindow from **struct SDL_SysWMinfo wmInfo** ```C++ struct SDL_SysWMinfo wmInfo; SDL_GetWindowWMInfo(ptSDLWindow, &wmInfo) #if defined(__unix__) && defined(SDL_VIDEO_DRIVER_X11) nativeWindow=(EGLNativeWindowType)wmInfo.info.x11.window; nativeDisplay=(EGLNativeDisplayType)wmInfo.info.x11.display; #endif ``` than i can create EGLSurface ``` eglCreateWindowSurface(nativeDisplay, EGL_CONFIG, nativeWindow, SURFACE_ATTRIBUTES); ``` in Wayland i can do it with same way, just need pointer to **EGLWindow**, we already have pointer to **wl_display** from **SDL_sysWMInfo**, need add to **wl** struct in SDL_SysWMInfo another pointer to **struct wl_egl_window *egl_window;**. And in wayland backend, in function **Wayland_GetWindowWMInfo** return pointer to **egl_window** from **SDL_WindowData** Now i use patched statically built SDL2 in port of Quake 2 GLES2 for SailfishOS (it use QtWayland): link to SDL2 commit and changed string for patch: - https://github.com/savegame/lp-public/commit/6858a618cd179b766fe3cab36055f07cb03ad0ea - https://github.com/savegame/lp-public/blob/b1e29e87b9d15780e47f04918b329ac15554fc69/SDL2/src/video/wayland/SDL_waylandwindow.c#L463 link to use in Quake2 port: 1. here i get pointer to EGLNativeWindowType: https://github.com/savegame/lp-public/blob/6d94fedb1b720da24999ae6286a1809cd3d55ff5/Engine/Sources/Compatibility/OpenGLES/EGLWrapper.c#L319 2. then use it for create EGLSurface: https://github.com/savegame/lp-public/blob/6d94fedb1b720da24999ae6286a1809cd3d55ff5/Engine/Sources/Compatibility/OpenGLES/EGLWrapper.c#L391
Sam Lantinga 9130f7c3 2021-01-02T10:25:38 Updated copyright for 2021
Sam Lantinga cb361896 2020-12-09T07:16:22 Fixed bug 5235 - All internal sources should include SDL_assert.h Ryan C. Gordon We should really stick this in SDL_internal.h or something so it's always available.
Sam Lantinga f311e0a8 2020-10-19T17:29:16 Removed debug log message
Ozkan Sezer 93e14497 2020-10-14T15:50:04 SDL_waylanddatamanager.c (mime_data_list_add): constify the buffer param Fixes -Wdiscarded-qualifiers warnings from Wayland_data_source_add_data()
Sam Lantinga 76980e30 2020-10-08T16:42:20 Added events for dynamically connecting and disconnecting displays, with an iOS implementation
Yiding Jia f31ad57f 2020-10-05T19:17:52 Implement keyboard repeat in wayland video driver
Sam Lantinga 8709f67e 2020-09-08T08:42:30 Fixed bug 5215 - Fixing filenames passed to dlopen for OpenBSD Brad Smith Attached is a patch to use the proper filenames when trying to dlopen the respective shared libraries on OpenBSD.
Tudor Brindus c0943328 2020-07-21T13:14:24 wayland: defer pointer confine creation until pointer unlock It is a protocol error to attempt to create a pointer confine (i.e. `SDL_SetWindowGrab`) while a locked pointer is active, and vice-versa. Instead of aborting due to a protocol error, this commit makes SDL gracefully downgrade locked pointers to confines when appropriate.
M Stoeckl a78b9763 2020-07-14T19:18:16 Reuse Wayland connection from availability check
M Stoeckl 052a1373 2020-07-12T19:11:15 Merge VideoBootStrap::available into VideoBootStrap::create The two are only ever called together, and combining them makes it possible to eliminate redundant symbol loading and redundant attempts to connect to a display server.
Sam Lantinga 958c4282 2020-06-04T09:13:49 Fixed build warning
Ryan C. Gordon aa259ed5 2020-05-28T15:18:41 wayland: Changed output removal in handle_surface_leave() No longer needs an extra malloc, handles unexpected cases like the same output being listed twice.
Ryan C. Gordon ce7ae4ec 2020-05-28T14:57:10 wayland: Move buffer copy into mime_data_list_add() It makes it clearer who owns the memory, and more reasonable to free it on failure in the creating function. (and, of course, pacifies static analysis.)
Ryan C. Gordon 22da9d4d 2020-05-28T14:47:55 wayland: assert that mmap() didn't return NULL. In practice, it never _would_, but in theory it _might_, so this assertion tells the static analyzer not to worry about it.
Tudor Brindus a6ca61d7 2020-05-21T00:06:09 wayland: update pointer position on initial enter event
Sam Lantinga 0eb6512b 2020-05-04T13:19:26 Fixed bug 5121 - Use SDL_calloc instead of calloc in Wayland_CreateWindow meyraud705 'SDL_Windows::driverdata' of a Wayland window is allocated by calloc in 'Wayland_CreateWindow' but freed by SDL_free in 'Wayland_DestroyWindow'.
Tudor Brindus 1a291ab1 2020-04-17T13:55:44 wayland: add support for SDL_SetWindowGrab
Ryan C. Gordon 02469877 2020-04-07T13:30:46 wayland: Support wayland compositors with wl_seat version < 5 (thanks, Nia!). Fixes Bugzilla #5074.
Sam Lantinga b6afbe63 2020-04-07T09:38:57 Added SDL_log.h to SDL_internal.h so logging is available everywhere
Ryan C. Gordon 7ad77bcc 2020-02-14T01:08:21 wayland: Don't force the window into OpenGL mode if we want Vulkan.
Ryan C. Gordon a77a890d 2020-02-14T00:58:36 wayland: Don't delay pending surface resize handling on Vulkan. OpenGL apparently needs to not do any drawing between wl_egl_window_resize and eglSwapBuffers, but Vulkan apps don't use SDL to present, so they never call into an equivalent of SDL_GL_SwapWindow where our Wayland code was handling pending resize work. Fixes Bugzilla #4722.
Ryan C. Gordon 4378fcd9 2020-02-10T23:48:06 wayland: Fix building with -fno-common (which is now the default in GCC 10). Fixes Bugzilla #4957.
Sam Lantinga 67f44788 2020-02-03T00:57:12 Fixed bug 4917 - Wayland: handle discrete pointer axis events Luis Caceres The current handling of Wayland mouse pointer events only handles wl_pointer.axis events, which, according to the Wayland documentation, deal with mouse wheel scroll events on a continuous scale. While this is reasonable for some input sources (e.g. touchpad two-finger scrolling), it is not for mouse wheel clicks which generate wl_pointer.axis events with large deltas. This patch adds handling for wl_pointer.axis_discrete and wl_pointer.frame events and prefers to report SDL_MouseWheelEvent in discrete units if they are available. This means that for mouse wheel scrolling we count in clicks, but for touchpad two-finger scrolling we still use whatever units Wayland uses. This behaviour is closer to that of the X11 backend. Since these events are only available since version 5 of the wl_seat interface, this patch also checks for this and falls back to the previous behaviour if its not available. I also had to add definitions for some of the pointer and keyboard events specified in versions 2-5 but these are just stubs and do nothing.
Sam Lantinga a8780c6a 2020-01-16T20:49:25 Updated copyright date for 2020
Michael Forney cdbeae52 2019-12-29T23:10:39 wayland: support wl_data_device_manager version < 3
Sylvain Becker 88ba6798 2019-10-30T21:12:36 Wayland: touch events, use of memory after it is freed
Sylvain Becker 86ae245b 2019-10-30T17:59:20 Use correct enum: typo in org_kde_kwin_server_decoration_mode instead of org_kde_kwin_server_decoration_manager_mode
Sylvain Becker 60d3965e 2019-10-30T15:36:17 Readability: remove redundant return, continue, enum declaration
Sylvain Becker b458d7a2 2019-10-30T15:13:55 Readability: remove redundant cast to the same type
Sylvain Becker 735691ec 2019-10-30T14:29:41 Remove nested redundant #ifndef
Sam Lantinga afdb40af 2019-08-05T23:38:48 Fixed bug 4689 - SDL fails to detect compositor shutdown on Wayland -- program keeps running M Stoeckl To reproduce: 1. Run any SDL-based program with a Wayland compositor, orphaning it so that it doesn't have an immediate parent process. (For example, from a terminal, running `supertux2 & disown`.) The program should use the wayland backend, i.e. by setting environment variable SDL_VIDEODRIVER=wayland. 2. Kill the compositor process. Results: - The SDL program will keep running. Expected results: - The SDL program should close. (What close should mean here, I'm not sure - is injecting an SDL_Quit the appropriate action when a video driver disconnects?) Build data: 2019-06-22, hg tip (12901:bf8d9d29cbf1), Linux, can reproduce with sway, weston, and other Wayland oompositors.
Alex Szpakowski 109cbd6e 2019-08-04T16:56:40 Fix touch-related compile errors on Linux.
Alex Szpakowski d5ec735a 2019-08-01T18:22:12 Add a windowID field to SDL_TouchFingerEvent (bug #4331). This is unimplemented on some platforms and will cause compile errors when building those platform backends for now.
Ryan C. Gordon d0fa93d6 2019-06-19T00:52:34 wayland: Fixed C99-style variable declaration inside for-loop.
Sebastian Krzyszkowiak 797b2813 2019-06-12T00:55:05 wayland: HiDPI support
Sylvain Becker 236b8606 2019-04-02T18:07:27 Bug 4576: one more warning
Sylvain Becker b8e5c561 2019-04-02T17:07:54 Bug 4576: remove touch/mouse duplication for Wayland
Sylvain Becker cddb285c 2019-03-12T20:04:08 Fixed bug 4513 - Wayland, fix crash when remove event is sent (from Sebastian Krzyszkowiak)
Sam Lantinga 5e13087b 2019-01-04T22:01:14 Updated copyright for 2019
Brandon Schaefer f9192ab8 2018-12-06T10:39:33 wayland: Do not try to lock on an invalid pointer This happens if you try to lock the pointer and (caps & WL_SEAT_CAPABILITY_POINTER) is false Leading to input->pointer being NULL which ends up bringing the wayland client down (at lease on weston)
Ryan C. Gordon 2878d4f8 2018-12-05T16:53:15 egl: Don't force X11 support when testing for EGL. Fixes building Wayland support on embedded systems without X11. (TODO: maybe move the EGL test out of the X11 tests at some point, too.)
Ryan C. Gordon bd3ee07c 2018-12-05T16:49:38 wayland: Send SDL_TOUCH_MOUSEID mouse events for touches.
Ryan C. Gordon c4bc59a5 2018-12-01T10:36:26 Patched to compile on Linux with --disable-threads. Fixes Bugzilla #4393.
Alex Szpakowski 5029d50e 2018-11-10T16:15:48 Add SDL_TouchDeviceType enum and SDL_GetTouchDeviceType(SDL_TouchID id). Touch device types include SDL_TOUCH_DEVICE_DIRECT (a touch screen with window-relative coordinates for touches), SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE (a trackpad-style device with absolute device coordinates), and SDL_TOUCH_DEVICE_INDIRECT_RELATIVE (a trackpad-style device with screen cursor-relative coordinates). Phone screens are an example of a direct device type. Mac trackpads are the indirect-absolute touch device type. The Apple TV remote is an indirect-relative touch device type.
Sebastian Krzyszkowiak 48917e0e 2018-11-07T01:08:35 wayland: fix resizing and fullscreen toggling For starters, we need to correctly respond to 0,0 configure after unsetting fullscreen. Also, turns out that there should be no drawing calls at all in between eglSwapBuffers and wl_egl_window_resize, as otherwise EGL can already allocate a wrongly sized buffer for a next frame, so handle those together.
Sebastian Krzyszkowiak 5f980514 2018-11-04T21:08:40 wayland: ask xdg-decoration protocol extension to use server-side decorations if possible.
Ryan C. Gordon 62494a2e 2018-10-31T15:03:41 Merge SDL-ryan-batching-renderer branch to default.
Ryan C. Gordon a5ebd4d7 2018-10-29T10:14:59 wayland: ask KDE protocol extension to use server-side decorations if possible.
Micha? Janiszewski 91820998 2018-10-28T21:36:48 Add and update include guards Include guards in most changed files were missing, I added them keeping the same style as other SDL files. In some cases I moved the include guards around to be the first thing the header has to take advantage of any possible improvements compiler may have for inclusion guards.
Ryan C. Gordon 367f9b91 2018-10-05T17:24:03 wayland: Fixed missing window sizing events. Fixes Bugzilla #4242.
Sam Lantinga 5febdfce 2018-09-24T11:49:25 Fixed whitespace
Thomas Perl 84e78320 2018-08-23T14:47:38 Fix "unresponsible application" issues in Wayland Polling without wl_display_flush() never responds to ping requests. In that case ping-pong works only on other events, such as user input or on frame swapped. From https://git.merproject.org/mer-core/libsdl/merge_requests/3 Original author: Alexander Akulich <a.akulich@omprussia.ru>
Ryan C. Gordon c8ac9096 2018-06-24T22:42:36 wayland: Implemented xdg-wm-base support. This is just in parity with the existing zxdg-shell-unstable-v6 code. Making the Wayland target robust (and uh, with title bars) is going to take a lot of work on top of this.
Ryan C. Gordon 2df59062 2018-04-15T17:42:09 wayland: zxdg_shell_v6 needs a configure event before using a surface at all. Fixes Bugzilla #4109. Fixes Bugzilla #4119.
sezero 40b27fd5 2018-02-12T17:00:00 revert the recent typecast assignment changes (see bug #4079) also change the void* typedefs for the two vulkan function pointers added in vulkan_internal.h into generic function pointer typedefs.
sezero 8a1ae708 2018-02-12T10:00:00 kill C99'ism in SDL_waylandvulkan.c