improve distraction free mode for detached editors
(cherry picked from commit fcd726c45481a7a2dfcf6cc32a7c6b90eac0d72e)