Commit graph

321 commits

Author SHA1 Message Date
Simon Ser
9b169ff945 protocol: drop reference to linux-explicit-synchronization
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>
2025-05-20 20:57:52 +00:00
David Edmundson
3214f858e2 protocol: Clarify sending of wl_seat.capabilities
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>
2025-05-20 20:20:13 +00:00
Michel Dänzer
6137c8c213 protocol: Clarify wl_buffer.release description
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)
2025-03-15 23:12:07 +00:00
Julian Orth
10df74c240 protocol: add wl_fixes interface
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>
2024-11-18 09:25:20 +00:00
Simon Ser
38f91fe6ad protocol: document that wl_surface.offset is role-specific
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>
2024-10-05 14:06:51 +00:00
Andri Yngvason
1b0d45e9c6 Add wl_keyboard key repeat events
This allows the compositor to take over the responsibility of repeating
keys.

Signed-off-by: Andri Yngvason <andri@yngvason.is>
2024-09-23 15:23:45 +00:00
Julian Orth
7c6259e9ad protocol: clients should not emulate key-press events on enter
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>
2024-09-10 07:36:48 +00:00
Hugo Osvaldo Barrera
26c419e046 protocol: clarify divergence in compositor behaviour
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>
2024-05-29 14:23:38 +02:00
Julian Orth
9e4f256927 protocol: explicitly describe wl_keyboard state
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>
2024-05-09 14:43:19 +00:00
Sebastian Wick
9069af78a7 protocol: define content updates and their internal queue
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>
2024-04-24 16:32:06 +00:00
Simon Ser
da8e1bbc45 protocol: mark wl_pointer.axis_discrete as deprecated
Since version 8, this event isn't sent anymore.

Signed-off-by: Simon Ser <contact@emersion.fr>
2024-04-24 16:18:28 +00:00
Simon Ser
ee12e69b8f Add support for the deprecated-since XML attribute
This marks a request, event or enum entry as deprecated since a
given version.

Note that it's not clear what it means if an entry is deprecated
at some version, and the enum is used from some completely different
interface than where it was defined. However, that's a more general
issue with enums, see:
https://gitlab.freedesktop.org/wayland/wayland/-/issues/435

Signed-off-by: Simon Ser <contact@emersion.fr>
References: https://gitlab.freedesktop.org/wayland/wayland/-/issues/89
2024-04-24 16:18:28 +00:00
Julian Orth
5eeaac6e11 Clarify behavior of buffer transformations
The new text describes how

- Mutter
- Plasma
- Sway 1.8
- Jay

behave.

Sway 1.9 flipped the behavior of 90 degree and 270 degree
set_buffer_transform requests. [mpv] also changed the behavior of its
vo_wayland_dmabuf backend which makes it only work correctly on sway
1.9.

[mpv]: https://github.com/mpv-player/mpv/pull/12509

It seems that the previous text was open to interpretation or at least
caused some amount of confusion.

Signed-off-by: Julian Orth <ju.orth@gmail.com>
2024-04-23 09:08:09 +00:00
Colin Kinloch
af1dc3ef4b protocol: Undefine wl_display_sync callback data
Signed-off-by: Colin Kinloch <colin.kinloch@collabora.com>
2024-04-23 08:43:44 +00:00
Isaac Freund
4945f2664f wl_touch.cancel: document lack of frame event
This appears to be what at least wlroots-based compositors and kwin do
in practice. However, it's not abundantly clear from the protocol text
what the expected behavior here is. This patch fixes that.

Signed-off-by: Isaac Freund <mail@isaacfreund.com>
2024-03-28 13:27:54 +00:00
Simon Ser
aa2a6d560b protocol: document that color channels provide electrical values
Expand the work done in [1] to document that all channels store
electrical values. See the discussion in [2].

[1]: https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/316
[2]: https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/250#note_2311377

Signed-off-by: Simon Ser <contact@emersion.fr>
2024-03-12 13:04:51 +00:00
Simon Ser
a74aa93394 protocol: mention wl_surface events from wl_output.{scale,transform}
The wl_output events should not be used anymore for guessing the
preferred scale and transform of a surface. We have explicit events
for that now.

Signed-off-by: Simon Ser <contact@emersion.fr>
2024-02-21 09:14:23 +00:00
Kirill Primak
8f499bf404 protocol: clarify pending wl_buffer destruction
This matches the current behavior of KWin, Mutter, and Weston.

References: https://gitlab.freedesktop.org/wayland/wayland/-/issues/387
Signed-off-by: Kirill Primak <vyivel@eclair.cafe>
2024-01-27 15:17:28 +00:00
Simon Ser
f06736a8a0 protocol: add wl_shm.release request
Allows clients to cleanly release wl_shm objects. Useful for clients
using multiple wl_registry objects (e.g. via libraries).

Signed-off-by: Simon Ser <contact@emersion.fr>
2024-01-19 15:12:29 +00:00
Ben Widawsky
8072ab0a50 protocol: clarify scale expecations
Since the positivity of zero is debatable, and, in some cases scale was simply
underspecified, clarify the situation.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2024-01-19 14:35:06 +00:00
Simon Ser
dc1da181db protocol: document wl_surface.offset for sub-surfaces
Document that the request is ignored, since this is the behavior
of most compositors.

Signed-off-by: Simon Ser <contact@emersion.fr>
2024-01-19 14:14:15 +00:00
Julian Orth
6626d4d98c protocol: wl_subsurface will never be focused
The spec does not describe which actions cause the compositor to assign
keyboard focus to a surface, leaving this up to the compositor.
Compositors differ in their behavior when the user clicks on a
sub-surface. Some will move the keyboard focus to the subsurface whereas
others will only ever assign the keyboard focus to toplevel surfaces.
Some applications (e.g. firefox) seem to require the second behavior.

This patch specifies that sub-surfaces never get the keyboard focus.

Signed-off-by: Julian Orth <ju.orth@gmail.com>
2023-12-27 18:02:07 +00:00
Kirill Primak
82d8b21827 protocol: improve wl_subsurface.{set_position,place_above} description
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>
2023-11-21 15:54:58 +00:00
Kirill Chibisov
8a19dc19a1 protocol: clarify defaults with wl_compositor@v6
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>
2023-11-21 15:50:11 +00:00
Simon Ser
e4eb42d073 protocol: refer to wl_surface.offset in wl_data_device.start_drag
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>
2023-11-21 15:36:00 +00:00
Simon Ser
72da004b3e protocol: fix whitespace
This file uses tabs instead of 8 spaces.

Signed-off-by: Simon Ser <contact@emersion.fr>
2023-07-19 11:01:17 +00:00
Simon Ser
a3c499493b protocol: refer to wl_surface.offset in set_cursor
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>
2023-05-23 09:33:43 +00:00
Sebastian Wick
f3026c916e protocol: specify the exact form of premultiplication
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>
2023-05-09 14:52:58 +02:00
Manuel Stoeckl
d40052e083 protocol: add new shm formats
This brings the format list up to date with libdrm 2.4.115.

Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
2023-05-03 19:10:32 +00:00
Xaver Hugl
1e259a255a protocol: improve wl_keyboard focus documentation
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>
2023-04-12 13:37:51 +00:00
Simon Ser
307b23626d protocol: disallow re-using wl_data_source
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>
2023-04-04 11:39:08 +00:00
Mikhail Gusarov
6cdeae1bec protocol: Clarify meaning of input region for cursors, DnD icons
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>
2023-02-27 20:51:51 +00:00
Vlad Zahorodnii
3815803633 protocol: reorder wl_data_offer.source_actions and wl_data_device.enter
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>
2023-02-27 20:43:41 +00:00
Sebastian Wick
2aec8f59e9 protocol: do not change pending x and y when attaching a buffer
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>
2023-02-27 20:39:41 +00:00
Peter Hutterer
1ef773be76 protocol: add wl_pointer's axis relative physical direction
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>
2023-02-21 15:32:03 +00:00
Simon Ser
d443241635 protocol: add wl_surface.preferred_buffer_transform
Same as the new wl_surface.preferred_buffer_scale event but for
transform.

No version bump needed since the previous commit did that.

Signed-off-by: Simon Ser <contact@emersion.fr>
2023-02-07 14:33:09 +01:00
Simon Ser
9afab91d21 protocol: add wl_surface.preferred_buffer_scale
Right now, clients need to bind to wl_output globals, listen to wl_output.scale,
listen to wl_surface.enter/leave, pick the highest scale factor.

This is an issue because it breaks Wayland's "policy, not mechanism" motto.
Clients take the decision of which scale to use depending on the outputs they're
on, compositors have no say in this (apart from faking output events, which
isn't great).

This commit introduces a new wl_surface.preferred_buffer_scale event to allow
compositors to directly indicate the preferred scale factor for each surface.

This unlocks features which require dynamically changing the scale such as:

- Accessibility features such as screen magnifier
- In a VR environment, render surfaces close to the eye at a higher scale
- HiDPI screenshots on LoDPI screens

Signed-off-by: Simon Ser <contact@emersion.fr>
Closes: https://gitlab.freedesktop.org/wayland/wayland/-/issues/271
2023-02-07 14:33:09 +01:00
Mikhail Gusarov
9700155eda protocol: wl_subsurface::destroy does not remove the role
Role assigned to wl_surface cannot be removed.
Delete contradicting text from wl_subsurface::destroy documentation.

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2023-01-16 10:09:32 +00:00
Simon Ser
7f1c51a556 protocol: add note about wl_buffer/wl_callback version
This is an exception which can be confusing. Add an explicit note
about it in the protocol text.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-12-07 10:04:49 +01:00
Kirill Primak
0dc23e380a protocol: add defunct_role_object error
This commit adds wl_surface.defunct_role_object error, which has
semantics similar to xdg_wm_base.defunct_surfaces error, and is sent
when a client destroys a surface while the corresponding role object
still exists.

Signed-off-by: Kirill Primak <vyivel@eclair.cafe>
2022-11-29 13:46:54 +00:00
Kirill Primak
68dfa1183f protocol: remove wl_subsurface lifetime contradiction
This statement assumes that a wl_surface can be destroyed before the
corresponding wl_subsurface, which is not true, as wl_surface
description explicitly states that the role object must be destroyed
before the wl_surface itself.

Signed-off-by: Kirill Primak <vyivel@eclair.cafe>
2022-11-29 13:46:54 +00:00
Simon Ser
b9632822b7 protocol: add wl_compositor.error.bad_parent
This forbids loops in sub-surface trees.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-09-21 10:17:57 +00:00
Simon Ser
c2c6ef9cbe protocol: mention protocol error name in wl_subcompositor.get_subsurface
Let's be explicit here.

Signed-off-by: Simon Ser <contact@emersion.fr>
2022-09-21 10:17:57 +00:00
Peter Hutterer
68842b3403 protocol: minor clarification for axis_discrete events
Explicitly spell out that multiple axis_discrete events *for the same axis*
within the same wl_pointer.frame are not permitted.

References: https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/911#note_1438099

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-06-30 09:12:08 +00:00
Demi Marie Obenour
1078ee4993 wl_shell is not mandatory
Even though it is part of wayland.xml, wl_shell is not mandatory for
compositors to implement, and may be removed in a future version.

Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
2022-04-11 23:04:26 +00:00
Peter Hutterer
868eb99eb0 protocol: add the wl_pointer.axis_value120 events
These events are for high-resolution wheels. Each logical wheel click
represents an axis value120 value of 120, fractions of a wheel click an
integer fraction thereof. The new event replaces
wl_pointer.axis_discrete for wl_pointer versions 8 and above.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-03-28 17:31:27 +00:00
Mikhail Gusarov
af8b5c0782 protocol: wl_shm.format events are actually sent after bind
Protocol documentation mistakenly specified that wl_shm.format
events are sent at connection setup time, but that's impossible
(clients do not yet know ID of wl_shm object at the time) and
contradicts implementation in libwayland.

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2022-02-21 11:13:45 +01:00
Julian Orth
ee92898cb5 protocol: xkb_v1 is null-terminated
Closes #270

Signed-off-by: Julian Orth <ju.orth@gmail.com>
2022-01-31 21:31:07 +00:00
shierote
aa6a07c2fe doc: fix typo in wl_data_device.data_offer
Signed-off-by: Taishi Eguchi <taishi2060@gmail.com>
2022-01-10 10:07:22 +00:00
Max Ihlenfeldt
8893573651 protocol: clarify wl_shm_pool.resize
Add a note that the request only changes the size of the memory mapping
and does not touch the mapped file.

Signed-off-by: Max Ihlenfeldt <mihlenfeldt@igalia.com>
2022-01-07 13:30:29 +00:00