Revert "Revert "Prevent panel going out of screen boundaries""
This reverts commit 17774bc4
There is still a known culprit (duplicate display names) so the hack shouldn't be reverted.
This reverts commit 17774bc4
There is still a known culprit (duplicate display names) so the hack shouldn't be reverted.