mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 12:55:58 +01:00
xdg-decoration: send missing protocol errors
This commit is contained in:
parent
039cca8a51
commit
87969c1c7c
1 changed files with 15 additions and 0 deletions
|
@ -78,6 +78,11 @@ static void toplevel_decoration_handle_surface_destroy(
|
||||||
struct wl_listener *listener, void *data) {
|
struct wl_listener *listener, void *data) {
|
||||||
struct wlr_xdg_toplevel_decoration_v1 *decoration =
|
struct wlr_xdg_toplevel_decoration_v1 *decoration =
|
||||||
wl_container_of(listener, decoration, surface_destroy);
|
wl_container_of(listener, decoration, surface_destroy);
|
||||||
|
|
||||||
|
wl_resource_post_error(decoration->resource,
|
||||||
|
ZXDG_TOPLEVEL_DECORATION_V1_ERROR_ORPHANED,
|
||||||
|
"xdg_toplevel destroyed before xdg_toplevel_decoration");
|
||||||
|
|
||||||
wl_resource_destroy(decoration->resource);
|
wl_resource_destroy(decoration->resource);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -182,6 +187,16 @@ static void decoration_manager_handle_get_toplevel_decoration(
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct wlr_xdg_toplevel_decoration_v1 *existing;
|
||||||
|
wl_list_for_each(existing, &manager->decorations, link) {
|
||||||
|
if (existing->surface == toplevel->base) {
|
||||||
|
wl_resource_post_error(manager_resource,
|
||||||
|
ZXDG_TOPLEVEL_DECORATION_V1_ERROR_ALREADY_CONSTRUCTED,
|
||||||
|
"xdg_toplevel already has a decoration object");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
struct wlr_xdg_toplevel_decoration_v1 *decoration =
|
struct wlr_xdg_toplevel_decoration_v1 *decoration =
|
||||||
calloc(1, sizeof(struct wlr_xdg_toplevel_decoration_v1));
|
calloc(1, sizeof(struct wlr_xdg_toplevel_decoration_v1));
|
||||||
if (decoration == NULL) {
|
if (decoration == NULL) {
|
||||||
|
|
Loading…
Reference in a new issue