Very ugly cursor for Spotify and KDE snaps

Hello there,

Since the very release of the Spotify snap it always uses a wrong (in terms of not the cursor theme selected in the system or not the default cursor) and very ugly, fuzzy, tiny and awkward cursor.
I always thought it would only happen for Spotify but since I’ve started to install several KDE snaps I know this also happens for those.
What could be done to change that? I know there were apps like some electron apps that had this issue too and suddenly it was fixed for them.
Is this fixable by the app maintainers or is this related to snapcraft?

If it would be just a wrong colour okay, but it looks completely broken and fuzzy.

Best regards,
Frederik

What’s wrong?

The issue is that these snaps do not use the icon themes from gtk-common-themes. That snap contains the cursor themes. Application snaps like spotify should connect to gtk-common-themes so they have access to all the common cursor themes. Without those cursor themes, the cursor will fallback to the ugly pixelated X11 one. Depending on what kind of snap it is, this is easier or harder to do. You can see whether a snap uses gtk-common-themes by running snap connections snap-name after it is installed. For cursors specifically, it should include the following line:

content[icon-themes]      snap-name:icon-themes       gtk-common-themes:icon-themes`

How to solve this

The easiest method is to use the gnome-3-28 extension. GTK apps and all other apps (except 32-bit apps, GTK+ 2 apps and Qt apps) should use the gnome-3-28 extension. However, many apps still use the older desktop helpers, which require you to manually add support for gtk-common-themes.

  • Spotify should probably upgrade to the gnome-3-28 extension. However, they might be more comfortable with only adding the gtk-common-themes snap. Since this snap is closed-source, there is not much more we can do except bugging them and providing good documentation.
  • The KDE snaps should, in my opinion, use the kde-neon extension. That extension adds support for the icon themes (I added this myself). The KDE Neon team, however, mostly still uses custom tooling which doesn’t automatically add the gtk-common-themes snap. The short-term solution is for somebody to take a look at the custom neon tooling and docs, and fix it so they also use the icon themes snap. All the KDE snaps are open source, so a community member should be able to go through all the snaps and add gtk-common-themes support. The long-term solution is for someone to reach out to the KDE Neon team and see what needs to be done for them to go all-in on the kde-neon extension.
2 Likes

I’m experiencing a similar issue. I’m new as far as snaps go, although I feel like this is a symptom of sandboxing.

EDIT: A key note is that I’m running on X11 - Could this be the case where the XSETTINGS isn’t set up properly to get the default cursor?

I’m running chromium version 81.0.4044.138 on xubuntu 20.04, the snap version I’m using described here:

λ snap info chromium
name:      chromium
summary:   Chromium web browser, open-source version of Chrome
publisher: Canonical✓
store-url: https://snapcraft.io/chromium
contact:   https://bugs.launchpad.net/ubuntu/+source/chromium-browser/+bugs?field.tag=snap
license:   unset
description: |
  An open-source browser project that aims to build a safer, faster, and more stable way for all
  Internet users to experience the web.
commands:
  - chromium.chromedriver
  - chromium
snap-id:      XKEcBqPM06H1Z7zGOdG5fbICuf8NWK5R
tracking:     latest/stable
refresh-date: 2 days ago, at 17:20 EDT
channels:
  latest/stable:    81.0.4044.138 2020-05-06 (1143) 161MB -
  latest/candidate: 81.0.4044.138 2020-05-06 (1143) 161MB -
  latest/beta:      83.0.4103.44  2020-05-08 (1144) 163MB -
  latest/edge:      84.0.4128.3   2020-04-29 (1136) 164MB -
installed:          81.0.4044.138            (1143) 161MB -

The connections listed includes the gtk-common-themes slot:

λ snap connections chromium 
Interface                 Plug                               Slot                            Notes
...
content[gtk-3-themes]     chromium:gtk-3-themes              gtk-common-themes:gtk-3-themes  -
content[icon-themes]      chromium:icon-themes               gtk-common-themes:icon-themes   -
content[sound-themes]     chromium:sound-themes              gtk-common-themes:sound-themes  -
...

Although I get the default X11 cursor when hovering over the instance.

This may be the wrong spot to poke to get the right answer. Is the case that the latest/stable branch doesn’t implement the gtk-3-themes extension yet, even though the proper connections are listed? Is there a case where the snap makes a connection to the gtk-common-themes extension but does not make use of it?

1 Like

Well, then, do you know of any effective way of “bugging” Spotify (without installing hidden mics :slight_smile: )? I’ve posted about this issue a long time ago in https://community.spotify.com/ and even linked to this thread, but they seem to mostly ignore anything Linux related. I remember Joy Sneddon lobbying them from OMG! Ubuntu some time ago (but maybe it wasn’t Spotify (?)). I think the fact that they have chosen Snap is great signalling, but then when you see the rough edges you put the blame on “Snap not being ready” while indeed it’s the packager’s fault in this case.

I think spotify is not connected to gtk-common-themes
and the fallback cursor in snap is this ugly, fuzzy, retro cursor.
I think at least @popey said something similar in the past :smile:

This gtk-common-themes merge request should improve the situation for the fallback cursor theme.

1 Like

Unfortunately, according to Olivier the PR won’t fix the Spotify issue: https://gitlab.gnome.org/Community/Ubuntu/gtk-common-themes/-/merge_requests/26#note_943399

Hello everyone @oSoMoN @galgalesh @jamesh

We (the yaru team) put a bunch of work over the years in our cursor theme:

Sadly, after a long time of existence of the spotify snap it still does not use the yaru cursors, but this fuzzy, tiny, very broken looking “fallback” x cursor.

Could there please be anything done about it?

It feels like a real bummer when all the work does not show up in such a major application.
Best regards

In the case of Spotify, it doesn’t have any content interface plugs to pull in theme data of any kind. So there is very little that can be done from our side. It would require Spotify to update their packaging.

Their snap suggests sending feedback to https://community.spotify.com/t5/Desktop-Linux/bd-p/desktop_linux

Can’t the fallback cursor be replaced by the yaru cursor set?

it surely can, but in snaps that do not use a theme snap via content interface as james described it can just be done by the snap author by including the right bits and setting the correct launcher variables … so only spotify themselves can fix it.

Okay, can’t this be somehow “lifted” up by Canonical? :calling: :email: I know this is nothing “of my concern” but this is really much more of a visual issue that it might look for someone who does not care that much about visuals. I think this is really a big issue and looking at this spotify board, I don’t think raising an issue there with a “user voice” will get this fixed any time soon.

I’m not sure who would have contacts with Spotify. Maybe @Igor or someone on his team would know?

As far as helping snap authors add standard features like theme support, up to date GNOME stack, etc, we currently recommend using Snapcraft’s extension system. This preprocesses the snapcraft.yaml file to add features like content interface plugs to pull in theme data, and creating a command-chain script to make sure the app can see that theme data.

From the look of it, the Spotify snap is using none of that, so there is a limit to what we can do.

1 Like

I’ll see if we can ping Spotify to make the right change. That said, I think relying on the publishers to adjust for every visual element - theme, icon, cursor, etc - on their own is not scalable, especially since they don’t face this problem with conventional packaging.

A solution could be to important user desktop settings into a common snap space that would be accessible to all of the snaps. Now, there can be problems, like incompatible themes, incompatible color schemes, etc, but this would remedy a lot of default issues.

I will bring this up with various teams.

3 Likes

This is exactly what the content snaps that @jamesh described above do … but we cant really do anything about snaps that do not utilize them …

1 Like

Yes and no.

I was thinking something slightly different:

  • Snapd creates a per-user directory (let’s call it $SNAPDUSER).
  • Snapd scans and takes desktop-specific content, like say /usr/share/themes and copies them into $SNAPDUSER.
  • Snapd exposes - automatically and transparently - contents under $SNAPDUSER - to every snap at runtime. With layouts, these can be made to match what apps normally expect on the Linux host, e.g.: ~/.gtkrc-2.0, ~/.kde4, ~/.config, ~/.icons, and so forth.
  • Optionally, Snapd can also filter out binary-incompatible components that do not match the snap-contained environment (e.g.: themes compiled for a newer version compared to the core).

This is just a broad outline.

But this could be done without user interaction, and without rebuilding of snaps. Content snaps definitely do their job, but since they rely rebuilding/refactoring, we end up with significant divergence - fonts, dpi, scaling, theming, color scheme, etc - as a result of the snapd confinement. To that end, the broadest, most comprehensive solution would be to transparently match outside-of-snap visual elements to those inside the snap.

2 Likes

i guess there is a question for the security team in there between the lines since that could potentially allow snaps to escape their sandbox …

With regards to Spotify itself, this was launched way back in 2017 at the Seattle Snapcraft Summit. Being that the packaging is that old, and likely hasn’t had much in the way of updating in the interim, it’s understandable that it’s not using extensions or content snaps of any kind (they didn’t exist back then)

1 Like

Would it be possible to hardcode a specific theme for GTK and Qt as a fallback if the theme that’s enabled isn’t in the GTK themes snap?

Which KDE snaps are you talking about?

I’m not sure what more we can do for Spotify since that’s an issue of the snap; not of the tooling, and the snap is maintained upstream. Afaik, Spotify was notified of this issue a long time ago.