Handling cameras with no auto-mount on Fedora 31



Hello,

On Fedora 31 I have noticed that at some point the mounting behavior
of cameras changed, as far as I can tell.

Previously, GIO would attempt to mount a camera (for all practical
purposes) as soon as it was inserted.

Now, GIO notifies Gio.VolumeMonitor that the camera volume has been
added, but the camera remains unmounted. I have no idea if this is by
accident or design.

(Perhaps I changed a setting while testing that affected this
behavior, but I don't recall that. And in any case, changing the
Removable Media setting in Gnome to "Open Folder" has no effect.)

In my opinion it's a welcome change. Only one libgphoto2 process at a
time can access the camera. If GIO automounts a camera (and the user
or another program does not subsequently manually unmount it), any
other process using libghoto2 cannot access it until GIO unmounts it.

My question is: how is an application supposed to query GIO to
ascertain if GIO will auto-mount the camera volume or not?
Unfortunately, when the volume is added, Gio.Volume.should_automount()
is always true, regardless of whether the volume will subsequently be
auto-mounted or not.

My application had previously assumed that when GIO is active, all
cameras would be auto-mounted, and then it would automatically unmount
them so it could access the camera directly using libgphoto2. The way
my applications handles this new behavior as seen in Fedora 31 is to
wait 3 seconds and check if the camera had been auto-mounted or not.
If not, it access the camera. I'm curious if there is a better
approach.

Thanks.

Best,
Damon

-- 
http://www.damonlynch.net


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]