ext_toplevel_placement_v1

manager to create placement suggestion objects

This interface is a manager used to create placement suggestion objects for xdg_toplevels.

The compositor may choose to restrict the availability of this manager based on its internal policy. This might involve checking the client's identity (e.g., via app_id or executable path) against a list of trusted clients configurable by the user.

destroy()
destroy the placement manager
get_placement(id: new_id<ext_toplevel_placement_v1>, toplevel: object<xdg_toplevel>)
Argument
Type
Description
idnew_id<ext_toplevel_placement_v1>
toplevelobject<xdg_toplevel>
get the placement suggestion interface for a toplevel

Attempt to create an ext_toplevel_placement_v1 interface for a given xdg_toplevel.

If the toplevel already has a placement object, the compositor MUST send the `placement_exists` error.

This interface can only be obtained once per xdg_toplevel.

error { placement_exists } 
Argument
Value
Description
placement_exists0
the toplevel already has a placement object

Interface for suggesting absolute toplevel placement

This interface allows trusted clients to suggest an initial placement position for its associated xdg_toplevel window, specified using absolute logical coordinates relative to a specific xdg_output.

Access to create and use this interface is subject to compositor policy.

The suggested placement is only a hint. The compositor retains full authority to determine the final window position. Clients must monitor configure events to determine the actual final placement.

destroy()
destroy the placement suggestion object
suggest_position(output: object<xdg_output>, x: int, y: int)
Argument
Type
Description
outputobject<xdg_output>
target output
xint
suggested logical x coordinate relative to output
yint
suggested logical y coordinate relative to output
suggest placement at absolute logical coordinates on an output

Suggests an initial placement position (x, y) for the associated xdg_toplevel. The coordinates are in logical pixels, relative to the top-left corner of the specified xdg_output's logical area.

This request serves as a hint to the compositor. The compositor MAY ignore this hint entirely or modify the outcome based on its state or policies. The client MUST NOT assume the suggestion will be honored precisely.

This suggestion is primarily intended for *initial* placement and should ideally be sent before the first wl_surface.commit that maps the window. Compositors are unlikely to substantially alter placement based on suggestions sent after the window is already mapped and positioned.

This request causes the compositor to send `placement_state`, including the output and logical coordinates where the toplevel is currently placed, or `not_placed`.

get_placement_state()
request the current placement state

Requests the compositor to send the current placement state, including the output and logical coordinates where the toplevel is currently placed.

placement_state(output: object<xdg_output>, x: int, y: int)
Argument
Type
Description
outputobject<xdg_output>
output the window is currently placed on
xint
current logical x coordinate relative to output
yint
current logical y coordinate relative to output
notify client of current placement state

This event notifies the client of the output and logical position where the compositor has actually placed the window, typically sent during the initial configuration sequence after considering any placement suggestions, and in response to a `get_placement_state` request.

This allows the client to know the result of its suggestion and update its stored state accurately. Compositors are not required to send this event if no suggestion was made or considered relevant to the final placement decision.

Standard xdg_toplevel.configure events remain the primary source for ongoing size, state, and potentially position updates.

not_placed(reason_string: string)
Argument
Type
Description
reason_stringstring
optional human-readable reason for placement failure
notify client that placement based on suggestion definitively failed

This event is sent if the compositor *cannot* place the toplevel window *as suggested*. This might be due to various reasons like no suitable output, geometry conflicts, or unresolvable policy restrictions *after considering the suggestion*. Receiving this event implies that the compositor will *not* honor the placement suggestion and the toplevel might not be placed at all, or will be placed using a fallback mechanism unrelated to the suggestion.


Compositor Support

No compositor support found

Copyright © 2025 The Wayland Authors

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.