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 <daniels@collabora.com>
dev
Daniel Stone 3 years ago committed by Marius Vlad
parent 888d08d8a5
commit dd6b5a190e
  1. 3
      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;

Loading…
Cancel
Save