mimic XLib driver's behaviour when the viewport loses mouse focus, make the cursor hiding behaviour a little less dumb