This allows moving a view to another output.
The way we currently do this is pretty much a hack and should be
replaced with a better approach. This function now confines this
hack in a single place and allows future enhancements.
Initially implemented for only defining the output to use for
unmapped surfaces, this implementation now also allows moving
usual views to different outputs by supplying the apply_layout
argument.
This patch also replaces usages of the output selection hack with
the new function.