Fix disappearing selection when tool window receives focus.