Improve mouse dragging behavior