diff options
author | Kirill Primak <vyivel@eclair.cafe> | 2023-07-11 11:48:21 +0300 |
---|---|---|
committer | Isaac Freund <mail@isaacfreund.com> | 2023-11-23 13:02:10 +0000 |
commit | e8413660686bf94322799470ef5b109ea4580cc9 (patch) | |
tree | 1eb79e17637fb51f6283faa24d42dbc00ead20e1 | |
parent | c85838892d56111809aa2edb83a2f22428bfa806 (diff) |
layer-shell: emit new_surface event at the proper time
-rw-r--r-- | include/wlr/types/wlr_layer_shell_v1.h | 2 | ||||
-rw-r--r-- | types/wlr_layer_shell_v1.c | 10 |
2 files changed, 3 insertions, 9 deletions
diff --git a/include/wlr/types/wlr_layer_shell_v1.h b/include/wlr/types/wlr_layer_shell_v1.h index df2107c5..fa0288be 100644 --- a/include/wlr/types/wlr_layer_shell_v1.h +++ b/include/wlr/types/wlr_layer_shell_v1.h @@ -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; diff --git a/types/wlr_layer_shell_v1.c b/types/wlr_layer_shell_v1.c index 37256db6..68322d04 100644 --- a/types/wlr_layer_shell_v1.c +++ b/types/wlr_layer_shell_v1.c @@ -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 = { |