improved the mouse listeners for cursors and borders