Desktop App Support - GTK

Snapping GTK applications

Graphical applications which use GTK require additional libraries, environment configuration and interfaces to function correctly inside a snap. Follow the instructions for the version of GTK your application uses.

[legacy] Snaps that don’t use base

The gnome-3-28 extension only works with snaps that use base: core18. There are some tools that can help you if your snap doesn’t use base: core18, however, it is preferred to upgrade your snap to use base: core18.

1 Like

I think it would be helpful to link this back to Bundling runtime dependencies - Libraries

Should there also be minimal example to define .desktop file integrated into the snapcraft.yaml. Gtk apps need to have a .desktop entry in order to run correctly in snap.

3 Likes

Great article, I would like to see some info on using the gnome-platform content snap though.

The unofficial Snapcrafters Template Plus has implemented an example desktop entry: https://github.com/Lin-Buo-Ren/snapcrafters-template-plus/blob/master/snap/gui/my-awesome-app.desktop

Does [desktop-gtk3] still apply when using a base? such as base: core18 ?

When using a base, I get an error: Cannot find the definition for part ‘desktop-gtk3’

When using bases, snapcraft no longer support remote parts. You need to redefine the part. You can see below for an example. Going forward snapcraft will include an extension for “gnome” which provides what the remote part did, however that isn’t done yet.

2 Likes

Desktop App Support - GTK (Rewrite) - HackMD

I would like to split the topic for different Gtk+ releases (2/3) as one usually just need one of them.