layer-shell: Move handling of mapped property out of commit handler
We need to be able to tell whether the surface is mapped or not before
handle_surface_commit is called, since unmapping causes cursor focus to
be updated, which in turn could end up choosing the surface that's being
unmapped as the focused one again. We can't rely on wlr_layer_shell's
mapped
property, because it only gets updated already after unmap
handler is called. Therefore, handle mapped
status directly in map/unmap
handlers.
With that in place, we can ignore unmapped surfaces in layer_surface_at, which fixes #277 (closed).