Avoid sending surface enter/leave events before deciding surface's output
This fixes an issue in which the surface would alternate between the two displays, what is described in details in the commit message.
cc: @derekf
Edited by Leandro Ribeiro