mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-04 20:55:58 +01:00
xdg_shell stable: fix zero-sized positioner anchor_rect
We used 0 as unset-check value before, which was fine when 0-width was invalid, but isn't anymore
This commit is contained in:
parent
714f90a9d0
commit
56ab3e9b10
1 changed files with 5 additions and 1 deletions
|
@ -334,6 +334,10 @@ static void xdg_shell_create_positioner(struct wl_client *wl_client,
|
|||
return;
|
||||
}
|
||||
|
||||
/* set widths to detect improper usages of get_popup */
|
||||
positioner->size.width = -1;
|
||||
positioner->anchor_rect.width = -1;
|
||||
|
||||
positioner->resource = wl_resource_create(wl_client,
|
||||
&xdg_positioner_interface,
|
||||
wl_resource_get_version(resource),
|
||||
|
@ -500,7 +504,7 @@ static void xdg_surface_get_popup(struct wl_client *client,
|
|||
struct wlr_xdg_positioner *positioner =
|
||||
wl_resource_get_user_data(positioner_resource);
|
||||
|
||||
if (positioner->size.width == 0 || positioner->anchor_rect.width == 0) {
|
||||
if (positioner->size.width == -1 || positioner->anchor_rect.width == -1) {
|
||||
wl_resource_post_error(resource,
|
||||
XDG_WM_BASE_ERROR_INVALID_POSITIONER,
|
||||
"positioner object is not complete");
|
||||
|
|
Loading…
Reference in a new issue