Refine bounds checking to prevent putting the internal frame in a position where it could not be dragged back to visible area.

Also, prevent a NPE occurring on Macs since the browser extension have been re-enabled.
When UI is Mac, introduce a desktop manager using a most-recent-use order
for its panels and disable iconify/deiconify to prevent problems
occurring because Aqua desktop manager is not used.
Merge pull request #36 from marcpa00/bounds-aware-desktopmanager-tweaks

Refine bounds checking of DesktopManager