GTK 2 theme problem on KDE

Hi all,

I maintain PrusaSlicer Snap and a user filed a ticket on GH about theming problems on KDE. I was able to reproduce the issue on a VM, using Kubuntu 18.04. The application uses GTK 2 toolkit for UI.

From my understanding (and I’m no expert, by any means) problem arises from GTK using mainly XSettings for theme info; apparently, KDE (Kubuntu, at least) doesn’t use it and, instead, rely on ~/.gtkrc-2.0 file, through KDE GTK config. The file isn’t exported to Snap by any desktop-oriented interface I know of - personal-files might work, but I believe it’s not meant to be used like this.

Don’t want to reinvent the wheel, so question is: is there a known, documented way of treating this?

As a workaround, user can copy ~/.gtkrc-2.0 to ~/snap/prusa-slicer/current/, but this is suboptimal (linking doesn’t seem to work either, because of containment, I guess).

Gentle bump! :slight_smile:

Hey @jamesh , sorry for pulling you in, but I believe you have some experience on this subject. Any tips?

I’m not deeply familiar with current KDE, but it looks like the kde-gtk-config component (packaged as kde-config-gtk-style on Ubuntu) should be able to expose the theme selection via xsettingsd.

On Ubuntu 20.04, xsettingsd is listed as a “Recommends” dep for kde-config-gtk-style so would normally be installed. It doesn’t look like the dependency is there in 18.04 though. You could try installing xsettingsd manually to see if it helps, but I’m not sure whether the support code on the KDE side existed back then or not.

Thanks James, I’ll give it a shot and let you know.

Didn’t work, James. Won’t spent too much time on this though, since new version will update to GTK 3 and seems to work (I tested and it was fine).

Thanks for your help.