#[non_exhaustive]pub enum Request {
Destroy,
Remove,
AddToplevel {
id: New<XdgToplevelSessionV1>,
toplevel: XdgToplevel,
name: String,
},
RestoreToplevel {
id: New<XdgToplevelSessionV1>,
toplevel: XdgToplevel,
name: String,
},
RemoveToplevel {
name: String,
},
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Destroy
Destroy the session
Destroy a session object, preserving the current state but not continuing to make further updates if state changes occur. This makes the associated xdg_toplevel_session_v1 objects inert.
This is a destructor, once received this object cannot be used any longer.
Remove
Remove the session
Remove the session, making it no longer available for restoration. A compositor should in response to this request remove the data related to this session from its storage.
This is a destructor, once received this object cannot be used any longer.
AddToplevel
add a new surface to the session
Attempt to add a given surface to the session. The passed name is used to identify what window is being restored, and may be used to store window specific state within the session.
The name given to the toplevel must not correspond to any previously existing toplevel names in the session. If the name matches an already known toplevel name in the session, a ‘name_in_use’ protocol error will be raised.
The toplevel object must not be added more than once to any session created by the client, otherwise the ‘already_added’ protocol error will be raised.
This request will return a xdg_toplevel_session_v1 for later manipulation. As this resource is created from an empty initial state, compositors must not emit a xdg_toplevel_session_v1.restored event for resources created through this request.
The name string must be UTF-8 encoded. It is also limited by the maximum length of wayland messages (around 4KB). The ‘invalid_name’ protocol error will be raised if an invalid string is provided.
RestoreToplevel
restore a surface state
Inform the compositor that the toplevel associated with the passed name should have its window management state restored.
If the toplevel name was previously granted to another xdg_toplevel, the ‘name_in_use’ protocol error will be raised.
The toplevel object must not be added more than once to any session created by the client, otherwise the ‘already_added’ protocol error will be raised.
This request must be called prior to the first commit on the associated wl_surface after creating the toplevel, otherwise an ‘already_mapped’ error is raised.
As part of the initial configure sequence, if the toplevel was successfully restored, a xdg_toplevel_session_v1.restored event is emitted. If the toplevel name was not known in the session, this request will be equivalent to the xdg_toplevel_session_v1.add_toplevel request, and no such event will be emitted. See the xdg_toplevel_session_v1.restored event for further details.
The name string must be UTF-8 encoded. It is also limited by the maximum length of wayland messages (around 4KB). The ‘invalid_name’ protocol error will be raised if an invalid string is provided.
RemoveToplevel
remove a surface from the session
Remove a specified surface from the session and render any related xdg_toplevel_session_v1 object inert. The compositor should remove any data related to the toplevel in the corresponding session from its internal storage.
The window is specified by its name in the session. The name string must be encoded in UTF-8, and it is limited in size by the maximum length of wayland messages (around 4KB).