Commit graph

53 commits

Author SHA1 Message Date
Nick Diego Yamane
e7fea17be8 xdg-toplevel-drag: clarify offset is relative to geometry
The current description is not clear about it, though the only available
implementation works like that, so make it explicit in the protocol
description.

Signed-off-by: Nick Diego Yamane <nickdiego@igalia.com>
2024-10-05 14:58:43 +00:00
Simon Zeni
bdb88cec2b drm-lease-v1: advertise connector again upon lease finished event
Signed-off-by: Simon Zeni <simon.zeni@collabora.com>
Reviewed-by: jexposit@redhat.com
2024-10-05 13:14:38 +00:00
Simon Zeni
950b7384b9 drm-lease-v1: advertise connector again upon lease destruction
Signed-off-by: Simon Zeni <simon.zeni@collabora.com>
Reviewed-by: Xaver Hugl <xaver.hugl@kde.org>
2024-10-05 13:14:38 +00:00
Simon Zeni
05e777f476 drm-lease-v1: specify existing lease status on withdrawn event
Signed-off-by: Simon Zeni <simon.zeni@collabora.com>
Reviewed-by: Xaver Hugl <xaver.hugl@kde.org>
2024-10-05 13:14:38 +00:00
Julian Orth
f30b27a0ee security-context-v1: clarify close_fd behavior
Signed-off-by: Julian Orth <ju.orth@gmail.com>
2024-09-25 16:22:51 +00:00
Simon Ser
6f5772fd69 xdg-toplevel-icon: clarify that wl_buffer.release is unused
The protocol as-is doesn't allow clients to mutate wl_buffers.
Let's make it clear that wl_buffer.release is not used for that
purpose. Buffer re-use can be added in a future protocol version
if desirable.

Add a small note to explain that no wl_buffer mutation implies no
wl_shm_pool's backing storage mutation as well.

Signed-off-by: Simon Ser <contact@emersion.fr>
Closes: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/issues/201
2024-09-08 10:44:03 +02:00
Simon Ser
c4df317ea6 xdg-toplevel-icon: add error for destroyed wl_buffer
This requirement was missing an error code.

Signed-off-by: Simon Ser <contact@emersion.fr>
References: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/issues/201
2024-08-30 17:21:00 +00:00
Andri Yngvason
f4925c9313 ext-image-copy-capture-v1: new protocol
Signed-off-by: Andri Yngvason <andri@yngvason.is>
Signed-off-by: Simon Ser <contact@emersion.fr>
Co-authored-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Simon Zeni <simon@bl4ckb0ne.ca>
2024-08-10 17:24:46 +02:00
Andri Yngvason
c543ade77b ext-image-capture-source-v1: new protocol
Signed-off-by: Andri Yngvason <andri@yngvason.is>
Signed-off-by: Simon Ser <contact@emersion.fr>
Co-authored-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Simon Zeni <simon@bl4ckb0ne.ca>
2024-08-08 09:22:36 +00:00
Matthias Klumpp
e3c6a17a6f staging: Add xdg-toplevel-icon protocol for dedicated toplevel icons
This protocol allows clients to set icons for their toplevel windows.
Icons can be loaded from the XDG icon stock using their name, or can
alternatively be provided by the client as wl_shm-backed wl_buffer.

A toplevel icon represents the individual toplevel (unlike the
application or launcher icon, which represents the application as a
whole), and may be shown in window switchers, window overviews and
taskbars that list individual windows.

Resolves: #52

Signed-off-by: Matthias Klumpp <matthias@tenstral.net>
2024-06-01 17:55:52 +02:00
Xaver Hugl
e71ed40ad7 staging/tearing-control: clarify what happens after wl_surface destruction
There's no protocol error for making requests on the object after the wl_surface
has been destroyed, so the object has to become inert in that case.

Signed-off-by: Xaver Hugl <xaver.hugl@kde.org>
2024-05-21 17:47:41 +00:00
Derek Foreman
c5b47dc928 various: Fix definition of double-buffered state
The strict "mailbox" model of wayland past is not how modern compositors
process commits, and many explanations of how double buffered state is
applied throughout wayland-protocols are no longer strictly accurate.

Instead of trying to define double-buffered state at every point of use,
just reference the evolving definition of wl_surface.commit.

This still leaves a few old definitions that weren't trivially updated.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2024-05-06 09:45:35 +00:00
PolyMeilex
9bfb27f0a4
Fix some trivial typos
Fix typos in protocol files and in python code

Signed-off-by: Bartłomiej Maryńczak <marynczakbartlomiej@gmail.com>
2024-05-03 14:16:40 +02:00
Simon Ser
6eae6815e8 xdg-dialog: fix missing namespace in protocol name
Signed-off-by: Simon Ser <contact@emersion.fr>
2024-04-22 17:33:24 +02:00
Xaver Hugl
8b8b518df0 staging: add alpha-modifier protocol
This protocol allows clients to set an alpha multiplier for the whole surface,
which allows it to offload alpha changes for the whole surface to the compositor,
which in turn can offload them to KMS.

Signed-off-by: Xaver Hugl <xaver.hugl@kde.org>
2024-04-03 13:48:31 +02:00
Sebastian Wick
aac8841f82 cursor-shape-v1: Does not advertises the list of supported cursors
Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2024-03-26 10:16:22 +00:00
Simon Ser
ae9ed7ac14 linux-drm-syncobj-v1: new protocol
This is a new Linux explicit synchronization protocol based on DRM
synchronization objects [1].

[1]: https://dri.freedesktop.org/docs/drm/gpu/drm-mm.html#drm-sync-objects

Signed-off-by: Simon Ser <contact@emersion.fr>
2024-03-20 12:00:33 +01:00
Carlos Garnacho
9408483fb1 staging/dialog: Add "dialog" protocol
This simple protocol definition allows clients to express a "dialog"
relationship of a toplevel with its parent and extend the possible
hints. This allows compositors to attach certain behavior according
to these hints.

Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Reviewed-by: Sebastian Wick <sebastian.wick@redhat.com>
2024-03-14 12:47:54 +00:00
Poly
4c8840ce04
Fix typo in ext-foreign-toplevel-list-v1
Fix double "should" in ext-foreign-toplevel-list-v1

Signed-off-by: Bartłomiej Maryńczak <marynczakbartlomiej@gmail.com>
2024-02-10 03:17:24 +01:00
David Redondo
c4f897d660 Add xdg-toplevel-drag protocol
This protocol allows applications to request that a window is moved
at the same time as a drag operation - effectively dragging windows.
With this features such as detaching a tab from a window and reattaching
it, dragging tabs between windows or (un)dockable tool windows can
be implemented.
Based on the previously proposed extended drag protocol but trimmed
down.

Signed-off-by: David Redondo <kde@david-redondo.de>
2024-01-30 12:22:26 +00:00
Lleyton Gray
bde1c8712d
staging/drm-lease: fix typo in description
Signed-off-by: Lleyton Gray <lleyton@fyralabs.com>
2023-11-09 13:57:58 -08:00
Sebastian Wick
999e443773 security-context-v1: Make sandbox engine names use reverse-DNS
Specifically this also changes the well-known name for flatpak from
"flatpak" to "org.flatpak". This would be a breaking change but there is
no released version of flatpak yet with security-context support.

Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2023-10-24 10:11:33 +00:00
Andri Yngvason
e1abed62d5 Add the transient seat protocol
Signed-off-by: Andri Yngvason <andri@yngvason.is>
2023-10-07 16:54:24 +00:00
Sebastian Wick
5293896cce security-context-v1: Document what can be done with the open sockets
Specifically that after calling create_listener the only valid operation
on the sockets is to close them. They also must stay open and valid
until a round-trip after the call.

Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2023-07-11 15:27:14 +02:00
Sebastian Wick
b19ee1a7e3 security-context-v1: Document out of band metadata for flatpak
and specify when the invalid_metadata error will be sent.

Signed-off-by: Sebastian Wick <sebastian.wick@redhat.com>
2023-07-11 15:27:02 +02:00
David Redondo
3c1fb30817 xdg-activation: Clarify that the token stays valid if the object is destroyed
Signed-off-by: David Redondo <kde@david-redondo.de>
2023-07-03 09:15:34 +00:00
Simon Ser
12c063088e security-context-v1: new protocol
This is a variation of the unveil protocol I suggested in the Weston
issue about security contexts. This lets sandbox engines such as Flatpak
attach a security context to sandboxed clients. The compositor can then
restrict which features are made available to that client.

The protocol is designed around the assumption that the sandbox engine
uses this protocol when setting up the sandboxed application. After this
inital setup, the sandbox engine isn't necessarily running anymore.
For this reason, a special "close FD" is used to indicate when to stop
the security context listener: the sandbox engine can leak the FD into
the sandboxed app's process, and the OS will automatically close the FD
when the sandboxed app exits.

Signed-off-by: Simon Ser <contact@emersion.fr>
References: https://gitlab.freedesktop.org/wayland/weston/-/issues/206
2023-07-03 09:13:08 +00:00
Simon Ser
f89eb17d55 cursor-shape-v1: new protocol
This is based on the Chromium protocol [1].

[1]: https://chromium.googlesource.com/chromium/src/+/main/third_party/wayland-protocols/unstable/cursor-shapes/cursor-shapes-unstable-v1.xml

Signed-off-by: Simon Ser <contact@emersion.fr>
Closes: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/issues/58
References: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/21
2023-05-18 10:22:22 +02:00
i509VCB
77b4681f16 Add ext-foreign-toplevel-list protocol 2023-04-25 09:30:56 +00:00
Isaac Freund
a9fbc224cc
ext-session-lock-v1: relicense to MIT
All other protocols in wayland-protocols are released under the MIT
license and this one was only merged with the ISC license by accident.

I am the only person who has touched this protocol in commits and the
only copyright holder, so relicensing to bring this protocol in line
with the rest is easy in this case.

References: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/issues/119
Signed-off-by: Isaac Freund <mail@isaacfreund.com>
2023-02-10 12:24:04 +01:00
Isaac Freund
2e1e07e34c ext-session-lock-v1: clarify to fix race
Clients such as swaylock [1] or waylock [2] provide options to fork and
detach from the controlling terminal when the session is locked. The
point of these options is avoid a race on suspending the system. A
command to suspend the system (e.g. zzz) may safely be chained with
e.g. waylock as so:

waylock -fork-on-lock && zzz

However, there is no guarantee that the compositor has actually
blanked all outputs before sending the locked event. Therefore there
is still a race as new "locked" frames may not have been presented on
all outputs before the system is suspended.

On my Linux system at least, the current framebuffer seems to be
preserved on suspend and restored on resume, leading to an "unlocked"
frame potentially being displayed when the system is resumed. Blanking
all outputs before suspend eliminates this vulnerability.

Currently clients could theoretically implement such -fork-on-lock
options a bit better if the compositor supports the presentation-time
protocol, however no clients I've seen currently do this and it seems
wise to make clients to do the right thing by default in this security
sensitive context. The presentation-time protocol is also not sufficient
in all cases, for example if the compositor has turned off power of an
output but still exposes it to clients. In this case the client would
wait forever to get a presentation feedback that will never come.

Unfortunately, the protocol currently states that the locked event will
be sent immediately on creation of the ext_session_lock_v1 object rather
than after all normal content is hidden.

Several different approaches have been considered for how to fix this in
the protocol specification.

One possibility would be to add a new event sent when all normal content
is hidden. This is however opt-in for clients and therefore less likely
to be properly implemented by all clients in practice.

Another alternative is to bump the version of the ext_session_lock_v1
interface and state that the semantics of when the compositor will send
the locked event. However, this still requires clients to opt-in by
binding version 2 of the interface. The compositor could technically
deny the attempts of any version 1 clients to lock the session, but this
would likely be a bad breaking change for users of version 1 clients.
While session lock clients should inform the user in some way that their
attempt to lock the session was denied (e.g. by exiting non-zero) it
does not seem to be the case that such exit codes are widely checked.

The option to fix the protocol that is all around the most secure is
changing the semantics of the locked event without bumping the version
of the interface. This is technically a breaking change, but the failure
mode is that a client relying on the locked event being sent immediately
hangs or crashes and the session stays locked.

I also have been unable to find any session lock client in the wild that
relies on the locked event being sent immediately.

The river wayland compositor [3] in fact already implements the fix for
this race condition since the 0.2.0 release and has not received any bug
reports about broken session lock clients yet.

Therefore, I think that making this technically breaking change to the
protocol is our all around best option in this situation. Prioritizing
security over compatibility seems like the right trade-off to make for a
security critical protocol.

[1]: https://github.com/swaywm/swaylock
[2]: https://github.com/ifreund/waylock
[3]: https://github.com/riverwm/river

Signed-off-by: Isaac Freund <mail@isaacfreund.com>
2023-02-10 11:16:16 +00:00
Isaac Freund
5dc6efded0 ext-session-lock-v1: use RFC 2119 key words
Signed-off-by: Isaac Freund <mail@isaacfreund.com>
2023-02-10 11:16:16 +00:00
Xaver Hugl
930bc8014b staging/drm-lease: clarify connector naming
If the compositor advertises an output as a wp_drm_lease_connector_v1
and as wl_output, it should make the names match to allow clients to
identify the connection between the two outputs.

Signed-off-by: Xaver Hugl <xaver.hugl@gmail.com>
2023-01-23 17:06:32 +00:00
Philip Withnall
37a7b9d387 Fix typo in xdg-activation-v1
Noticed during review in
https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/98#note_1003427,
but not changed at the time.

Noticed again in https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3090#note_1606895.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-12-19 12:41:52 +00:00
Kenny Levinsen
9bd70a3a87 wp-fractional-scale-v1: new protocol
This protocols allows for communicating preferred fractional scales to
surfaces, which in combination with wp_viewport can be used to render
surfaces at fractional scales when applicable.

Signed-off-by: Kenny Levinsen <kl@kl.wtf>
2022-11-28 12:06:10 +01:00
Xaver Hugl
6394f0b4f3 staging: add tearing control protocol
For some use cases like games or drawing tablets it can make sense to reduce
latency by accepting tearing with the use of asynchronous page flips. This
protocol provides a way for clients to indicate whether or not their content
is suitable for this kind of presentation.

Signed-off-by: Xaver Hugl <xaver.hugl@gmail.com>
2022-11-14 23:44:08 +01:00
i509VCB
6d068c1708
content-type: fix enum name in wp_content_type_v1.set_content_type
This was originally set to `content_type`, but the protocol defines an enum named `type`. This fixes an issue with the protocol that was noticed when binding the protocol in wayland-rs.

Signed-off-by: i509VCB <git@i509.me>
2022-11-05 23:09:59 -05:00
Joshua Ashton
8d79352851 xwayland_shell_v1: New protocol
This protocol adds a xwayland_surface role which allows an Xwayland
server to associate an X11 window to a wl_surface.

Before this protocol, this would be done via the Xwayland server
providing the wl_surface's resource id via the WL_SURFACE_ID atom on the
X window. This was problematic as a race could occur if the wl_surface
associated with a WL_SURFACE_ID for a window was destroyed before the
update of the atom was processed by the compositor and another surface
(or other object) had taken its id due to recycling.

This protocol solves the problem by moving the X11 window to wl_surface
association step to the Wayland side, which means that the association
cannot happen out-of-sync with the resource lifetime of the wl_surface.

This protocol avoids duplicating the race on the other side by adding a
non-zero monotonic serial number which is entirely unique that is set on
both the wl_surface (via. xwayland_surface_v1's associate method) and
the X11 window (via. the `WL_SURFACE_SERIAL` atom) that can be used to
associate them, and synchronize the two timelines.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2022-10-28 03:02:49 +01:00
Emmanuel Gil Peyrot
c60529087d staging/content-type: Content type hint support
This protocol lets clients advertise which kind of content they expect
to be displayed on a given surface, so that the compositor can make more
informed decisions about its behavior and output configuration.

Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
Signed-off-by: Xaver Hugl <xaver.hugl@gmail.com>
2022-10-03 22:51:02 +02:00
Simon Ser
dc625d5acf ext-idle-notify: new protocol
This patch adds a new ext-idle-notify protocol. It allows clients to be
notified when the user is idle. Use-cases include e.g. power management
daemons.

This protocol is based on the org_kde_kwin_idle interface already being
used by KDE and wlroots compositors. The protocol has been sent to
wayland-protocols in 2015 [1]. This version renames and clarifies the
interfaces, and addresses the review comments.

[1]: https://lists.freedesktop.org/archives/wayland-devel/2015-December/026045.html

Signed-off-by: Simon Ser <contact@emersion.fr>
Closes: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/issues/8
Reviewed-by: David Edmundson <davidedmundson@kde.org>
2022-10-03 20:46:21 +00:00
Isaac Freund
b784987ae8 ext-session-lock: add note on client termination
See https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/262

Signed-off-by: Isaac Freund <mail@isaacfreund.com>
2022-09-26 17:14:43 +00:00
Simon Ser
3f90354eb5 single-pixel-buffer: new protocol
This protocol allows creating single-pixel buffers. It can be useful
to avoid having to allocate a real buffer just to fill it with the
same pixel value. Some use-cases include drawing background surfaces
or toplevel decorations.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-07-07 08:35:48 +00:00
Tadeo Kondrak
1293ff146e staging/drm-lease: Annotate destructor event
Signed-off-by: Tadeo Kondrak <me@tadeo.ca>
2022-02-25 14:22:20 -07:00
Isaac Freund
a52b8f025a
ext-session-lock-v1: new protocol
This protocol allows for a privileged Wayland client to lock the
session and display arbitrary graphics while the session is locked.

The client is responsible for performing authentication and informing
the compositor when the session should be unlocked. If the client
dies while the session is locked the session remains locked, possibly
permanently depending on compositor policy.

Signed-off-by: Isaac Freund <mail@isaacfreund.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
2021-12-28 17:23:03 +00:00
Xaver Hugl
aa3df4084a staging/drm-lease: DRM lease protocol support
DRM leasing is a feature which allows the DRM master to "lease" a subset
of its DRM resources to another DRM master via drmModeCreateLease, which
returns a file descriptor for the new DRM master. We use this protocol
to negotiate the terms of the lease and transfer this file descriptor to
clients.

In less DRM-specific terms: this protocol allows Wayland compositors to
give over their GPU resources (like displays) to a Wayland client to
exclusively control.

The primary use-case for this is Virtual Reality headsets, which via the
non-desktop DRM property are generally not used as desktop displays by
Wayland compositors, and for latency reasons (among others) are most
useful to games et al if they have direct control over the DRM resources
associated with it. Basically, these are peripherals which are of no use
to the compositor and may be of use to a client, but since they are tied
up in DRM we need to use DRM leasing to get them into client's hands.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Signed-off-by: Drew DeVault <sir@cmpwn.com>
Signed-off-by: Xaver Hugl <xaver.hugl@gmail.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Signed-off-by: David Edmundson <davidedmundson@kde.org>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2021-08-06 07:03:19 +00:00
Roman Gilg
7460f79e4b xdg-activation: rewrite and move description of token forwarding
After a requesting client receives a new token, the client usually forwards the
token string to another client by a different process, which then uses the
token in an activate request. For that the token string must be transferred to
the other process.

Two default ways of doing that were described in the done event, but the
description had some issues and it makes more sense to describe them in the
protocol description itself, which talks about the protocol in a more general
way. Therefore rewrite the paragraphs about token forwarding between clients
and place them in the protocol description.

Signed-off-by: Roman Gilg <subdiff@gmail.com>
2021-08-04 15:20:35 +00:00
Roman Gilg
855786de91 xdg-activation: correct sequence when X11 client spawns Wayland client
The Wayland client requests surface activation directly using the token
that it received from the X11 client.

Signed-off-by: Roman Gilg <subdiff@gmail.com>
2021-08-04 15:20:35 +00:00
Roman Gilg
e7183fb762 xdg-activation: use rst inline code
rst requires two backticks to format text as inline code.

Signed-off-by: Roman Gilg <subdiff@gmail.com>
2021-08-04 15:20:35 +00:00
Roman Gilg
7391c8e42f xdg-activation: use rst link
Instead of writing the link in brackets use the rst link functionality.

Signed-off-by: Roman Gilg <subdiff@gmail.com>
2021-08-04 15:20:35 +00:00
Simon Ser
36cee4bdbc xdg-activation-v1: clarify set_{serial,surface}
Make it clearer what the requests are used for.

Signed-off-by: Simon Ser <contact@emersion.fr>
2021-07-01 20:38:30 +00:00