libweston-desktop: Unset use_geometry when unsetting relative_to

In other parts of the code, use_geometry implies a parent is present. So
let's clear it when we clear relative placement.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This commit is contained in:
Derek Foreman 2023-07-18 10:41:51 -05:00
parent 123e921871
commit eebbe26d7b
1 changed files with 3 additions and 0 deletions

View File

@ -89,6 +89,8 @@ weston_desktop_surface_update_view_position(struct weston_desktop_surface *surfa
if (!parent) {
struct weston_coord_global pos;
assert(!surface->use_geometry);
pos.c = weston_coord(x, y);
wl_list_for_each(view, &surface->view_list, link)
weston_view_set_position(view->view, pos);
@ -843,6 +845,7 @@ weston_desktop_surface_unset_relative_to(struct weston_desktop_surface *surface)
return;
surface->parent = NULL;
surface->use_geometry = false;
wl_list_remove(&surface->children_link);
wl_list_init(&surface->children_link);