aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* protocol: Clarify wl_buffer.release descriptionMichel Dänzer2025-03-151-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | Sebastian pointed out that the existing text could be read as wl_buffer.destroy not being allowed before the wl_buffer.release event arrives, contrary to what the wl_surface.attach description says. Clarify to be consistent with the latter. This is a follow-up for https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/141 . Signed-off-by: Michel Dänzer <mdaenzer@redhat.com> v2: * Simplify clarification, don't talk about callbacks. (Julian Orth) * Add reference to details in the description of wl_surface.attach. (Daniel Stone) v3: * Tweak clarification again. (Sebastian Wick) v4: * Make clarification even less ambiguous. (Simon Ser, Julian Orth) v5: * Just refer to the description of wl_surface.attach instead of trying to clarify anything here. (Sebastian Wick)
* client: document get_listener behavior for dispatchersJulian Orth2025-03-151-0/+3
| | | | | | | | | | | This seems to have been the case since 2013. This is useful for wrappers that need two pointers to identify proxies. One pointer (stored in the user data) pointing to a singleton object to identify that the proxy has a known structure. And one pointer (stored in the dispatcher data) pointing to per-proxy data. Signed-off-by: Julian Orth <ju.orth@gmail.com>
* scanner: use separate guards for validator functionsSimon Ser2025-02-234-31/+151
| | | | | | | | | | | | | | Generated XXX_is_valid() functions for enums are guarded behind the same #define as the enum itself. This worked fine until recently, but since fbd7460737c9 ("scanner: add new enum-header mode") we're also generating enum-only headers. When including the enum-only header first, and then the server header, the validator functions are missing. Define a separate guard to fix this. Signed-off-by: Simon Ser <contact@emersion.fr>
* Forward declarate timespec structVlad Zahorodnii2025-02-061-1/+2
| | | | | | | The `timespec` struct is defined in `time.h` header but only if `_POSIX_C_SOURCE` is set or when using the C11 standard. Signed-off-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
* Also use [[deprecated]] when compiling with at least C++14David Redondo2025-02-051-1/+1
| | | | Signed-off-by: David Redondo <kde@david-redondo.de>
* Make wayland-util.h -Wundef safe when compiled by a C++ compilerDavid Redondo2025-02-051-2/+2
| | | | | Fixes #522 Signed-off-by: David Redondo <kde@david-redondo.de>
* build: Add -lm to pkg-config dependenciesDaniel Stone2025-02-051-0/+2
| | | | | | | | | Now that wl_fixed_from_double() calls round() from a function declared in a header, our users need to explicitly pick that dependency up in order to avoid build errors. Signed-off-by: Daniel Stone <daniels@collabora.com> Closes: wayland/weston#991
* tests: Add dispatch timeout testsSebastian Wick2025-02-041-0/+87
| | | | | | | | | | | Add tests which verify that... * wl_display_dispatch_timeout with a big enough timeout behaves the same as wl_display_dispatch * wl_display_dispatch_timeout will time out when there are no messages to dispatch Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
* client: Add wl_display_dispatch_timeoutSebastian Wick2025-02-042-0/+13
| | | | | | A variant of wl_display_dispatch_queue_timeout for the default queue. Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
* client: Add wl_display_dispatch_queue_timeoutSebastian Wick2025-02-042-34/+127
| | | | | | | | | | | For dispatching messages on a queue with a timeout. This slightly changes the samantics of wl_display_dispatch. Previously it was possible for it to return even though there wasn't a single dispatched event. The function correctly returned 0 in this case but it is now used to indicate a timeout. Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
* event-loop: Use timespec utils instead of hand-rolling our ownSebastian Wick2025-02-041-54/+7
| | | | Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
* timespec: Implement saturating timespec substractionSebastian Wick2025-02-041-0/+18
| | | | Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
* timespec: Pull in timespec_after and timespec_add from mesaSebastian Wick2025-02-041-0/+34
| | | | Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
* timespec: Pull in timespec.h from westonSebastian Wick2025-02-041-0/+259
| | | | Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
* server: add const qualifier to function arguments where possibleSebastian Wick2025-01-223-18/+19
| | | | | | | Makes it possible to e.g. `call wl_client_get_credentials` with a `const struct wl_client *` from a global filter callback. Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
* ci: Update ci-templatesDaniel Stone2025-01-211-3/+3
| | | | | | | This includes an explicit way to specify the container architecture, which fixes our rebuilds on ARMv7. Signed-off-by: Daniel Stone <daniels@collabora.com>
* util: reduce error of wl_fixed_from_double()Haihua Hu2025-01-091-1/+1
| | | | | | | | when cast double to fixed pointer, there will be big error, eg 1919.9998 to 1919. Call round before cast to get nearest value 1920 of 1919.9998 Signed-off-by: Haihua Hu <jared.hu@nxp.com>
* connection: Fix wrong format stringDemi Marie Obenour2024-11-301-1/+1
| | | | | | | Prevents undefined behavior if there is not enough space in the buffer for a queued message. Signed-off-by: Demi Marie Obenour <demi@invisiblethingslab.com>
* tests: Avoid calling function with wrong typeDemi Marie Obenour2024-11-303-11/+23
| | | | | | | | | Calling a function with the wrong type is immediate undefined behavior, even if the ABI says it should be harmless. UBSAN picks it up immediately, and any decent control-flow integrity mechanism will as well. Signed-off-by: Demi Marie Obenour <demi@invisiblethingslab.com>
* connection: Avoid undefined pointer arithmeticDemi Marie Obenour2024-11-291-4/+4
| | | | | | | | | | Creating a pointer that is more than one element past the end of an array is undefined behavior, even if the pointer is not dereferenced. Avoid this undefined behavior by using `p >= end` instead of `p + 1 > end` and `SOMETHING > end - p` instead of `p + SOMETHING > end`. Signed-off-by: Demi Marie Obenour <demi@invisiblethingslab.com>
* protocol: add wl_fixes interfaceJulian Orth2024-11-181-0/+27
| | | | | | | | | | | | | | | | | This commit describes a new wl_fixes interface that can be used to destroy wl_registry objects. Users of libwayland-client should use it as follows: - call wl_fixes_destroy_registry(registry) - call wl_registry_destroy(registry) Users of libwayland-server should, in their implementation of the request, call wl_resource_destroy(registry). It should be similar in other protocol implementations. Signed-off-by: Julian Orth <ju.orth@gmail.com>
* cursor: add check to ensure wl_shm_create_pool succeededYaoBing Xiao2024-10-181-0/+5
| | | | Signed-off-by: YaoBing Xiao <xiaoyaobing@uniontech.com>
* protocol: document that wl_surface.offset is role-specificSimon Ser2024-10-051-0/+3
| | | | | | | | This request doesn't make sense for all surface roles. For instance, for maximized/tiled/fullscreen xdg_toplevel, for xdg_popup, for layer-shell surfaces, etc. Signed-off-by: Simon Ser <contact@emersion.fr>
* Add wl_keyboard key repeat eventsAndri Yngvason2024-09-231-4/+18
| | | | | | | This allows the compositor to take over the responsibility of repeating keys. Signed-off-by: Andri Yngvason <andri@yngvason.is>
* protocol: clients should not emulate key-press events on enterJulian Orth2024-09-101-0/+3
| | | | | | | The previous change introducing the logical state caused some confusion. Clarify that most application should not use the list of pressed keys. Signed-off-by: Julian Orth <ju.orth@gmail.com>
* connection: Reject strings containing NUL bytesDemi Marie Obenour2024-08-182-2/+11
| | | | | | | | | | | | libwayland cannot construct these messages as it uses strlen() to determine string lengths. libwayland is also guaranteed to misinterpret these messages, since message handlers only get a pointer and no length. Therefore, reject strings containing NUL bytes. Also remove a redundant check from the unmarshalling code. The zero-length case has already been checked for. Signed-off-by: Demi Marie Obenour <demi@invisiblethingslab.com>
* meson: Fix use of install_data() without specifying install_dirJoaquim Monteiro2024-08-151-1/+3
| | | | | | | This was broken (when in a subproject) before Meson 1.3.0, and so Meson warns against this unless the project targets 1.3.0 or newer. Signed-off-by: Joaquim Monteiro <joaquim.monteiro@protonmail.com>
* client: Log the object and methods when marshalling or sending failsFangzhou Ge2024-08-121-2/+6
| | | | | | | | | The log that appears before a display_error can be captured as crash signature. Useful to know what it is. This is cherry-picked from chromium https://crrev.com/c/4697877 Signed-off-by: Fangzhou Ge <fangzhoug@chromium.org>
* ci: use detached MR pipelinesSimon Ser2024-08-091-0/+7
| | | | | | | | | See the freedesktop wiki [1]. This allows external contributors to have CI run properly. [1]: https://gitlab.freedesktop.org/freedesktop/freedesktop/-/wikis/GitLab-CI#for-project-developers Signed-off-by: Simon Ser <contact@emersion.fr>
* src: Finish assert() clean-upDerek Foreman2024-08-096-7/+2
| | | | | | | | | | | | | From cleanup commit 0cecde304: assert()s can be compiled away by #defining NDEBUG. Some build systems do this. Using wl_abort gives a human readable error message and it isn't compiled away. That commit missed one final assert, presumably due to missing it with grep because of a coding style issue. Fix that up, and remove inclusion of <assert.h> as appropriate. Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
* doc: Require strings to be UTF-8Sebastian Wick2024-08-091-3/+3
| | | | | | | Nothing checks this yet but this gives us the opportunity to do so when we want. Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
* server: expose wl_resource_post_error_vargs()Kirill Primak2024-08-092-2/+14
| | | | Signed-off-by: Kirill Primak <vyivel@eclair.cafe>
* server: add wl_resource_post_error() docsKirill Primak2024-08-092-1/+9
| | | | Signed-off-by: Kirill Primak <vyivel@eclair.cafe>
* Put WL_DEPRECATED in front of the function declarationsKirill Primak2024-08-093-11/+22
| | | | | | | | | | | | | This fixes the following clang error when using C23: ../src/wayland-server-core.h:680:41: error: 'deprecated' attribute cannot be applied to types 680 | int32_t stride, uint32_t format) WL_DEPRECATED; | ^ ../src/wayland-util.h:52:25: note: expanded from macro 'WL_DEPRECATED' 52 | #define WL_DEPRECATED [[deprecated]] | ^ Signed-off-by: Kirill Primak <vyivel@eclair.cafe>
* client: Handle proxies with no queueSebastian Wick2024-07-261-1/+5
| | | | | | | | | wl_proxy_get_queue can return NULL if the queue of the proxy was already destroyed with wl_event_queue_destroy. In this case, the queue also has no name anymore. Fixes: b42218f ("client: Allow setting names for queues") Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
* src: switch asserts to wl_abortmeltq2024-07-115-16/+36
| | | | | | | | assert()s can be compiled away by #defining NDEBUG. Some build systems do this. Using wl_abort gives a human readable error message and it isn't compiled away. This commit closes issue #230. Signed-off-by: meltq <tejasvipin76@gmail.com>
* tests: add enum bitfield testSimon Ser2024-07-096-0/+150
| | | | Signed-off-by: Simon Ser <contact@emersion.fr>
* scanner: fix validator for bitfieldsSimon Ser2024-07-092-70/+73
| | | | | | | Bitfields are valid if the value only contains bits inside of the supported entries for the given version. Signed-off-by: Simon Ser <contact@emersion.fr>
* scanner: extract validator function emission to helper functionSimon Ser2024-07-091-26/+33
| | | | | | This function will grow in the next commit. Signed-off-by: Simon Ser <contact@emersion.fr>
* build: re-open main branch for regular developmentSimon Ser2024-05-301-1/+1
| | | | Signed-off-by: Simon Ser <contact@emersion.fr>
* build: bump to version 1.23.0 for the official release1.23.0Simon Ser2024-05-301-1/+1
| | | | Signed-off-by: Simon Ser <contact@emersion.fr>
* protocol: clarify divergence in compositor behaviourHugo Osvaldo Barrera2024-05-291-3/+9
| | | | | | | | This is intended to only document the current situation. Whether further behaviour will be defined is out of scope and left for protocol v7. See: https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/363 Signed-off-by: Hugo Osvaldo Barrera <hugo@whynothugo.nl>
* build: bump to version 1.22.93 for the RC1 release1.22.93Simon Ser2024-05-231-1/+1
| | | | Signed-off-by: Simon Ser <contact@emersion.fr>
* server: document wl_display_add_socket_fd() ownershipSimon Ser2024-05-221-0/+3
| | | | | | wl_socket_destroy() will close the socket. Signed-off-by: Simon Ser <contact@emersion.fr>
* server: Clarify fd ownership in wl_client_create()Vlad Zahorodnii2024-05-161-0/+5
| | | | | | | It's unclear whether one needs to call close() if wl_client_create() fails. Hopefully this change makes it more clear. Signed-off-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
* build: bump to version 1.22.92 for the beta release1.22.92Simon Ser2024-05-091-1/+1
| | | | Signed-off-by: Simon Ser <contact@emersion.fr>
* protocol: explicitly describe wl_keyboard stateJulian Orth2024-05-091-7/+31
| | | | | | | | | And the allowed state transitions. There has been some confusion regarding which state transitions are allowed. This change should clarify this. Signed-off-by: Julian Orth <ju.orth@gmail.com>
* build: bump to version 1.22.91 for the alpha release1.22.91Simon Ser2024-04-251-1/+1
| | | | Signed-off-by: Simon Ser <contact@emersion.fr>
* client: print debug events that have no listenerDerek Foreman2024-04-241-11/+9
| | | | | | | | | | | Currently WAYLAND_DEBUG text ignores events that have no listener. It can be helpful to know when you're receiving unhandled events, as you may have forgotten to add a listener, or adding a dispatch may have magically seemed to fix code that doesn't appear to be dispatching anything. Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
* protocol: define content updates and their internal queueSebastian Wick2024-04-241-9/+11
| | | | | | | | | | | Multiple protocols use the term content update without a fill definition. It makes sense to define it in the core protocol so that not every other protocol has to define it. This is supposed to retain the current semantics and only changes the documentation while defining new terms. Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>