window: Yet another try at fixing the highlight problem