Copyright
Copyright © 2024 Julian Orth
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice (including the next
paragraph) shall be included in all copies or substantial portions of the
Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
Version 1
Compositor Support
protocol for system tray items
This is a global that advertises a tray area. It allows clients to
displays items in the tray.
The compositor can advertise multiple globals of this interface. For
example, if there are multiple outputs with one tray area each. In that
case, clients that want to display tray items should bind to and use all
of these globals.
The compositor can remove this global at any time. For example, when an
output containing a tray area is disconnected. In that case, the items
created from the global will no longer be displayed and the client should
destroy all associated objects.
Warning! The protocol described in this file is currently in the testing
phase. Backward compatible changes may be added together with the
corresponding interface version bump. Backward incompatible changes can
only be done by creating a new major version of the extension.
jay_tray_v1
enum error {
conflicting_role = 0,
already_exists = 1,
}- conflicting_role — the surface already has another role
- already_exists — tray item already exists for the surface
fatal error
These fatal protocol errors may be emitted in response to
invalid requests.
jay_tray_v1
request destroy()
Destructor
destroy this object
Destroy this object.
Created tray items are not affected by this.
jay_tray_v1
request get_tray_item(
id: new_id<jay_tray_item_v1>,
surface: object<wl_surface>,
)- id — the new tray item
- surface — the underlying surface
request tray item interface for surface
Create a tray item for a surface.
The surface is assigned the ext-tray-item-v1 role. If the surface
already has another role, the conflicting_role error is emitted.
If the surface already has a role object, the already_exists error is
emitted.
Version 1
tray item interface
This interface represents an item in a tray. The underlying surface will
be displayed in the tray.
Unless the global has been removed, the compositor will immediately emit a
configuration sequence after this object has been created. If applicable,
the sequence will also contain wl_surface.preferred_buffer_scale and
wp_fractional_scale_v1.preferred_scale events.
After receiving the configuration sequence, the client must ack the
configuration and commit the surface. The item will not be displayed
before this.
The compositor can send configuration sequences at any point.
If a null buffer is committed, the item will not be displayed.
If the client wants the item to be displayed, it must ack and commit the
latest configuration sequence and attach and commit a non-null buffer.
jay_tray_item_v1
enum error {
has_popups = 0,
has_parent = 1,
invalid_seat_serial = 2,
invalid_configure_serial = 3,
invalid_keyboard_focus_hint = 4,
}- has_popups — the item has popups at destroy time
- has_parent — the popup already has a parent
- invalid_seat_serial — invalid serial provided to get_popup
- invalid_configure_serial — invalid serial provided to ack_configure
- invalid_keyboard_focus_hint — invalid keyboard focus hint provided to get_popup
fatal error
These fatal protocol errors may be emitted in response to
invalid requests.
jay_tray_item_v1
request destroy()
Destructor
destroy this object
Destroy this object. The item is immediately removed from the tray.
The client must destroy all popups before this. Otherwise the has_popups
error is emitted.
jay_tray_item_v1
request ack_configure(
serial: uint,
)ack a configuration sequence
Ack a configuration sequence. The acked configuration sequence is
double-buffered state, see wl_surface.commit. If the compositor has
never sent this serial, an invalid_configure_serial error is emitted.
jay_tray_item_v1
enum keyboard_focus_hint {
none = 0,
on_demand = 1,
immediate = 2,
}- none
no keyboard focus
The popup should never get the keyboard focus.
- on_demand
on demand keyboard focus
The popup should get the keyboard focus when the user requests it.
- immediate
immediate keyboard focus
The popup should get the keyboard focus as soon as it becomes visible.
keyboard focus hint
This enum describes when a popup used in the get_popup request should
get keyboard focus.
- popup — the popup to be shown
- seat — the causal seat
- serial — the causal input serial
- focus_hint — a hint for keyboard focus handling
create a popup for tray item
Create a popup for a tray item.
The popup should have been created with a null parent. If the popup
already has a parent, the has_parent error is emitted.
The seat and serial indicate the interaction that causes this popup to
be shown. If the compositor has never sent this serial, the compositor
might emit the invalid_seat_serial error. This is compositor policy.
If the focus_hint is invalid, the invalid_keyboard_focus_hint error is
emitted.
The focus hint indicates how the client wants keyboard focus to be
handled for the popup. The compositor may ignore the hint. This hint has
no effect on nested popups.
The compositor may dismiss the popup at any point.
jay_tray_item_v1
event configure_size(
width: int,
height: int,
)- width — the optimal width in surface coordinates
- height — the optimal height in surface coordinates
optimal tray item size has changed
This event is sent when the optimal size for the item has changed.
This event is part of a configuration sequence that is terminated with
a configure event. The client should not act on it immediately but wait
for the configure event.
When the client receives this event, it should reconfigure the surface
for the new size, ack the sequence, and commit the surface.
If the surface has a different size, the compositor might crop or
stretch the surface. If the surface has subsurfaces that extend beyond
the edges of the surface, the compositor might crop them.
The width and height are at least 1.
If a configuration sequence does not contain this event, the client
should assume that the value is unchanged. The first configuration
sequence must contain this event.
jay_tray_item_v1
event preferred_anchor(
anchor: uint<xdg_positioner.anchor>,
)- anchor — the preferred anchor
preferred anchor has changed
This events is sent when the preferred anchor for popup windows changes.
This event is part of a configuration sequence that is terminated with
a configure event. The client should not act on it immediately but wait
for the configure event.
If a configuration sequence does not contain this event, the client
should assume that the value is unchanged. The first configuration
sequence must contain this event.
jay_tray_item_v1
event preferred_gravity(
gravity: uint<xdg_positioner.gravity>,
)- gravity — the preferred gravity
preferred gravity has changed
This events is sent when the preferred gravity for popup windows changes.
This event is part of a configuration sequence that is terminated with
a configure event. The client should not act on it immediately but wait
for the configure event.
If a configuration sequence does not contain this event, the client
should assume that the value is unchanged. The first configuration
sequence must contain this event.
jay_tray_item_v1
event configure(
serial: uint,
)marks the end of a configuration sequence
This event marks the end of a configuration sequence. The client should
act on the new parameters, ack the sequence, and commit the surface.
Note that this serial is not related to the wl_seat serial used in
get_popup requests.