Fixes cursor error when main window is at increased size.

Fixes the issues discussed in the pull request.