better mouse handling and fixed corner cutoff