Properly handle buffers displayed in non-selected windows.