Gtk file explorer does not show removable media in left pane

Hi,

I can see that on Ubuntu 20.04 Budgie with Gimp, LibreOffice, Chromium and I guess any app’ ( my guess was totally wrong here ) using gtk-file-explorer :
LO-snap-file-explorer

On a « regular » .deb app the USB thumb would automatically appear in left pane :
gtk_file-explorer-deb

Confusing behavior as some people might think they can’t access USB devices from within their snap.

Another confusing thing here the « personal folder » anyone might expect /home/$USER there but it’s actually ~/snap/app/version_number → what’s the use ?

Did I post in the wrong category ?

did you connect the mount-observe interface of chromium ?

I did not. It’s already connected by default in chromium

mount-observe is not connected in gimp nor libreoffice.

All three are connected to removable-media.

But all three show same behavior regarding connected storage devices : they don’t appear at first sight in the left pane of the file-explorer.

Of course you may access them through the « full path » /media/$USER/label_or_uuid but gtk-file-explorer provides a quicker way in regular .deb applications.

removable-media only gives you access to the mount point, mount-observe gives you additional access to the mount (and probably also plug-) events … that said, indeed the application (likely one of the xdg-portal thingies) would have to make use of this information

Wait. Maybe mount-observe is not connected in chromium, but only available :

django@ASGARD:~$ snap connections
Interface                             Connecteur                              Prise                                                 Notes
audio-playback                        chromium:audio-playback                 :audio-playback                                       -
audio-playback                        libreoffice:audio-playback              :audio-playback                                       -
audio-record                          chromium:audio-record                   :audio-record                                         -
bluez                                 chromium:bluez                          :bluez                                                -
browser-support                       chromium:browser-sandbox                :browser-support                                      -
camera                                chromium:camera                         :camera                                               -
content[gnome-3-28-1804]              chromium:gnome-3-28-1804                gnome-3-28-1804:gnome-3-28-1804                       -
content[gtk-3-themes]                 chromium:gtk-3-themes                   adapta-gtk-snap:gtk-3-themes                          manual
content[gtk-3-themes]                 chromium:gtk-3-themes                   adapta-theme-colorpack:gtk-3-themes                   manual
content[gtk-3-themes]                 chromium:gtk-3-themes                   gtk-common-themes:gtk-3-themes                        -
content[icon-themes]                  chromium:icon-themes                    adapta-gtk-snap:icon-themes                           manual
content[icon-themes]                  chromium:icon-themes                    gtk-common-themes:icon-themes                         -
content[sound-themes]                 chromium:sound-themes                   gtk-common-themes:sound-themes                        -
content[gnome-3-28-1804]              gimp:gnome-3-28-1804                    gnome-3-28-1804:gnome-3-28-1804                       -
content[gtk-3-themes]                 gimp:gtk-3-themes                       adapta-gtk-snap:gtk-3-themes                          manual
content[gtk-3-themes]                 gimp:gtk-3-themes                       adapta-theme-colorpack:gtk-3-themes                   manual
content[gtk-3-themes]                 gimp:gtk-3-themes                       gtk-common-themes:gtk-3-themes                        -
content[icon-themes]                  gimp:icon-themes                        adapta-gtk-snap:icon-themes                           manual
content[icon-themes]                  gimp:icon-themes                        gtk-common-themes:icon-themes                         -
content[kde-frameworks-5-core18-all]  gimp:kde-frameworks-5-plug              kde-frameworks-5-core18:kde-frameworks-5-core18-slot  -
content[sound-themes]                 gimp:sound-themes                       gtk-common-themes:sound-themes                        -
content[gnome-3-28-1804]              libreoffice:gnome-3-28-1804             gnome-3-28-1804:gnome-3-28-1804                       -
content[gtk-3-themes]                 libreoffice:gtk-3-themes                adapta-gtk-snap:gtk-3-themes                          manual
content[gtk-3-themes]                 libreoffice:gtk-3-themes                adapta-theme-colorpack:gtk-3-themes                   manual
content[gtk-3-themes]                 libreoffice:gtk-3-themes                gtk-common-themes:gtk-3-themes                        -
content[icon-themes]                  libreoffice:icon-themes                 adapta-gtk-snap:icon-themes                           manual
content[icon-themes]                  libreoffice:icon-themes                 gtk-common-themes:icon-themes                         -
content[sound-themes]                 libreoffice:sound-themes                gtk-common-themes:sound-themes                        -
cups-control                          chromium:cups-control                   :cups-control                                         -
cups-control                          gimp:cups-control                       :cups-control                                         manual
cups-control                          libreoffice:cups-control                :cups-control                                         -
desktop                               chromium:desktop                        :desktop                                              -
desktop                               gimp:desktop                            :desktop                                              -
desktop                               libreoffice:desktop                     :desktop                                              -
desktop-legacy                        chromium:desktop-legacy                 :desktop-legacy                                       -
desktop-legacy                        gimp:desktop-legacy                     :desktop-legacy                                       -
desktop-legacy                        libreoffice:desktop-legacy              :desktop-legacy                                       -
gsettings                             chromium:gsettings                      :gsettings                                            -
gsettings                             gimp:gsettings                          :gsettings                                            -
gsettings                             libreoffice:gsettings                   :gsettings                                            -
home                                  chromium:home                           :home                                                 -
home                                  gimp:home                               :home                                                 -
home                                  libreoffice:home                        :home                                                 -
joystick                              chromium:joystick                       :joystick                                             -
network                               chromium:network                        :network                                              -
network                               gimp:network                            :network                                              -
network                               libreoffice:network                     :network                                              -
network-bind                          chromium:network-bind                   :network-bind                                         -
network-bind                          libreoffice:network-bind                :network-bind                                         -
opengl                                chromium:opengl                         :opengl                                               -
opengl                                gimp:opengl                             :opengl                                               -
opengl                                libreoffice:opengl                      :opengl                                               -
password-manager-service              chromium:password-manager-service       :password-manager-service                             manual
personal-files                        chromium:chromium-config                :personal-files                                       -
pulseaudio                            libreoffice:pulseaudio                  :pulseaudio                                           -
removable-media                       chromium:removable-media                :removable-media                                      manual
removable-media                       gimp:removable-media                    :removable-media                                      manual
removable-media                       libreoffice:removable-media             :removable-media                                      -
screen-inhibit-control                chromium:screen-inhibit-control         :screen-inhibit-control                               -
screen-inhibit-control                libreoffice:screen-inhibit-control      :screen-inhibit-control                               -
system-files                          chromium:etc-chromium-browser-policies  :system-files                                         -
system-packages-doc                   chromium:system-packages-doc            :system-packages-doc                                  -
u2f-devices                           chromium:u2f-devices                    :u2f-devices                                          -
unity7                                chromium:unity7                         :unity7                                               -
unity7                                gimp:unity7                             :unity7                                               -
unity7                                libreoffice:unity7                      :unity7                                               -
upower-observe                        chromium:upower-observe                 :upower-observe                                       -
wayland                               chromium:wayland                        :wayland                                              -
wayland                               gimp:wayland                            :wayland                                              -
wayland                               libreoffice:wayland                     :wayland                                              -
x11                                   chromium:x11                            :x11                                                  -
x11                                   gimp:x11                                :x11                                                  -
x11                                   libreoffice:x11                         :x11                                                  -
django@ASGARD:~$ 
django@ASGARD:~$ snap connections chromium 
Interface                 Connecteur                              Prise                                Notes
audio-playback            chromium:audio-playback                 :audio-playback                      -
audio-record              chromium:audio-record                   :audio-record                        -
bluez                     chromium:bluez                          :bluez                               -
browser-support           chromium:browser-sandbox                :browser-support                     -
camera                    chromium:camera                         :camera                              -
content[gnome-3-28-1804]  chromium:gnome-3-28-1804                gnome-3-28-1804:gnome-3-28-1804      -
content[gtk-3-themes]     chromium:gtk-3-themes                   adapta-gtk-snap:gtk-3-themes         manual
content[gtk-3-themes]     chromium:gtk-3-themes                   adapta-theme-colorpack:gtk-3-themes  manual
content[gtk-3-themes]     chromium:gtk-3-themes                   gtk-common-themes:gtk-3-themes       -
content[icon-themes]      chromium:icon-themes                    adapta-gtk-snap:icon-themes          manual
content[icon-themes]      chromium:icon-themes                    gtk-common-themes:icon-themes        -
content[sound-themes]     chromium:sound-themes                   gtk-common-themes:sound-themes       -
cups-control              chromium:cups-control                   :cups-control                        -
desktop                   chromium:desktop                        :desktop                             -
desktop-legacy            chromium:desktop-legacy                 :desktop-legacy                      -
gsettings                 chromium:gsettings                      :gsettings                           -
home                      chromium:home                           :home                                -
joystick                  chromium:joystick                       :joystick                            -
mount-observe             chromium:mount-observe                  -                                    -
mpris                     -                                       chromium:mpris                       -
network                   chromium:network                        :network                             -
network-bind              chromium:network-bind                   :network-bind                        -
network-manager           chromium:network-manager                -                                    -
opengl                    chromium:opengl                         :opengl                              -
password-manager-service  chromium:password-manager-service       :password-manager-service            manual
personal-files            chromium:chromium-config                :personal-files                      -
pulseaudio                chromium:pulseaudio                     -                                    -
raw-usb                   chromium:raw-usb                        -                                    -
removable-media           chromium:removable-media                :removable-media                     manual
screen-inhibit-control    chromium:screen-inhibit-control         :screen-inhibit-control              -
system-files              chromium:etc-chromium-browser-policies  :system-files                        -
system-packages-doc       chromium:system-packages-doc            :system-packages-doc                 -
u2f-devices               chromium:u2f-devices                    :u2f-devices                         -
unity7                    chromium:unity7                         :unity7                              -
upower-observe            chromium:upower-observe                 :upower-observe                      -
wayland                   chromium:wayland                        :wayland                             -
x11                       chromium:x11                            :x11                                 -
django@ASGARD:~$

Confusion of mine here ?

well, does the volume show up if you connect it ?

[ edit ] it does show up in left pane of gtk-file-explorer in chromium. I have to browse the full path ( other places, computer, /media… which is enough to lose new users ).

Gimp or libreoffice make no mention at all of mount-observe :

django@ASGARD:~$ snap connections gimp
Interface                             Connecteur                  Prise                                                 Notes
content[gnome-3-28-1804]              gimp:gnome-3-28-1804        gnome-3-28-1804:gnome-3-28-1804                       -
content[gtk-3-themes]                 gimp:gtk-3-themes           adapta-gtk-snap:gtk-3-themes                          manual
content[gtk-3-themes]                 gimp:gtk-3-themes           adapta-theme-colorpack:gtk-3-themes                   manual
content[gtk-3-themes]                 gimp:gtk-3-themes           gtk-common-themes:gtk-3-themes                        -
content[icon-themes]                  gimp:icon-themes            adapta-gtk-snap:icon-themes                           manual
content[icon-themes]                  gimp:icon-themes            gtk-common-themes:icon-themes                         -
content[kde-frameworks-5-core18-all]  gimp:kde-frameworks-5-plug  kde-frameworks-5-core18:kde-frameworks-5-core18-slot  -
content[sound-themes]                 gimp:sound-themes           gtk-common-themes:sound-themes                        -
cups-control                          gimp:cups-control           :cups-control                                         manual
dbus                                  -                           gimp:dbus-gimp                                        -
desktop                               gimp:desktop                :desktop                                              -
desktop-legacy                        gimp:desktop-legacy         :desktop-legacy                                       -
gsettings                             gimp:gsettings              :gsettings                                            -
home                                  gimp:home                   :home                                                 -
network                               gimp:network                :network                                              -
opengl                                gimp:opengl                 :opengl                                               -
removable-media                       gimp:removable-media        :removable-media                                      manual
unity7                                gimp:unity7                 :unity7                                               -
wayland                               gimp:wayland                :wayland                                              -
x11                                   gimp:x11                    :x11                                                  -



django@ASGARD:~$ snap connections libreoffice 
Interface                 Connecteur                          Prise                                Notes
audio-playback            libreoffice:audio-playback          :audio-playback                      -
bluez                     libreoffice:bluez                   -                                    -
content[gnome-3-28-1804]  libreoffice:gnome-3-28-1804         gnome-3-28-1804:gnome-3-28-1804      -
content[gtk-3-themes]     libreoffice:gtk-3-themes            adapta-gtk-snap:gtk-3-themes         manual
content[gtk-3-themes]     libreoffice:gtk-3-themes            adapta-theme-colorpack:gtk-3-themes  manual
content[gtk-3-themes]     libreoffice:gtk-3-themes            gtk-common-themes:gtk-3-themes       -
content[icon-themes]      libreoffice:icon-themes             adapta-gtk-snap:icon-themes          manual
content[icon-themes]      libreoffice:icon-themes             gtk-common-themes:icon-themes        -
content[sound-themes]     libreoffice:sound-themes            gtk-common-themes:sound-themes       -
cups-control              libreoffice:cups-control            :cups-control                        -
desktop                   libreoffice:desktop                 :desktop                             -
desktop-legacy            libreoffice:desktop-legacy          :desktop-legacy                      -
gsettings                 libreoffice:gsettings               :gsettings                           -
home                      libreoffice:home                    :home                                -
network                   libreoffice:network                 :network                             -
network-bind              libreoffice:network-bind            :network-bind                        -
opengl                    libreoffice:opengl                  :opengl                              -
pulseaudio                libreoffice:pulseaudio              :pulseaudio                          -
removable-media           libreoffice:removable-media         :removable-media                     -
screen-inhibit-control    libreoffice:screen-inhibit-control  :screen-inhibit-control              -
unity7                    libreoffice:unity7                  :unity7                              -
wayland                   libreoffice:wayland                 :wayland                             -
x11                       libreoffice:x11                     :x11                                 -
django@ASGARD:~$

you might perhaps need to restart the app or re-plug the disk or some such … not sure if that would be enough and as i said above the app itself (xdg-portal-whatnot) might be missing bits and pieces here … what i want to express is that it is likely neither a chromium issue nor a snap issue in itself, the file selector comes from a xdg-portal-* deb on your system …

gimp and libreOffice simply do not have the interface defined , perhaps they should

Why don’t the gtk-file-explorer act in snap as exactly as it does in .deb ?
And I wont ever say gtk-file-explorer is ok in .deb ( no thumbnail grid view for quickly choosing pictures, a 15 years old bug ).

Back to topic : restart libreoffice or gimp, restart pc, unplug/plug usb device… it never appears at first sight in left pane.

It’s a common « report » in forums : people think snap-app can’t access usb-device because they don’t see it where they are used to expect it.

Maybe. I don’t know. Why an end-user should care about that ? All what new user sees is « when I use snap I can’t quickly find my usb-thumb ». So where to ask some help or improvement here ?

django@ASGARD:~$ dpkg -l | grep xdg
ii  python3-xdg                                   0.26-1ubuntu1                           all          Python 3 library to access freedesktop.org standards
ii  xdg-dbus-proxy                                0.1.2-1                                 amd64        filtering D-Bus proxy
ii  xdg-desktop-portal                            1.6.0-1                                 amd64        desktop integration portal for Flatpak and Snap
ii  xdg-desktop-portal-gtk                        1.6.0-1build1                           amd64        GTK+/GNOME portal backend for xdg-desktop-portal
ii  xdg-user-dirs                                 0.17-2ubuntu1                           amd64        tool to manage well known user directories
ii  xdg-user-dirs-gtk                             0.10-3                                  amd64        tool to manage well known user directories (Gtk extension)
ii  xdg-utils                                     1.1.3-2ubuntu1.20.04.2                  all          desktop integration utilities from freedesktop.org
django@ASGARD:~$ 

so you should file a bug against the xdg-desktop-portal deb in launchpad i guess …

Following your recommendation :

2 Likes

Note that GIMP, being a GTK2 application, does not have access to the XDG-desktop-portal so it can only show files the snap is able to see through the confinement. I’ll experiment with the mount-observe interface to see if that helps…

There is no problem for accessing files : removable-media does its job.

The problem here is only about « where » the usb-thumb appears in gtk-file-explorer ( inside gimp, libreoffice or else ) : it appears nowhere at first sight, it should appear ( as in : should already be there ) in the left pane, exactly as it does when using same app’s ( gimp, libreoffice, chromium or else ) in legacy .deb package.

Inside snap gtk-file-explorer you have to browse the full path through :
other places → computer → /media → /$USER → /uuid_or_label_usb_thumb
The full path is needed as it also does not appear in « other places »

It’s just the « shortcut » mechanism that’s missing in the left pane, not the target resource in itself.

gtk-FE-deb-snap
↑ all these at the exact same moment, usb-thumb is already mounted in expected /media/$USER/Ventoy

Yes, and as I said, this is due to GIMP being GTK2 which does not support the XDG-desktop-portal.

That’s LibreOffice on the pictures above, also GTK2 ?

Same behavior with Chromium.

You’re certainly right about XDG-desktop-portal - I dunno am just a stupid end user on desktop pc - but this « silly » regression in UI/UX exists from day one with snap’s and creates confusion.

And it’s been years long in legacy .deb app’ that gtk-file-explorer shows « mounted removable media » in that left pane.

Anyway let’s hope it’s not a « big » thing to fix and your intuition / doubt will find the answer.

I did not check how it works in flatpak - last time I checked things like pixel-saver/global-menu did not work with flatpak app’s, enough for me to lose interest. Should I test ?

well, it apparently only took 6 years that someone created a bug for it …

Unfortunately, your instinct is right, this is a big problem to tackle. It needs one of two things depending upon which app is impacted.

For apps that use the GTK2 file picker we need GTK2 to be updated to support the desktop-portal, which is unlikely to happen considering the age of GTK2 and that we’re now onto GTK4 upstream.

For apps that use a custom file picker that they ship inside their app’s code we have less chance of fixing this because the desktop-portal doesn’t pass data about the files on your system back to the app - it only sends the actual file opened. It is possible we could implement an API to expose this data, but that is an information leak that allows the app to see beyond it’s permitted confinement boundary.

For GIMP in specific to my knowledge as the publisher of that snap the file dialogs are both GTK2 and customised within the GIMP code. So both of these scenarios apply somewhat: the file picker is customised so we have the problem of not being able to see the mounted drives’ information (mount-observe may help - I still need to make time to test that), and also GIMP is GTK2-based which means even if it weren’t using a customised file picker we’d still require GTK2 to be updated to support the desktop-portal.

The good news is that most apps using Qt5 or GTK3 should support the desktop-portal natively.

1 Like

Thanks @lucyllewy for these explanations, really.

So one may wonder why gtk-file-explorer is so « late » ? Or even wonder why is there such a file picker : using system default « real » file-explorer might be enough ? ( and maybe more comfortable regarding a grid view for large thumbnails that never existed in gtk-file-explorer ? )

Or… should there be a versatile common snap-file-picker that any snap app’ could connect to /interface with ?

This is what the XDG-desktop-portal does that was mentioned earlier - there is a service that runs in every logged-in-user’s desktop session that provides a “dbus” api (a communication channel) to any app or snap that knows how to use it - when an app inside a snap calls through the snap confinement to the dbus api the service receives the call and pops up your desktop’s default file picker for you to choose any file on your system. Because the file picker ran by this service is outside of snap confinement it can see everything on your pc and behave the same way as a file picker in a non-snapped app. When you make a selection in the file picker it does a magic dance to make that file accessible to the snap that asked for the file picker to be shown.

1 Like