mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-12-20 13:50:14 +01:00
xdg-surface: ensure that the effective geom is not empty
Fixes: 5c98d1a04a
This commit is contained in:
parent
7161bcfabc
commit
5dc73937ff
1 changed files with 7 additions and 3 deletions
|
|
@ -262,6 +262,10 @@ static void update_geometry(struct wlr_xdg_surface *surface) {
|
|||
wlr_surface_get_extents(surface->surface, &surface->geometry);
|
||||
wlr_box_intersection(&surface->geometry,
|
||||
&surface->current.geometry, &surface->geometry);
|
||||
if (wlr_box_empty(&surface->geometry)) {
|
||||
wl_resource_post_error(surface->resource, XDG_SURFACE_ERROR_INVALID_SIZE,
|
||||
"the effective window geometry is empty");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
wlr_surface_get_extents(surface->surface, &surface->geometry);
|
||||
|
|
@ -332,10 +336,10 @@ static void xdg_surface_role_commit(struct wlr_surface *wlr_surface) {
|
|||
break;
|
||||
}
|
||||
|
||||
if (wlr_surface->mapped) {
|
||||
update_geometry(surface);
|
||||
} else if (wlr_surface_has_buffer(wlr_surface)) {
|
||||
if (!wlr_surface->mapped && wlr_surface_has_buffer(wlr_surface)) {
|
||||
wlr_surface_map(wlr_surface);
|
||||
} else {
|
||||
update_geometry(surface);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue