aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Primak <vyivel@eclair.cafe>2023-09-01 15:03:53 +0300
committerSimon Ser <contact@emersion.fr>2023-10-26 14:57:10 +0000
commite1c267172556a3b5b120d3469b59cb91af355a14 (patch)
tree46285db0ac19e2fc12c67846ac48b581fe86a627
parentffa8e3ec81c093b809c5902e082826120a09429e (diff)
layer-shell: check the configured flag earlier
-rw-r--r--types/wlr_layer_shell_v1.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/types/wlr_layer_shell_v1.c b/types/wlr_layer_shell_v1.c
index 0f680d87..927b8762 100644
--- a/types/wlr_layer_shell_v1.c
+++ b/types/wlr_layer_shell_v1.c
@@ -307,6 +307,13 @@ static void layer_surface_role_commit(struct wlr_surface *wlr_surface) {
return;
}
+ if (wlr_surface_has_buffer(surface->surface) && !surface->configured) {
+ wl_resource_post_error(surface->resource,
+ ZWLR_LAYER_SHELL_V1_ERROR_ALREADY_CONSTRUCTED,
+ "layer_surface has never been configured");
+ return;
+ }
+
const uint32_t horiz = ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT |
ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT;
if (surface->pending.desired_width == 0 &&
@@ -330,13 +337,6 @@ static void layer_surface_role_commit(struct wlr_surface *wlr_surface) {
surface->current = surface->pending;
surface->pending.committed = 0;
- if (wlr_surface_has_buffer(surface->surface) && !surface->configured) {
- wl_resource_post_error(surface->resource,
- ZWLR_LAYER_SHELL_V1_ERROR_ALREADY_CONSTRUCTED,
- "layer_surface has never been configured");
- return;
- }
-
if (!surface->added) {
surface->added = true;
wl_signal_emit_mutable(&surface->shell->events.new_surface, surface);
@@ -345,7 +345,7 @@ static void layer_surface_role_commit(struct wlr_surface *wlr_surface) {
return;
}
- if (surface->configured && wlr_surface_has_buffer(wlr_surface)) {
+ if (wlr_surface_has_buffer(wlr_surface)) {
wlr_surface_map(wlr_surface);
}
}