xdg-shell: add/use wlr_xdg_{toplevel,popup}_from_wlr_xdg_surface()

This commit is contained in:
Kirill Primak 2024-08-14 16:09:38 +03:00
parent 21bda78b85
commit a0fab7b1e8
4 changed files with 53 additions and 20 deletions

View file

@ -39,12 +39,10 @@ static void scene_xdg_surface_update_position(
wlr_scene_node_set_position(&scene_xdg_surface->surface_tree->node,
-geo.x, -geo.y);
if (xdg_surface->role == WLR_XDG_SURFACE_ROLE_POPUP) {
struct wlr_xdg_popup *popup = xdg_surface->popup;
if (popup != NULL) {
wlr_scene_node_set_position(&scene_xdg_surface->tree->node,
popup->current.geometry.x, popup->current.geometry.y);
}
struct wlr_xdg_popup *popup = wlr_xdg_popup_try_from_wlr_xdg_surface(xdg_surface);
if (popup != NULL) {
wlr_scene_node_set_position(&scene_xdg_surface->tree->node,
popup->current.geometry.x, popup->current.geometry.y);
}
}