Update layer shell with optional wl_output

This commit is contained in:
Drew DeVault 2018-04-22 18:57:45 +02:00
parent 12bf39a715
commit 177b548b15
3 changed files with 11 additions and 2 deletions

View file

@ -27,6 +27,9 @@ struct wlr_layer_shell {
struct wl_listener display_destroy;
struct {
// struct wlr_layer_surface *
// Note: the output may be NULL. In this case, it is your
// responsibility to assign an output before returning.
struct wl_signal new_surface;
} events;

View file

@ -47,12 +47,16 @@
or manipulate a buffer prior to the first layer_surface.configure call
must also be treated as errors.
You may pass NULL for output to allow the compositor to decide which
output to use. Generally this will be the one that the user most
recently interacted with.
Clients can specify a namespace that defines the purpose of the layer
surface.
</description>
<arg name="id" type="new_id" interface="zwlr_layer_surface_v1"/>
<arg name="surface" type="object" interface="wl_surface"/>
<arg name="output" type="object" interface="wl_output"/>
<arg name="output" type="object" interface="wl_output" allow-null="true"/>
<arg name="layer" type="uint" enum="layer" summary="layer to add this surface to"/>
<arg name="namespace" type="string" summary="namespace for the layer surface"/>
</request>

View file

@ -319,7 +319,9 @@ static void layer_shell_handle_get_layer_surface(struct wl_client *wl_client,
surface->shell = shell;
surface->surface = wlr_surface;
surface->output = wlr_output_from_resource(output_resource);
if (output_resource) {
surface->output = wlr_output_from_resource(output_resource);
}
surface->resource = wl_resource_create(wl_client,
&zwlr_layer_surface_v1_interface,
wl_resource_get_version(client_resource),