aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* protocol: improve wl_subsurface.{set_position,place_above} descriptionKirill Primak2023-11-211-6/+2
| | | | | | | Don't mention when the parent surface state is applied; the parent surface isn't necessarily a sub-surface. Signed-off-by: Kirill Primak <vyivel@eclair.cafe>
* protocol: clarify defaults with wl_compositor@v6Kirill Chibisov2023-11-211-0/+6
| | | | | | | | This should be sufficient for clients to not decide to fallback to output based logic to determine scaling/transform when compositor doesn't send any of the v6 events. Signed-off-by: Kirill Chibisov <contact@kchibisov.com>
* util: simplify wl_fixed_from_double()Simon Ser2023-11-211-8/+1
| | | | | | | Same as 0e0ae7e290f2 ("util: simplify wl_fixed_to_double()"), but for the reverse function. Signed-off-by: Simon Ser <contact@emersion.fr>
* gitlab: make issue template the defaultSimon Ser2023-11-211-1/+1
| | | | | | | | | | | The issue template is hard to notice because it's not the default. Users have to explicitly select it from the easy-to-miss dropdown to get the warning. Make the template the default one, so that new users are less likely to miss it. Signed-off-by: Simon Ser <contact@emersion.fr>
* protocol: refer to wl_surface.offset in wl_data_device.start_dragSimon Ser2023-11-211-1/+1
| | | | | | | Passing an offset to wl_surface.attach is not supported in the latest version of the interface. Signed-off-by: Simon Ser <contact@emersion.fr>
* connection: avoid calling memcpy on NULL, 0David Benjamin2023-11-081-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to what is arguably a mistake in the C language specification, passing NULL to memcpy and friends is undefined behavior (UB) even when the count is 0. C additionally mistakenly leaves NULL + 0 and NULL - NULL undefined. (C++ fixes this mistake.) These are very problematic because (NULL, 0) is a natural representation of the empty slice. Some details: https://github.com/llvm/llvm-project/issues/49459 https://www.imperialviolet.org/2016/06/26/nonnull.html Unfortunately, despite how clearly this is a mistake, glibc headers and GCC now try to exploit this specification mistake and will miscompile code, so C projects need to workaround this. In particular, UBSan from Clang will flag this as a bug (although Clang itself has the good sense to never lean on this bug). We've run into a few UBSan errors in Chromium stemming from Wayland's memcpy calls. Add runtime guards as needed to avoid these cases. Note: Chromium's copy of wayland has https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/188 applied. It is possible the ring_buffer_copy UB cases are only reachable with that MR applied, I'm not sure. But it seemed simplest to just add the fix to wayland as-is. Then when/if that MR lands, it will pick this up. Signed-off-by: David Benjamin <davidben@google.com>
* client: Add method to get display for a given proxyDavid Edmundson2023-08-073-0/+19
| | | | | | | | This can be useful for additional validation purposes when handling proxies. This is similar to existing server side API wl_global_get_display. Signed-off-by: David Edmundson <david@davidedmundson.co.uk>
* ci: upgrade FreeBSD to 13.2Simon Ser2023-08-021-2/+2
| | | | Signed-off-by: Simon Ser <contact@emersion.fr>
* ci: upgrade Debian to bookwormSimon Ser2023-08-021-3/+3
| | | | | | This is the current Debian stable release. Signed-off-by: Simon Ser <contact@emersion.fr>
* ci: upgrade ci-templatesSimon Ser2023-08-021-7/+5
| | | | | | | | | Newer ci-templates contains bugfixes. While at it, stop using a GitLab YAML reference, because we only use this value in one spot. Signed-off-by: Simon Ser <contact@emersion.fr>
* cursor: check return value of snprintf()Simon Ser2023-08-021-1/+6
| | | | | | | | | | | | | | | | | | | | Fixes a new warning in GCC 7: FAILED: cursor/libwayland-cursor.so.0.22.90.p/xcursor.c.o cc -Icursor/libwayland-cursor.so.0.22.90.p -Icursor -I../cursor -I. -I.. -Isrc -I../src -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -std=c99 -O3 -D_POSIX_C_SOURCE=200809L -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -fvisibility=hidden -fPIC '-DICONDIR="/usr/share/X11/icons"' -MD -MQ cursor/libwayland-cursor.so.0.22.90.p/xcursor.c.o -MF cursor/libwayland-cursor.so.0.22.90.p/xcursor.c.o.d -o cursor/libwayland-cursor.so.0.22.90.p/xcursor.c.o -c ../cursor/xcursor.c ../cursor/xcursor.c: In function 'xcursor_load_theme': ../cursor/xcursor.c:596:39: error: '%s' directive output between 7 and 7 bytes may cause result to exceed 'INT_MAX' [-Werror=format-truncation=] 596 | snprintf(full, full_size, "%s/%s/%s", dir, subdir, file); | ^~ ...... 764 | full = xcursor_build_fullname(dir, "cursors", ""); | ~~~~~~~~~ ../cursor/xcursor.c:596:41: error: '/' directive output between 1 and 1 bytes may cause result to exceed 'INT_MAX' [-Werror=format-truncation=] 596 | snprintf(full, full_size, "%s/%s/%s", dir, subdir, file); | ^ cc1: all warnings being treated as errors Signed-off-by: Simon Ser <contact@emersion.fr>
* protocol: fix whitespaceSimon Ser2023-07-191-9/+9
| | | | | | This file uses tabs instead of 8 spaces. Signed-off-by: Simon Ser <contact@emersion.fr>
* Add a triage-policies file for bugbotPeter Hutterer2023-07-071-0/+33
| | | | | | With a default template for the common case of "this is not a protocol bug". Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* debug: Replace "@<id>" with "#<id>" in logsAlex Yang2023-06-274-12/+12
| | | | | | | | | | | | Wayland debug logs resemble email addresses. This is a problem when anonymizing logs from users. For example: [2512874.343] xdg_surface@700.configure(333) In the above log line, the substring "surface@700.config" can be mistaken for an email address and redacted during anonymization. Signed-off-by: Alex Yang <aycyang@google.com>
* tests: manually wrap libc functionsSimon Ser2023-06-272-62/+47
| | | | | | | | | | | | The way we're wrapping libc functions via dlsym() is pretty fragile and breaks on FreeBSD. The failures happen in our CI and are pretty random, see e.g. [1]. Use a more manual way to wrap via a function pointer. [1]: https://gitlab.freedesktop.org/wayland/wayland/-/jobs/44204010 Signed-off-by: Simon Ser <contact@emersion.fr>
* egl: add missing ABI check testSimon Ser2023-06-201-1/+2
| | | | | | | We were building the executable for the test, but not declaring the test. Signed-off-by: Simon Ser <contact@emersion.fr>
* tests: add missing proxy-testSimon Ser2023-06-201-0/+4
| | | | | | This was probably lost during a rebase. Signed-off-by: Simon Ser <contact@emersion.fr>
* server: use bool in struct fieldsSimon Ser2023-05-301-8/+8
| | | | | | | | | | Use bool instead of int for boolean values, to make it more explicit what the field contains. For instance "error" is not to be confused with an error code. This is all private API. Signed-off-by: Simon Ser <contact@emersion.fr>
* protocol: refer to wl_surface.offset in set_cursorSimon Ser2023-05-231-2/+2
| | | | | | | | The offset in wl_surface.attach has been superseded by wl_surface.offset. Refer to the new request instead of using the deprecated one. Signed-off-by: Simon Ser <contact@emersion.fr>
* protocol: specify the exact form of premultiplicationSebastian Wick2023-05-091-2/+2
| | | | | | | | | | | | | | | There are two ways to do pre-multiplication of the alpha channel into the color channels: on optical values or on electrical values. While pre-multiplication with optical values is arguably more correct, because operations like blending or scaling require pre-multiplied, optical color channels, wayland and compositors by default work with pre-multiplied electrical values. This is most likely a convention that Wayland took from Cairo. This commit makes sure that the expectation of pre-multiplied electrical values is properly documented. Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
* build: override wayland-scanner depSimon Ser2023-05-091-0/+3
| | | | | | This allows a parent project to find wayland-scanner. Signed-off-by: Simon Ser <contact@emersion.fr>
* server: stop wl_display_run() on dispatch errorSimon Ser2023-05-091-1/+3
| | | | | | | If wl_event_loop_dispatch() fails, we could enter an infinite loop, repeatedly calling a failing wl_event_loop_dispatch() forever. Signed-off-by: Simon Ser <contact@emersion.fr>
* util: simplify wl_fixed_to_double()Simon Ser2023-05-091-8/+1
| | | | | | | | We can just use a simple division instead of bit operations with magic numbers. Readability matters more than performance here. References: https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/296 Signed-off-by: Simon Ser <contact@emersion.fr>
* event-loop: optimize timer check logicYang Wang2023-05-031-1/+3
| | | | | | | the 'has_timers' flag can be returned directly without having to track all the ready events when a timer is found ready. Signed-off-by: Yang Wang <KevinYang.Wang@amd.com>
* tests: drop misleading fixed-benchmarkManuel Stoeckl2023-05-032-116/+0
| | | | | | | | | | | Because this benchmark performed wl_fixed_to_double conversions on a long sequence of consecutive integers, the compiler could optimize away the addition performed in wl_fixed_to_double, merging it with the loop iteration code. This made tests/fixed-benchmark.c significantly underestimate the actual cost of the current wl_fixed_to_double implementation. Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
* protocol: add new shm formatsManuel Stoeckl2023-05-031-0/+15
| | | | | | This brings the format list up to date with libdrm 2.4.115. Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
* event-loop: Handle EINTR and EAGAIN in wl_event_loop_dispatchJoshua Ashton2023-05-021-1/+76
| | | | | | | | | | | This fixes an issue where it was not possible to start Gamescope under GDB on some setups. https://github.com/ValveSoftware/gamescope/issues/743 Any signals would cause epoll_wait to return -1 and set errno to EINTR. This also handles the EAGAIN case like the other polling loops in libwayland. Signed-off-by: Joshua Ashton <joshua@froggi.es>
* protocol: improve wl_keyboard focus documentationXaver Hugl2023-04-121-2/+15
| | | | | | | | The compositor must not send any key events while a surface is not focused, but in order to allow for common actions like ctrl+scroll for zooming to work with unfocused surfaces it may do so with modifiers. Signed-off-by: Xaver Hugl <xaver.hugl@gmail.com>
* protocol: disallow re-using wl_data_sourceSimon Ser2023-04-041-0/+9
| | | | | | | | | | | | As pointed out in [1], re-using a wl_data_source for multiple start_drag or set_selection requests has bad consequences, because this object has events that allo tracking the state of a selection/drag-and-drop operation. Tracking two operations at the same time isn't possible with this interface. [1]: https://lists.freedesktop.org/archives/wayland-devel/2019-January/039936.html Signed-off-by: Simon Ser <contact@emersion.fr> Signed-off-by: Daniel Stone <daniels@collabora.com>
* build: re-open main branch for regular developmentSimon Ser2023-04-041-1/+1
|
* build: bump to version 1.22.0 for the official release1.22.0Simon Ser2023-04-041-1/+1
|
* build: bump to version 1.21.93 for the RC1 release1.21.93Simon Ser2023-03-281-1/+1
|
* Add a .mailmap fileFaith Ekstrand2023-03-251-0/+3
| | | | | | | | | This will let command-line Git tools re-map my name and e-mail address properly. I'm using my personal e-mail address and not my Collabora address because I'm not actively contributing to Wayland anymore and this is mostly for letting people find me should they dig me up in the project history. Signed-off-by: Faith Ekstrand <faith@gfxstrand.net>
* build: bump version to 1.21.92 for the beta release1.21.92Simon Ser2023-03-161-1/+1
|
* client: fix wl_display_disconnect() documentationSimon Ser2023-03-071-2/+3
| | | | | Signed-off-by: Simon Ser <contact@emersion.fr> Closes: https://gitlab.freedesktop.org/wayland/wayland/-/issues/361
* client: Do not warn about attached proxies on default queue destruction.Alexandros Frantzis2023-03-012-6/+71
| | | | | | | | | | | | | | If the default queue is being destroyed, the client is disconnecting from the wl_display, so there is no possibility of subsequent events being queued to the destroyed default queue, which is what this warning is about. Note that interacting with (e.g., destroying) a wl_proxy after its wl_display is destroyed is a certain memory error, and this warning will indirectly warn about this issue. However, this memory error should be detected and warned about through a more deliberate mechanism. Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
* build: bump version to 1.21.91 for the alpha release1.21.91Simon Ser2023-02-281-1/+1
|
* client: Abort when trying to add an event to a destroyed queueAlexandros Frantzis2023-02-282-0/+66
| | | | | | | | | | Detect when we are trying to add an event to a destroyed queue, and abort instead of causing a use-after-free memory error. This situation can occur when an wl_event_queue is destroyed before its attached wl_proxy objects. Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
* tests: Support tests that check for client failureAlexandros Frantzis2023-02-282-3/+21
| | | | | | | | Add the display_destroy_expect_signal() function to check that test clients exit due to a particular signal. This is useful for checking that clients fail in an expected way. Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
* client: Warn when a queue is destroyed with attached proxiesAlexandros Frantzis2023-02-282-0/+109
| | | | | | | Log a warning if the queue is destroyed while proxies are still attached, to help developers debug and fix potential memory errors. Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
* tests: Capture the test client logAlexandros Frantzis2023-02-283-2/+104
| | | | | | | Capture the test client log to a temporary fd, so that is accessible by both the test server process and the test client process. Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
* client: Track the proxies attached to a queueAlexandros Frantzis2023-02-281-0/+22
| | | | | | | | Maintain a list of all wl_proxy objects that are attached to a wl_event_queue. We will use this information in upcoming commits to warn about improper object destruction order that can lead to memory errors. Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
* shm: fix segfault when accessing destroyed pool resourceSimon Ser2023-02-271-4/+6
| | | | | | | | | | | With wl_shm_buffer_ref_pool(), it's possible for a wl_shm_pool to outlive its wl_resource. We need to be careful not to access wl_shm_pool.resource if it's been destroyed. Reset resource to NULL in the resource destroy handler, and add NULL checks. Signed-off-by: Simon Ser <contact@emersion.fr>
* protocol: Clarify meaning of input region for cursors, DnD iconsMikhail Gusarov2023-02-271-10/+5
| | | | | | | | Input region is ignored for cursors, DnD icons. Current wording implies that this state is temporary, but surfaces never lose the role once assigned, so reword to make it clearer. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
* protocol: reorder wl_data_offer.source_actions and wl_data_device.enterVlad Zahorodnii2023-02-271-2/+3
| | | | | | | | | | | | | | | | | | | Most compositors send the wl_data_offer.source_actions event before the wl_data_device.enter event, i.e. after creation of the data offer. This contradicts to the wayland spec. On the other hand, it's reasonable to send all the information useful to the client before the enter event, rather than send mime types before the enter event and source actions (that don't depend on drop target) after the enter event. On the client side, toolkits such as Qt and GTK already expect to see the source actions before receiving the enter event. Given all of that, this change adjusts the spec to match the behavior observed in the compositors in the wild. Signed-off-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
* protocol: do not change pending x and y when attaching a bufferSebastian Wick2023-02-271-2/+3
| | | | | | | | | | | Attaching a buffer with interface version 5 requires clients to pass zero to x and y but it still affects the pending surface state. Attaching a buffer after a request to offset therefore sets the pending x and y to zero. The intent of version 5 was to allow exactly this sequence of requests to work so let's just make sure the protocol actually spells it out. Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
* protocol: add wl_pointer's axis relative physical directionPeter Hutterer2023-02-211-4/+60
| | | | | | | | | | | | This event adds the physical direction of the axis motion, relative to the axis event we get. Right now, when natural scrolling is enabled things like virtual volume sliders move the wrong way round. By adding the axis motion direction, we can have toolkits swap the scroll direction for applicable widgets, getting the right behavior on all widgets. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
* readme: convert to MarkdownSimon Ser2023-02-131-1/+1
| | | | | | Gives us nice links and code blocks. Signed-off-by: Simon Ser <contact@emersion.fr>
* readme: reword website descriptionSimon Ser2023-02-131-3/+3
| | | | | | | | The website is most useful for docs. Build instructions have been mostly dropped from it: they're better described in downstream projects' READMEs. Signed-off-by: Simon Ser <contact@emersion.fr>
* readme: drop paragraph about WestonSimon Ser2023-02-131-4/+0
| | | | | | There are many Wayland compositors nowadays. Signed-off-by: Simon Ser <contact@emersion.fr>