Make log window keep selection on focus loss and simplify scrolling behavior