From dd6b5a190e4203b5482239c04e8b58eb6d184c88 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Wed, 15 Jun 2022 15:56:41 +0100 Subject: [PATCH] data-device: Use weston_surface_has_content() Now we've got a wrapper which tells us whether or not the surface has valid content, use it. The 'XXX' comment was removed because it's the same pattern as every other surface-role implementor: if the surface is not mapped but does have valid content, then map it. Signed-off-by: Daniel Stone --- libweston/data-device.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libweston/data-device.c b/libweston/data-device.c index bc2661c0..3506454c 100644 --- a/libweston/data-device.c +++ b/libweston/data-device.c @@ -420,8 +420,7 @@ drag_surface_configure(struct weston_drag *drag, assert((pointer != NULL && touch == NULL) || (pointer == NULL && touch != NULL)); - /* XXX: Why are we checking for a valid buffer here too ... ? */ - if (!weston_surface_is_mapped(es) && es->buffer_ref.buffer) { + if (!weston_surface_is_mapped(es) && weston_surface_has_content(es)) { if (pointer && pointer->sprite && weston_view_is_mapped(pointer->sprite)) list = &pointer->sprite->layer_link;