aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* doc: validate doc XML againHEADmainPekka Paalanen3 days1-1/+0
| | | | | | | Now that all XML validation errors have been fixed, it is time to turn the validation back on to make sure the errors stay out. Signed-off-by: Pekka Paalanen <pq@iki.fi>
* doc/xsl: rearrange member doc generationPekka Paalanen3 days1-13/+18
| | | | | | | | | | | | | | | | | | | | Creating an empty <variablelist> is illegal. This can already be seen in the XSL anywhere it is generated. The used XSL programming pattern requires the look-up conditions to be repeated between the <xsl:if> and <xsl:apply-templates> tags. Usually this is not a problem, but the conditions for memberdef is too much to copy around. The conditions between the if and the apply-templates have already diverged, causing validation errors (that are currently suppressed). Rearrange the XSL so that the applicable memberdef are stored in a variable, so that both the if and the apply-templates operate on the exact same set of matches. This avoids emitting empty <variablelist>. As a result, the members of structures wl_argument, wl_interface, wl_message, and wl_listener newly appear in the documentation. Signed-off-by: Pekka Paalanen <pq@iki.fi>
* server: document listener fields and a vfuncPekka Paalanen3 days1-0/+4
| | | | | | | | Adding these simple documentation comments allows us to have meaningful link targets in the generated API documentation. That will help getting rid of broken links which cause XML validation to fail. Signed-off-by: Pekka Paalanen <pq@iki.fi>
* build/doc: explain two XML conversionsPekka Paalanen3 days1-4/+8
| | | | | | | | | | Now that I figured out what these do, I might as well add comments about it for others. The target names are changed to be more descriptive of what the target does. Signed-off-by: Pekka Paalanen <pq@iki.fi>
* doc/xsl: include static inline functionsPekka Paalanen3 days1-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When generating documentation, xmllint complained: element link: validity error : IDREF attribute linkend references an unknown ID "Server-structwl__signal_1afe73f44f7f1b517c9c0ba90829c93309" element link: validity error : IDREF attribute linkend references an unknown ID "Server-structwl__signal_1afe73f44f7f1b517c9c0ba90829c93309" element link: validity error : IDREF attribute linkend references an unknown ID "Server-structwl__signal_1aa8bcd3b8e250cfe35ed064d5af589096" These were referring to wl_signal_add() and wl_signal_emit() I think, which are static inlines in a public header. The XSLT ignored static functions, probably assuming that they cannot be public API. Internal (static) functions are present in the Doxygen XML, so they do need to be excluded. Now we include static functions if their body is in a header. We de not scan private headers, so they must be public API. Comparing the final generated HTML documentation, these functions are added to both Client and Server APIs: wl_fixed_to_double wl_fixed_from_double wl_fixed_to_int wl_fixed_from_int These functions are added to the Server API: wl_signal_init wl_signal_add wl_signal_get wl_signal_emit Signed-off-by: Pekka Paalanen <pq@iki.fi>
* doc: fix Xwayland image validityPekka Paalanen3 days1-7/+5
| | | | | | | | | | | | | | | | xmllint complained: element imageobjectco: validity error : Element imageobjectco content does not follow the DTD, expecting (areaspec , imageobject , calloutlist*), got (imageobject ) This image has no callouts (clickable items explained in the text), so it must not use the tags that assume callouts. I probably cargo-culted this from the X11 and Wayland diagrams which have callouts when writing Xwayland.xml. Signed-off-by: Pekka Paalanen <pq@iki.fi>
* server: fix wl_signal_add Doxygen warningPekka Paalanen3 days1-1/+1
| | | | | | | | | | | | | | $ meson compile -C build -v xml-Server-doc INFO: autodetecting backend as ninja INFO: calculating backend command to run: /usr/bin/ninja -C /home/pq/git/wayland/build -v doc/doxygen/xml/Server/combine.xslt doc/doxygen/xml/Server/index.xml ninja: Entering directory `/home/pq/git/wayland/build' [1/1] /home/pq/git/wayland/doc/doxygen/gen-doxygen.py --builddir=doc/doxygen/xml/Server --section=Server --output-format=xml doc/doxygen/wayland.doxygen ../doc/doxygen/../../src/wayland-util.h ../doc/doxygen/../../src/event-loop.c ../doc/doxygen/../../src/wayland-server.c ../doc/doxygen/../../src/wayland-server.h ../doc/doxygen/../../src/wayland-server-core.h ../doc/doxygen/../../src/wayland-shm.c /home/pq/git/wayland/src/wayland-server-core.h:394: warning: explicit link request to 'wl_signal_add' could not be resolved I don't know why, but the "explicit link" mark-up fails, while the automatic link mark-up works. This warning disappears. Signed-off-by: Pekka Paalanen <pq@iki.fi>
* doc: reinstate image mapsPekka Paalanen3 days2-5/+14
| | | | | | | | This fixes the errors during the compilation of Architecture.xml that the .map files cannot be found. As a result, the architure diagrams become clickable in the HTML document once again. Signed-off-by: Pekka Paalanen <pq@iki.fi>
* doc/xsl: fix malformed <variablelist>Pekka Paalanen3 days1-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | For all requests and events that do not have any arguments, enabling XML validation would lead to many errors like this: /home/pq/git/wayland/build/doc/publican/Wayland.xml:5287: element variablelist: validity error : Element variablelist content does not follow the DTD, expecting (blockinfo? , (title , titleabbrev?)? , (caution | important | note | tip | warning | literallayout | programlisting | programlistingco | screen | screenco | screenshot | synopsis | cmdsynopsis | funcsynopsis | classsynopsis | fieldsynopsis | constructorsynopsis | destructorsynopsis | methodsynopsis | formalpara | para | simpara | address | blockquote | graphic | graphicco | mediaobject | mediaobjectco | informalequation | informalexample | informalfigure | informaltable | anchor | bridgehead | remark | highlights | abstract | authorblurb | epigraph | indexterm | beginpage)* , varlistentry+), got The reason is that a <variablelist> without any <varlistentry> inside it is illegal. If there are no <arg> at all, do not emit the list paragraph. Signed-off-by: Pekka Paalanen <pq@iki.fi>
* doc: remove HTML_TIMESTAMPPekka Paalanen3 days1-1/+0
| | | | | | | | | | | | to fix the Doxygen message: warning: Tag 'HTML_TIMESTAMP' at line 8 of file '-' has become obsolete. To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u" Observed with Doxygen 1.9.8. Signed-off-by: Pekka Paalanen <pq@iki.fi>
* editorconfig: indent .xsl with 2 spacesPekka Paalanen3 days1-0/+5
| | | | | | | | | | | | | The XSL files are mostly indented with 2 spaces. Using the default editorconfig rules in VSCode constantly tries to mix in tabs. Add the 2-space rule for .xsl files to fix this. The .xsl files, like .xml files, use a tab character in place of 8 spaces. This complicates things, and the new rule will prefer just spaces. To keep the existing sometimes-tab-indented code looking right, the tab width must be explicitly set to 8. Signed-off-by: Pekka Paalanen <pq@iki.fi>
* tests/event-loop-test: Remove event loop timer testJoshua Watt2025-12-121-43/+0
| | | | | | | | | The event loop timer test has very precise sequencing and timing constraints, which make it difficult to pass reliably on loaded systems. Since this test isn't providing much value, remove it to prevent the erroneous errors. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
* doc: Refactor the build system for complete build dir docsSebastian Wick2025-11-2738-164/+138
| | | | | | | | By structuring things differently, it becomes possible to have a complete build of the docs in the build dir, without having to install anything. Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
* build: Bump to meson version 0.64.0Sebastian Wick2025-11-273-11/+8
| | | | | | | | | | | | | | | | This version will be required in the next commit. Bumps the CI image to get the required version from the debian package instead of from pip. Removes the bindir builtin directory from pkgconfig.generate() which is deprecated since 0.62.0. It will be automatically included when referenced. Use `meson setup` everywhere instead of relying on deprecated automatic detection of the setup command. Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
* protocol: add new formatsJulian Orth2025-11-261-0/+20
| | | | | | Generated from libdrm 2.4.129. Signed-off-by: Julian Orth <ju.orth@gmail.com>
* client: add wl_display_dispatch_pending_singleIsaac Freund2025-09-163-0/+151
| | | | | | | | | | | | | | | | | | | | | | | | | As well as wl_display_dispatch_queue_pending_single. The motivation is writing libwayland bindings for a dynamic language with exceptions/non-local returns. Since it is invalid for a wl_dispatcher_func_t callback provided to libwayland to not return, there is no way to prevent dispatching of further events in the case of an exception in the dynamic language event handler. Furthermore, since creating/destroying Wayland objects in an event handler affects the dispatching of subsequent events by libwayland, it is not possible to collect Wayland events in a queue outside libwayland and dispatch them one-by-one after wl_display_dispatch_pending() returns. Adding libwayland API to dispatch at most one pending event solves this problem cleanly. The bindings can have libwayland dispatch a single event, wait for wl_display_dispatch_pending_single() to return, run the dynamic language event handler (which may longjmp away), and continue the loop for as long as there are more events to dispatch. References: https://codeberg.org/ifreund/janet-wayland Signed-off-by: Isaac Freund <mail@isaacfreund.com>
* connection: Add a thread ID to WAYLAND_DEBUG output.Kyle Brenneman2025-09-152-0/+18
| | | | | | | | | | | | | | | | If WAYLAND_DEBUG contains the token "thread_id", and gettid() is available, then include the current thread ID in the output from wl_closure_print. If multiple threads are sending requests, then those requests can get interleaved. That's usually fine, but for wl_surface requests and commits, that can cause problems ranging from incorrect behavior to protocol errors. Being able to see which requests are sent by different threads would make such problems much easier to diagnose. Signed-off-by: Kyle Brenneman <kbrenneman@nvidia.com>
* connection: Add a function to parse WAYLAND_DEBUG tokensKyle Brenneman2025-09-154-2/+47
| | | | | | | | | | | | | | | Add a new function, wl_check_env_token, to scan for a token in a comma-separated string. Change wl_display_create in wayland-server.c and wl_display_connect_to_fd in wayland-client.c to use that instead of a simple substring search. This means that WAYLAND_DEBUG will accept a value like "client,server" but not "clientserver". But, this will make it easier to add other tokens without worrying about overlap between them. Signed-off-by: Kyle Brenneman <kbrenneman@nvidia.com>
* cursor: Free theme when size check fails to avoid memory leakYaoBing Xiao2025-08-031-3/+3
| | | | Signed-off-by: YaoBing Xiao <xiaoyaobing@uniontech.com>
* ci: upgrade FreeBSD to 14.3ykla2025-07-201-3/+3
| | | Signed-off-by: ykla yklaxds@gmail.com
* ci: upgrade FreeBSD to 14.2ykla2025-06-251-3/+3
| | | | Signed-off-by: ykla <yklaxds@gmail.com>
* build: re-open main branch for regular developmentSimon Ser2025-06-211-1/+1
| | | | Signed-off-by: Simon Ser <contact@emersion.fr>
* connection: Do not busy-loop if a message exceeds the buffer sizeDemi Marie Obenour2025-06-214-0/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the length of a message exceeds the maximum length of the buffer, the buffer size will reach its maximum value and stay there forever, with no message ever being successfully processed. Since libwayland uses level-triggered epoll, this will cause the compositor to loop forever and consume CPU time. In libwayland 1.22 and below, there was an explicit check that caused messages exceeding 4096 bytes to result in an EOVERFLOW error, preventing the loop. However, this check was removed between d074d5290263 ("connection: Dynamically resize connection buffers"). To prevent this problem, always limit the size of messages to 4096 bytes. Since the default and minimum buffer size is 4096 bytes, this ensures that a single message will always fit in the buffer. It would be possible to allow larger messages if the buffer size was larger, but the maximum size of a message should not depend on the buffer size chosen by the compositor. Rejecting messages that exceed 4092 bytes seems to have the advantage of reserving 4 bits, not 3, in the size field for future use. However, message sizes in the range [0x0, 0x7] are invalid, so one can obtain a fourth bit by negating the meaning of bit 12 if bits 0 through 11 (inclusive) are 0. Allowing 4096-byte messages provides the far more important advantage that regressions compared to 1.22 are impossible and regressions compared to 1.23 are extremely unlikely. The only case where a regression is possible is: - The receiving side is using libwayland 1.23. - The sending side is either using libwayland 1.23 or is not using libwayland. - The sender sends a message exceeding 4096 bytes. - If the sender of the large message is the client, the server has increased the buffer size from the default value. This combination is considered extremely unlikely, as libwayland 1.22 and below would disconnect upon receiving such a large message. 4096-byte messages, however, have always worked, so there was no reason to avoid sending them. Fixes: d074d5290263 ("connection: Dynamically resize connection buffers"). Fixes: #494 Signed-off-by: Demi Marie Obenour <demi@invisiblethingslab.com>
* doc: add a section on color managementPekka Paalanen2025-06-123-0/+141
| | | | | | | | I think the docbook deserves an introduction to how color management is designed in Wayland, aimed at people who are familiar with pixels but new to the topic. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
* egl: Make `wayland-egl symbols check` depend on `wayland_egl`1.23.92Matt Turner2025-06-081-0/+1
| | | | | Closes: https://gitlab.freedesktop.org/wayland/wayland/-/issues/515 Signed-off-by: Matt Turner <mattst88@gmail.com>
* tests: Depend on exec-fd-leak-checkerMatt Turner2025-06-081-2/+5
| | | | | Closes: https://gitlab.freedesktop.org/wayland/wayland/-/issues/514 Signed-off-by: Matt Turner <mattst88@gmail.com>
* tests: Add support for specifying runtime dependenciesMatt Turner2025-06-081-0/+2
| | | | Signed-off-by: Matt Turner <mattst88@gmail.com>
* tests: Make `tests` dict elements dicts themselvesMatt Turner2025-06-081-64/+97
| | | | | | | Previously each value was a list of extra sources. The next commit will add an additional field to each test, so they need to be dicts themselves. Signed-off-by: Matt Turner <mattst88@gmail.com>
* doc: Further explain typical display socket lookupManuel Stoeckl2025-06-081-1/+3
| | | | | | | | This change mentions the case where WAYLAND_SOCKET is used, which helps people avoid just testing 'getenv(WAYLAND_DISPLAY)' to see if a Wayland compositor is available; Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
* server: Document wl_display_add_socket_autoManuel Stoeckl2025-06-081-0/+18
| | | | | | The exact sequence of names tried has de facto become part of the API. Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
* cursor: Properly check realloc for errorsTobias Stoeckmann2025-06-081-6/+7
| | | | | | | Do not override realloc's input pointer before checking for errors, otherwise it's not possible to keep old value, as intended. Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
* cursor: Ignore invalid cursor filesTobias Stoeckmann2025-06-081-0/+2
| | | | | | | The header offset must not be smaller than file header length. Ignore such invalid files. Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
* cursor: Gracefully handle huge cursor filesTobias Stoeckmann2025-06-081-2/+12
| | | | | | | | | | If cursor files require more than INT_MAX bytes, it is possible to trigger out of boundary writes. Since these sizes are most likely not desired anyway, gracefully handle these situations like out of memory errors. Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
* cursor: Gracefully handle out of memory conditionTobias Stoeckmann2025-06-081-1/+5
| | | | | | | If the full path could not be constructed, avoid calling opendir(NULL) which, depending on library, might trigger undefined behavior. Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
* cursor: Fix undefined behavior with huge namesTobias Stoeckmann2025-06-081-1/+1
| | | | | | | | | | | If an index.theme contains a theme name which gets close to INT_MAX, then creation of full path can lead to a signed integer overflow, which is undefined behavior. Fix this by turning one of the values to size_t. Easy solution for a probably never occurring issue. Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
* client: fix conversion specifier in the discarded event log messageKirill Primak2025-06-011-1/+1
| | | | Signed-off-by: Kirill Primak <vyivel@eclair.cafe>
* debug: Colorize output for easier readingCaitlyn2025-06-014-18/+69
| | | | Signed-off-by: Caitlyn <caitlynrosestewart@gmail.com>
* connection: fix segfault in wl_closure_invoke()Caitlyn Stewart2025-05-271-0/+5
| | | | Signed-off-by: Caitlyn Stewart <caitlynrosestewart@gmail.com>
* build: bump version to 1.23.90 for the RC1 release1.23.91Simon Ser2025-05-221-1/+1
| | | | Signed-off-by: Simon Ser <contact@emersion.fr>
* protocol: drop reference to linux-explicit-synchronizationSimon Ser2025-05-201-1/+2
| | | | | | | | This protocol has been superseded. Replace this outdated reference with a generic hint that protocol extensions may provide this functionality. Signed-off-by: Simon Ser <contact@emersion.fr>
* Fix typosTobias Stoeckmann2025-05-204-6/+6
| | | | | | Typos found with codespell and during code audit. Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
* server: add wl_resource_get_interface()Isaac Freund2025-05-202-0/+17
| | | | | | | This is useful for the wayland bindings/scanner I'm working on for a dynamically typed language. Signed-off-by: Isaac Freund <mail@isaacfreund.com>
* client: add wl_proxy_get_interface()Isaac Freund2025-05-202-0/+17
| | | | | | | This is useful for the wayland bindings/scanner I'm working on for a dynamically typed language. Signed-off-by: Isaac Freund <mail@isaacfreund.com>
* protocol: Clarify sending of wl_seat.capabilitiesDavid Edmundson2025-05-201-6/+7
| | | | | | | | | | | It wasn't explicitly stated that wl_seat.capabilities should also be sent on bind. Everyone did because it was obviously sensible. This also clarifies that static seat name should be sent before announcing capabilities so clients can associate these devices with the right seat name. Signed-off-by: David Edmundson <davidedmundson@kde.org>
* shm: linkify function references in docsSimon Ser2025-05-201-8/+8
| | | | | | | Parentheses make it so the generated HTML documentation contains links, which makes navigation easier. Signed-off-by: Simon Ser <contact@emersion.fr>
* shm: fix comment about wl_shm_buffer_begin_access() safetySimon Ser2025-05-201-1/+1
| | | | | | | The paragraph later says that accessing different buffers is allowed. The function checks whether the same pool is accessed. Signed-off-by: Simon Ser <contact@emersion.fr>
* shm: Generate an error when shm access failed even without a resourceSebastian Wick2025-05-201-0/+26
| | | | Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
* shm: Add wl_shm_buffer ref and unref functionsSebastian Wick2025-05-202-5/+79
| | | | | | | | | | | | | | | Shared memory buffers are currently tied to the lifetime of their underlying wl_buffer resource. This becomes problematic when the client destroys the resource after committing new state which references the wl_buffer because a compositor might have to defer applying the commit. This commit adds methods to keep the wl_shm_buffer alive longer than the underlying resource. This implicitly also keeps the buffer pool alive and because the wl_shm_buffer uses offsets into the pool, it even works when the underlying storage gets remapped somewhere else, which can happen when the client resizes the pool. Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
* shm: Remove refcount check which cannot be triggeredSebastian Wick2025-05-201-7/+2
| | | | | | | | | If the pool refcount reaches zero, it is freed, so accessing its members is UB which ASan would catch. Also simplify check for negative refcounts. Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
* shm: Linkify wl_shm_pool_unref in the ref_pool documentationSebastian Wick2025-05-201-1/+1
| | | | Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>