From 16825359c750f6b6dfd888d821bf44809ec8682c Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Thu, 23 Nov 2023 16:28:07 +0000 Subject: [PATCH] input: Use surface/view helpers for drag surfaces Use the helpers we have to map and position drag icons. Signed-off-by: Daniel Stone --- libweston/data-device.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/libweston/data-device.c b/libweston/data-device.c index 3565d5b6..45cafa3c 100644 --- a/libweston/data-device.c +++ b/libweston/data-device.c @@ -421,18 +421,16 @@ drag_surface_configure(struct weston_drag *drag, (pointer == NULL && touch != NULL)); if (!weston_surface_is_mapped(es) && weston_surface_has_content(es)) { + weston_surface_map(es); + pixman_region32_clear(&es->pending.input); + if (pointer && pointer->sprite && weston_view_is_mapped(pointer->sprite)) list = &pointer->sprite->layer_link; else list = &es->compositor->cursor_layer.view_list; - weston_layer_entry_remove(&drag->icon->layer_link); - weston_layer_entry_insert(list, &drag->icon->layer_link); - weston_view_update_transform(drag->icon); - pixman_region32_clear(&es->pending.input); - weston_surface_map(es); - drag->icon->is_mapped = true; + weston_view_move_to_layer(drag->icon, list); } drag->offset = weston_coord_surface_add(drag->offset, new_origin);