After leaving the edge of the screen for a certain distance

After leaving the edge of the screen for a certain distance, trigger a certain action, so that the dock can achieve the effect of auto-hide
(Currently, it is only possible to execute an action immediately after leaving)