Ubuntu – Opening Links from some applications takes a long time

19.04kubuntuxdg-open

When I click on links in some applications it can take up to a minute until the open in the browser. This is regardless if the default browser is chrome or firefox.

Example applications where opening links is normally fast:

  • within the browser
  • Konsole (default terminal window)
  • franz (installed as snap application)
  • tusk (installed as snap application)

Example applications where opening links take up to a minute until a new tab is opened in the browser:

  • rider (installed as snap application)
  • slack (installed as snap application)
  • VS Code (installed as snap application)

This started after I upgraded today to Kubuntu 19.04 from Kubuntu 18.10

VS Code, Slack, Franz AND Tusk are all based on electron, it seems weird that one would behave differently from the other, but that's what I see.

Is this a known issue? How can I fix it? How can I figure out where that time is lost?

Update:

Even running xdg-open https://askubuntu.com/questions/ask inside the terminal in rider, it was stuck for a long time:

> $ time xdg-open https://askubuntu.com/questions/ask
xdg-open https://askubuntu.com/questions/ask  0,12s user 0,07s system 0% cpu 2:05,35 total

however, running xdg-open from konsole works fast and both of them seem to be pointing to the same application, running it from a terminal within VSCode showed some errors, I resolved them and afterwards it was quick, but clicking on link in VSCode was still slow.

I'm not sure how to look for the root cause for this.

Update 2:

I also installed sudo apt-get install ttf-mscorefonts-installer around the same time I upgraded kubuntu from 18.10 to 19.04 – I can't imagine that having anything to do with it, but if nobody else has this issue

Best Answer

I was having the same issue until I found a solution. Whenever I tried to click a link in Slack, the logs in journalctl -f showed:

xdg-desktop-portal-kde[1886]: xdp-kde-settings: Read called with parameters:
xdg-desktop-portal-kde[1886]: xdp-kde-settings:     group:  "org.kde.kdeglobals.General"
xdg-desktop-portal-kde[1886]: xdp-kde-settings:     key:  "menuFont"
xdg-desktop-portal-kde[1886]: xdp-kde-settings: Key  "menuFont"  doesn't exist"

It turns out I was missing some values in my .config/kdeglobals configuration file, as the error above shows. You can regenerate the missing values by going to System Configuration -> Fonts -> Do any random change -> Apply.

After doing this the links started working fine.

Related Question