|
|
@ -173,6 +173,22 @@ static void layer_surface_handle_get_popup(struct wl_client *client,
|
|
|
|
wlr_signal_emit_safe(&parent->events.new_popup, popup);
|
|
|
|
wlr_signal_emit_safe(&parent->events.new_popup, popup);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void layer_surface_set_layer(struct wl_client *client,
|
|
|
|
|
|
|
|
struct wl_resource *surface_resource, uint32_t layer) {
|
|
|
|
|
|
|
|
struct wlr_layer_surface_v1 *surface =
|
|
|
|
|
|
|
|
layer_surface_from_resource(surface_resource);
|
|
|
|
|
|
|
|
if (!surface) {
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (layer > ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY) {
|
|
|
|
|
|
|
|
wl_resource_post_error(surface->resource,
|
|
|
|
|
|
|
|
ZWLR_LAYER_SHELL_V1_ERROR_INVALID_LAYER,
|
|
|
|
|
|
|
|
"Invalid layer %d", layer);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
surface->client_pending.layer = layer;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const struct zwlr_layer_surface_v1_interface layer_surface_implementation = {
|
|
|
|
static const struct zwlr_layer_surface_v1_interface layer_surface_implementation = {
|
|
|
|
.destroy = resource_handle_destroy,
|
|
|
|
.destroy = resource_handle_destroy,
|
|
|
|
.ack_configure = layer_surface_handle_ack_configure,
|
|
|
|
.ack_configure = layer_surface_handle_ack_configure,
|
|
|
@ -182,6 +198,7 @@ static const struct zwlr_layer_surface_v1_interface layer_surface_implementation
|
|
|
|
.set_margin = layer_surface_handle_set_margin,
|
|
|
|
.set_margin = layer_surface_handle_set_margin,
|
|
|
|
.set_keyboard_interactivity = layer_surface_handle_set_keyboard_interactivity,
|
|
|
|
.set_keyboard_interactivity = layer_surface_handle_set_keyboard_interactivity,
|
|
|
|
.get_popup = layer_surface_handle_get_popup,
|
|
|
|
.get_popup = layer_surface_handle_get_popup,
|
|
|
|
|
|
|
|
.set_layer = layer_surface_set_layer,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static void layer_surface_unmap(struct wlr_layer_surface_v1 *surface) {
|
|
|
|
static void layer_surface_unmap(struct wlr_layer_surface_v1 *surface) {
|
|
|
@ -315,6 +332,7 @@ static void layer_surface_role_commit(struct wlr_surface *wlr_surface) {
|
|
|
|
surface->client_pending.keyboard_interactive;
|
|
|
|
surface->client_pending.keyboard_interactive;
|
|
|
|
surface->current.desired_width = surface->client_pending.desired_width;
|
|
|
|
surface->current.desired_width = surface->client_pending.desired_width;
|
|
|
|
surface->current.desired_height = surface->client_pending.desired_height;
|
|
|
|
surface->current.desired_height = surface->client_pending.desired_height;
|
|
|
|
|
|
|
|
surface->current.layer = surface->client_pending.layer;
|
|
|
|
|
|
|
|
|
|
|
|
if (!surface->added) {
|
|
|
|
if (!surface->added) {
|
|
|
|
surface->added = true;
|
|
|
|
surface->added = true;
|
|
|
@ -375,7 +393,7 @@ static void layer_shell_handle_get_layer_surface(struct wl_client *wl_client,
|
|
|
|
if (output_resource) {
|
|
|
|
if (output_resource) {
|
|
|
|
surface->output = wlr_output_from_resource(output_resource);
|
|
|
|
surface->output = wlr_output_from_resource(output_resource);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
surface->layer = layer;
|
|
|
|
surface->current.layer = surface->client_pending.layer = layer;
|
|
|
|
if (layer > ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY) {
|
|
|
|
if (layer > ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY) {
|
|
|
|
free(surface);
|
|
|
|
free(surface);
|
|
|
|
wl_resource_post_error(client_resource,
|
|
|
|
wl_resource_post_error(client_resource,
|
|
|
|