Detect the current state of the cursor before showing and hiding.