Tag: XDG

  • Fedora 44 and Firefox 154 crashing: “the specified toplevel id is already used”

    It does not happen often but today after rebooting Fedora Kinoite since the previous OS update Firefox crashed and would no longer load. This is a big issue since we all rely on the browser for everything plus the fact that my session includes tons of open windows and tabs which I would rather not lose.

    Luckily I already had a Flatpak version of Firefox installed from previously which I rarely use. It was installed for some codec issues with Ubiquiti Unifi Protect as well as for certain Youtube videos. This version does not contain all my user profile data or session but at least I could start digging around.

    A couple of weeks ago the Firefox Fedora package maintainer enabled KDE’s session restore feature (not the same as Firefox’s own session restore). However this broke the compatibility with Wayland crashing with “the specified toplevel id is already used“. To be fair I am not too much into the inner workings of XDG, so I tried to just get a work-around.

    The obvious one of starting in X11 actually worked. It launched Firefox and even restored my session. But it was utterly laggy compared to the smoothness of Wayland. If you want to try simply run this in the console:

    MOZ_ENABLE_WAYLAND=0 firefox

    Fortunately I am not the only user affected so there were a few bugs about the issue of which #2059617 has become the principal. Comment 10 mentioned the option to disable the Wayland session and it worked flawlessly. Find your Firefox profile in your home directory (e.g. $HOME/.mozilla/firefox/xxxxx.default-release) and add this line to the end of prefs.js:

    user_pref("widget.wayland.session-management.enabled", false);

    Now restart Firefox and all should be back to normal, Wayland working and your browser session restored.

    I left a comment in the same bug in case anyone needs to get up and running quickly. Hopefully a fix will be out soon so people that are not aware of these work-arounds can launch Firefox again.

  • Firefox not opening mailto links in Flatpak Thunderbird

    Using Fedora Kinoite Thunderbird comes in a Flatpak. This caused me issues with mailto links in Firefox not opening Thunderbird’s new email window.

    Usually just setting Thunderbird as the default email client inside Thunderbird’s settings or KDE’s default applications would have worked. Even selecting Thunderbird inside the Firefox file handler applications settings would have done the job. However mailto links did nothing but open up the application selector in Firefox which did not work.

    The first two places were already set correctly (in Thunderbird and KDE) so not much more to do there. As I cannot directly select Thunderbird’s binary since it is a Flatpak, I tried to get Firefox to open the Flatpak binary instead and somehow customise the command being run.

    There was just no way to customise the command through its interface, unless I fiddled with handlers.json directly in my Firefox profile directory. I tried a few combinations and no dice. I was also still reluctant to believe that all other users would go through this mess just to get mailto links working which is such a basic feature.

    The most annoying part was that XDG actually returned Thunderbird as the default handler for mailto links:

    $ xdg-mime query default x-scheme-handler/mailto
    org.mozilla.Thunderbird.desktop

    But checking my ~/.config/mimeapps.list file revealed that there was no mailto handler defined. Adding the corresponding entries finally fixed the issue:

    [Added Associations]
    x-scheme-handler/mailto=org.mozilla.Thunderbird.desktop;

    [Default Applications]
    x-scheme-handler/mailto=org.mozilla.Thunderbird.desktop;

    Glad that I got it working but still not satisfied that this was really the way to go, so I decided to start from scratch.

    I went back to KDE’s System Settings>Apps & Windows>Default Applications>Email client. Despite having Thunderbird already selected I went and selected Other… instead. Here I could select Thunderbird again but interestingly there were more options:

    You will notice in my screen-shot the check-box stating “Remember application association for all files of type “x-scheme-handler/mailto“. This check-box once checked actually updates the same ~/.config/mimeapps.list file with the previous entries I mentioned earlier.

    So apparently this is an option which is not enabled by default when just selecting Thunderbird in the default applications list. Why not having mailto links working by default in KDE is a conundrum.

    I am sure there are edge cases not wanting mailto links to open the default email client, but I would assume the vast majority of users expect this behaviour of the default email client. What is the point otherwise of selecting a default application?