Skip to content
  • eucan's avatar
    ivi-shell: clear order.surface_list before reordering it · 38fcf381
    eucan authored and Pekka Paalanen's avatar Pekka Paalanen committed
    It is only possible to remove a surface from the order.surface_list of a
    layer, when ivi_layout_layer_set_render_order is called with an empty
    array.  Therefore, list of surfaces are cumulated if the API is called
    many times with different list of surfaces.
    
    Change how the flags are set:
    - Introduce the dirty parameter for triggering the render order change.
    - IVI_NOTIFICATION_REMOVE/ADD flags are set only at commit_layer_list.
    
    Checking wl_list_empty() on a link offers no information: if it returns
    true, wl_list_remove() is safe to do. If it returns false, you still do
    not know if wl_list_remove() is safe; the link could be part of a list,
    or the link could be "uninitialized" (e.g. just wl_list_remove()'d).
    (From Pekka Paalanen's comment at
    http://lists.freedesktop.org/archives/wayland-devel/2015-August/023987.html
    
    ).
    
    Calling wl_list_init just before wl_list_insert is redundant, because
    the links of the list are not read before it is overwritten by
    wl_list_insert.
    
    Use assert to control if the ivilayer->order.surface_list is empty.
    
    Signed-off-by: default avatarEmre Ucan <eucan@de.adit-jv.com>
    [Pekka: wrapped the commit message]
    Reviewed-by: default avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
    
    [Earlier version Reviewed-by: Nobuhiko Tanibata
    <NOBUHIKO_TANIBATA@xddp.denso.co.jp>]
    38fcf381