Skip to content
  • Pekka Paalanen's avatar
    libweston: let add/remove_output handle the lists · f0ca7963
    Pekka Paalanen authored
    
    
    A weston_output available to the compositor should always be either in
    the list of pending outputs or the list of enabled outputs. Let
    weston_compositor_add_output() and weston_compositor_remove_output()
    handle the moves between the lists.
    
    This way weston_output_enable() does not need to remove and
    oops-it-failed-add-it-back. weston_output_disable() does not need to
    manually re-add the output back to the pending list.
    
    To make everything nicely symmetric and fix any unbalancing caused by
    this:
    - weston_output_destroy() explicitly wl_list_remove()s
    - weston_compositor_add_pending_output() first removes then inserts, as
    we have the assumption that the link is always valid, even if empty.
    
    Update the documentations, too.
    
    v2:
    - talk about "list of enabled outputs"
    - keep wl_list_remove in weston_compositor_remove_output in its old
      place
    
    Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
    Reviewed-by: default avatarArmin Krezović <krezovic.armin@gmail.com>
    f0ca7963