I recently got a new laptop - Lenovo X1 Yoga Gen 6 and thought that it's now-or-ever opportunity to head-dive into NixOS which was something I cherished for a long time. Anyhow, I have different DPI displays and hence need to run Wayland. Things are still a bit shaky with Wayland, at least on NixOS with KDE but it's getting better every week! - that's why I'm running on the unstable channel.
Every now and then after upgrade it happens that Chromium (and Chrome) open up but don't show a window. There is a taskbar entry, they respond to right-click, show recent docs in the right-click pop-up, etc., but not matter what I do, there is no window shown which makes unusable of course. This is how it looks:
How to fix it?
TL;DR;
cd ~/.config/chromium/Default
cat Preferences |jq 'del(.browser.window_placement, .browser.app_window_placement)' |sponge Preferences
How did I figure it out? I'm no Chrome dev so I did it a CLI way:
- Copied my profile
~/.config/chromium
aside, removed the original and checked that Chromium starts. I.e. it's a configuration issue - Used binary search to determine which files in the profile cause the issue - namely, each time I
rsync -av ~/.config/chromium{.old,}/Default/
, removed some files, and checked if it helped. Eventually I figured out thatPreferences
file is the offender - Now all was left is to compare the original and newly generated
Preferences
files. It's a single-line JSON file and I had to format it withjq
tool first. Looking at the (huge) diff I was lucky to notice that.browser.window_placement
configuration is different; and after copyingPrefences
from my original backup and dropping this attribute my Chromimum came back to life. Since I use Chromium web apps I had to reset.browser.app_window_placement
as well
Preferences
too.
Update Jan 2022: Apparently the above hack works only partially and the issue kept triggering until Chromimum 97 landed in NixOS and it never happened since.
No comments:
Post a Comment