mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 12:55:58 +01:00
surface: don't send protocol error on invalid buffer size
A libwayland-cursor bug [1] makes many clients crash.
[1]: https://gitlab.freedesktop.org/wayland/wayland/-/issues/194
Fixes: 91fa2ff395
("surface: check buffer size is compatible with scale")
Closes: https://github.com/swaywm/sway/issues/6014
This commit is contained in:
parent
2530235139
commit
641c223d3c
1 changed files with 6 additions and 3 deletions
|
@ -182,9 +182,12 @@ static bool surface_state_finalize(struct wlr_surface *surface,
|
||||||
if (!state->viewport.has_src &&
|
if (!state->viewport.has_src &&
|
||||||
(state->buffer_width % state->scale != 0 ||
|
(state->buffer_width % state->scale != 0 ||
|
||||||
state->buffer_height % state->scale != 0)) {
|
state->buffer_height % state->scale != 0)) {
|
||||||
wl_resource_post_error(surface->resource,
|
// TODO: send WL_SURFACE_ERROR_INVALID_SIZE error once this issue is
|
||||||
WL_SURFACE_ERROR_INVALID_SIZE,
|
// resolved:
|
||||||
"Buffer size not divisible by scale");
|
// https://gitlab.freedesktop.org/wayland/wayland/-/issues/194
|
||||||
|
wlr_log(WLR_DEBUG, "Client bug: submitted a buffer whose size (%dx%d) "
|
||||||
|
"is not divisible by scale (%d)", state->buffer_width,
|
||||||
|
state->buffer_height, state->scale);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue