aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominique Martinet <asmadeus@codewreck.org>2017-12-28 16:33:08 +0100
committerDominique Martinet <asmadeus@codewreck.org>2017-12-28 16:33:08 +0100
commitb0e440b5b1e1de0030947c68cdc34b0fd902c5e8 (patch)
tree58924fd7b5ae282c2ddf82ed744ce99eddf394c4
parent8e24aaa3c6959089f0459e03f01c7b1f638d6027 (diff)
xdg_toplevel send_configure: also post no_memory to resource on ENOMEM
-rw-r--r--types/wlr_xdg_shell_v6.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/types/wlr_xdg_shell_v6.c b/types/wlr_xdg_shell_v6.c
index 213d1030..1c46197e 100644
--- a/types/wlr_xdg_shell_v6.c
+++ b/types/wlr_xdg_shell_v6.c
@@ -924,7 +924,7 @@ static void wlr_xdg_toplevel_v6_send_configure(
s = wl_array_add(&states, sizeof(uint32_t));
if (!s) {
wlr_log(L_ERROR, "Could not allocate state for maximized xdg_toplevel");
- goto out;
+ goto error_out;
}
*s = ZXDG_TOPLEVEL_V6_STATE_MAXIMIZED;
}
@@ -932,7 +932,7 @@ static void wlr_xdg_toplevel_v6_send_configure(
s = wl_array_add(&states, sizeof(uint32_t));
if (!s) {
wlr_log(L_ERROR, "Could not allocate state for fullscreen xdg_toplevel");
- goto out;
+ goto error_out;
}
*s = ZXDG_TOPLEVEL_V6_STATE_FULLSCREEN;
}
@@ -940,7 +940,7 @@ static void wlr_xdg_toplevel_v6_send_configure(
s = wl_array_add(&states, sizeof(uint32_t));
if (!s) {
wlr_log(L_ERROR, "Could not allocate state for resizing xdg_toplevel");
- goto out;
+ goto error_out;
}
*s = ZXDG_TOPLEVEL_V6_STATE_RESIZING;
}
@@ -948,7 +948,7 @@ static void wlr_xdg_toplevel_v6_send_configure(
s = wl_array_add(&states, sizeof(uint32_t));
if (!s) {
wlr_log(L_ERROR, "Could not allocate state for activated xdg_toplevel");
- goto out;
+ goto error_out;
}
*s = ZXDG_TOPLEVEL_V6_STATE_ACTIVATED;
}
@@ -964,8 +964,12 @@ static void wlr_xdg_toplevel_v6_send_configure(
zxdg_toplevel_v6_send_configure(surface->toplevel_state->resource, width,
height, &states);
-out:
wl_array_release(&states);
+ return;
+
+error_out:
+ wl_array_release(&states);
+ wl_resource_post_no_memory(surface->toplevel_state->resource);
}
static void wlr_xdg_surface_send_configure(void *user_data) {