Improve double-click logic on X11