Copyright
SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd.
SPDX-License-Identifier: MIT
DDE shell surface role for treeland
Warning! This protocol is EXPERIMENTAL and under active development.
It may change at any time, including in backward-incompatible ways,
without incrementing the interface major version and without prior
notice. No compatibility guarantees of any kind are provided. Clients
and compositors must track the upstream definition in treeland-protocols
and must not rely on the current interface names, requests, events, or
semantics remaining stable across releases.
This protocol lets a privileged DDE client turn a wl_surface
into a shell surface that renders below the wlr-layer-shell
layer stack, at the overlay level of the workspace, and position
it at coordinates relative to an output or auto-place it below
the cursor.
The compositor must reject bind attempts from non-privileged
clients.
The terms "must", "must not", "should", and "may" in this document
are to be interpreted as described in RFC 2119.
Version 1
factory for DDE shell surfaces
A global that creates treeland_dde_shell_surface_v2 objects for
privileged DDE clients implementing parts of the shell user
interface.
The compositor must reject bind attempts from non-privileged
clients.
Version 1
shell surface role
A shell surface object assigns the DDE shell surface role to a
wl_surface. A shell surface renders either at the overlay level
of the workspace (above normal toplevel windows but below
layer-shell surfaces) or at the normal window layer, as
selected by the set_role request. The default role is overlay.
The role carries no requests that map, commit, or configure
buffer state; the client commits buffers with wl_surface
semantics as usual.
On the server side the object is automatically destroyed when
the related wl_surface is destroyed. On the client side,
treeland_dde_shell_surface_v2.destroy() must be called before
destroying the wl_surface object.
Positioning requests are mutually exclusive: set_position_hint
suggests fixed coordinates relative to an output, while
set_cursor_placement_hint asks the compositor to place the
surface relative to the cursor. The most recently sent
request determines the placement mode. Both requests are
hints for the initial placement of the surface: the
compositor decides the final position and may adjust it to
keep the surface accessible, for example to keep its
titlebar area within the output. Clients must not assume the
requested position is honored exactly.
treeland_dde_shell_surface_v2
enum role {
normal = 0,
overlay = 1,
}- normal — normal window layer, below the overlay layer and participating in regular toplevel stacking
- overlay — workspace overlay layer, above normal toplevels and below layer-shell surfaces
rendering layer for a shell surface
The layer a shell surface renders in. Layers are ordered by
z depth. Multiple surfaces can share a single role, and
ordering within a single role is undefined.
treeland_dde_shell_surface_v2
enum skip_flag {
switcher = 0x1,
dock_preview = 0x2,
multitask_view = 0x4,
}This is a bitfield
- switcher — do not list the window in the task switcher
- dock_preview — do not show the window in dock window previews
- multitask_view — do not list the window in the multitask view
window-listing preferences
Flags indicating that the surface prefers not to be listed
in specific shell views. Used by the set_skip_flags
request. Compositors should honor these preferences but
may ignore them, for example for windows the user must
always be able to reach.
treeland_dde_shell_surface_v2
request set_role(
role: uint<role>,
)- role — the rendering layer for this surface
assign a rendering layer to this surface
Assign the role identified by the role enum to this shell
surface, selecting the layer it renders in. The default
role before this request is overlay.
Assigning the normal role returns the surface to the
regular window layer, participating in normal toplevel
stacking again.
treeland_dde_shell_surface_v2
request set_position_hint(
output: nullable object<wl_output>,
x: int,
y: int,
)- output — the output whose origin anchors the coordinates, or null for the primary output
- x — x coordinate relative to the output origin
- y — y coordinate relative to the output origin
suggest a fixed position relative to an output
Suggest a position for the surface. The coordinates are
relative to the origin of the given output; for example
50,50 suggests placing the surface 50 units right of and
50 units below the output's top-left corner, wherever
that output currently sits in the global space spanning
all outputs.
The output argument may be null, in which case the
compositor uses the primary output as the anchor.
Otherwise the output must be a valid, current wl_output.
The position is resolved at request time; the compositor
does not keep the output associated with this surface
afterwards, and the client may release the wl_output
proxy once the request has been sent. If the output is
later destroyed, the already-applied position is not
affected.
This request is a hint for the initial placement of the
surface: the compositor decides the final position and
may adjust it to keep the surface accessible. Clients
must not assume the requested position is honored
exactly.
treeland_dde_shell_surface_v2
request set_cursor_placement_hint(
x_offset: int,
y_offset: int,
)- x_offset — horizontal offset of the surface center from the cursor center, positive to the right
- y_offset — distance from the bottom of the cursor to the top of the surface
suggest placing the surface relative to the cursor
Suggest placing the surface relative to the current cursor
position: horizontally offset by x_offset from the cursor
center and vertically offset by y_offset from the bottom
of the cursor.
This request is a hint for the initial placement of the
surface: the compositor decides the final position and
may adjust it to keep the surface accessible. Clients
must not assume the requested position is honored
exactly.
Sending this request switches the placement mode to
cursor-relative; see the interface description for the
interaction with set_position_hint.
treeland_dde_shell_surface_v2
request set_skip_flags(
flags: uint<skip_flag>,
)- flags — bitfield of views that should not list this surface
set window-listing preferences
Set the shell views that should not list this surface. The
flags argument is a bitfield of skip_flag values; setting
a flag asks the shell view not to include the surface,
clearing it restores default listing. This request
replaces any previously set flags.
treeland_dde_shell_surface_v2
request set_accept_keyboard_focus(
accept: uint,
)- accept — 0 to refuse keyboard focus, 1 to accept it
control whether the surface accepts keyboard focus
Set whether this surface can receive keyboard focus. When
set to 0, the surface will not receive keyboard focus even
when clicked or activated. When set to 1 (the default), the
surface receives keyboard focus normally.