constraints: Try place popup on the same monitor as the anchor rect
When we'd place a popup, if the initially calculated position would be on another monitor than the anchor rect on the parent window, the later constrained position would end up on another monitor than the parent window. This could for example happen if a popup menu opening towards the right was opened very close to the screen edge of a right most monitor in a two side by side monitor setup.
Closes: #1783 (closed) Closes: #1768 (closed)