ext_tray_v1

ext_tray_v1

version 1
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.

destroy
Type: destructor
destroy()
destroy this object

Destroy this object.

Created tray items are not affected by this.

get_tray_item(id: new_id<ext_tray_item_v1>, surface: object<wl_surface>)
Argument
Type
Description
idnew_id<ext_tray_item_v1>
the new tray item
surfaceobject<wl_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.

Argument
Value
Description
conflicting_role0
the surface already has another role
already_exists1
tray item already exists for the surface
fatal error

These fatal protocol errors may be emitted in response to invalid requests.


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.

destroy()
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.

ack_configure(serial: uint)
Argument
Type
Description
serialuint
the serial
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.

Argument
Type
Description
popupobject<xdg_popup>
the popup to be shown
seatobject<wl_seat>
the causal seat
serialuint
the causal input serial
focus_hintuint<ext_tray_item_v1.keyboard_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.

configure_size(width: int, height: int)
Argument
Type
Description
widthint
the optimal width in surface coordinates
heightint
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.

preferred_anchor(anchor: uint<xdg_positioner.anchor>)
Argument
Type
Description
anchoruint<xdg_positioner.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.

preferred_gravity(gravity: uint<xdg_positioner.gravity>)
Argument
Type
Description
gravityuint<xdg_positioner.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.

configure(serial: uint)
Argument
Type
Description
serialuint
the serial
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.

Argument
Value
Description
has_popups0
the item has popups at destroy time
has_parent1
the popup already has a parent
invalid_seat_serial2
invalid serial provided to get_popup
invalid_configure_serial3
invalid serial provided to ack_configure
invalid_keyboard_focus_hint4
invalid keyboard focus hint provided to get_popup
fatal error

These fatal protocol errors may be emitted in response to invalid requests.

keyboard_focus_hint { none, on_demand, immediate } 
Argument
Value
Description
none0
no keyboard focus

The popup should never get the keyboard focus.

on_demand1
on demand keyboard focus

The popup should get the keyboard focus when the user requests it.

immediate2
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.


Compositor Support

No compositor support found

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.