gMTP logo

Developing gMTP - Flatpak (1)

2026-08-06 by Roman Yepishev.

As of commit 8d636c, gMTP can now run in Flatpak sandbox - file uploads, downloads and Drag & Drop works.

However, I am not uploading it to Flathub for now as all of the issues with the codebase blocking the UI thread remains. Once that is fixed, the app will be published.

This was an interesting experience. While I've done debian and RPM packages in the past, building dependencies as part of your own build isn't something that I've managed myself in the past. This definitely puts the developer of the final binary on the hook for managing dependencies and rebuilding things when vulnerabilities are found.

It wasn't just the packaging. In order for the sandboxed apps to talk to the host filesystem, all of the file choosers had to be replaced with GtkFileChooserNative and I had to get rid of preferences that stored upload and download directories. Since the permission to access the file or folder is granted at the moment user chooses the file, and does not persist, storing default isn't useful.

Flatpak as a developer platform is a great resource to get the app to build, GtkFileChooserNative describes the native File Choosers, and GNOME/gtk!5554 by @matthiasc was the change that made Drag & Drop work for Gtk3 apps.