mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2024-11-22 07:02:28 +00:00
layer-shell: emit new_surface event at the proper time
This commit is contained in:
parent
c85838892d
commit
e841366068
@ -83,7 +83,7 @@ struct wlr_layer_surface_v1 {
|
||||
|
||||
char *namespace;
|
||||
|
||||
bool added, configured;
|
||||
bool configured;
|
||||
struct wl_list configure_list;
|
||||
|
||||
struct wlr_layer_surface_v1_state current, pending;
|
||||
|
@ -368,14 +368,6 @@ static void layer_surface_role_commit(struct wlr_surface *wlr_surface) {
|
||||
surface->current = surface->pending;
|
||||
surface->pending.committed = 0;
|
||||
|
||||
if (!surface->added) {
|
||||
surface->added = true;
|
||||
wl_signal_emit_mutable(&surface->shell->events.new_surface, surface);
|
||||
// Return early here as the compositor may have closed this layer surface
|
||||
// in response to the new_surface event.
|
||||
return;
|
||||
}
|
||||
|
||||
if (wlr_surface_has_buffer(wlr_surface)) {
|
||||
wlr_surface_map(wlr_surface);
|
||||
}
|
||||
@ -461,6 +453,8 @@ static void layer_shell_handle_get_layer_surface(struct wl_client *wl_client,
|
||||
&layer_surface_implementation, surface, NULL);
|
||||
|
||||
wlr_surface_set_role_object(wlr_surface, surface->resource);
|
||||
|
||||
wl_signal_emit_mutable(&surface->shell->events.new_surface, surface);
|
||||
}
|
||||
|
||||
static const struct zwlr_layer_shell_v1_interface layer_shell_implementation = {
|
||||
|
Loading…
Reference in New Issue
Block a user