Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

layer-shell: add ping/pong #90

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions unstable/wlr-layer-shell-unstable-v1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,34 @@
are not affected.
</description>
</request>

<event name="ping" since="3">
<description summary="check if the client is alive">
The ping event asks the client if it's still alive. Clients must
make a pong request passing the provided serial back to the compositor.

It's unspecified what will happen if the client doesn't respond to
the ping request, or in what time frame.

The compositor may use this request in order to achieve frame-perfect
handling of new outputs. Because of this, if a client wishes to
create a new layer surface in response to the creation of a new
output global, the client should make the get_layer_surface request
immediately on receiving the wl_registry.global event with the new
output and before processing any further events.
Copy link
Member

@emersion emersion Jul 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm. There is one issue with this approach though: if the client needs to preform more requests to decide whether to create a new layer-shell surface or not. A classic example of this is a client that only creates a layer-shell surface on an output named "DP-1": the client would need to retrieve the output name via xdg-output prior to creating the layer surface.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's a problem. I think we may need to go with the special purpose new_output/ack_new_output version because of this. However a ping/pong may also be worth adding for other use cases (and without this special language).

</description>
<arg name="serial" type="uint" summary="pass this to the pong request"/>
</event>

<request name="pong" since="3">
<description summary="respond to a ping">
Confirm to the compositor that the client is still alive. This
request should be made immediately on receiving the ping event from
the compositor. The serial sent with the ping event must be passed
along in the request.
</description>
<arg name="serial" type="uint" summary="serial of the ping event"/>
</request>
</interface>

<interface name="zwlr_layer_surface_v1" version="3">
Expand Down