diff options
-rw-r--r-- | include/wlr/types/wlr_layer_shell.h | 3 | ||||
-rw-r--r-- | protocol/wlr-layer-shell-unstable-v1.xml | 6 | ||||
-rw-r--r-- | types/wlr_layer_shell.c | 4 |
3 files changed, 11 insertions, 2 deletions
diff --git a/include/wlr/types/wlr_layer_shell.h b/include/wlr/types/wlr_layer_shell.h index 1312e568..79b3a4ea 100644 --- a/include/wlr/types/wlr_layer_shell.h +++ b/include/wlr/types/wlr_layer_shell.h @@ -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; diff --git a/protocol/wlr-layer-shell-unstable-v1.xml b/protocol/wlr-layer-shell-unstable-v1.xml index 3181c0bb..6a5d5d35 100644 --- a/protocol/wlr-layer-shell-unstable-v1.xml +++ b/protocol/wlr-layer-shell-unstable-v1.xml @@ -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> diff --git a/types/wlr_layer_shell.c b/types/wlr_layer_shell.c index c4e39a17..78aa2536 100644 --- a/types/wlr_layer_shell.c +++ b/types/wlr_layer_shell.c @@ -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), |