Fix unwanted mouse behavior on refocus