*mouse_position_hook may set *FRAME to 0; don't generate switch-frame events in this case.
Attach a file by drag & drop or click to upload