added new function to check if mouse leaves window while dragging, fixes #16