Unify surface ordering code
Right now we have duplicated surface ordering logic: once in render.c
, and second time (but reversed) in desktop.c
(surface_at
). Those codepaths getting desynced have already lead to problems in the past. It would be nice to have a function that generates a list of surfaces to draw, which then could be used by both rendering and input code and traversed forwards and backwards (which will be also useful for future rendering optimizations, such as taking opaque regions into account).
Edited by Sebastian Krzyszkowiak