Closed wjt closed 3 years ago
Glancing at the code:
open_uri
assumes that if a supposed "URI" does not contain a :
, then it can be turned into one by prepending file://
. This is not true in the case of relative paths. (The precondition is also not true: :
is a perfectly valid character in a filename, but /home/wjt/foo:bar.txt
is not a URI.) https://github.com/bleakgrey/tootle/blob/master/src/Desktop.vala#L8-L9 download
attempts to download to the xdg downloads dir. But the Flatpak of Tootle doesn't have access to that. xdg-user-dir DOWNLOADS
returns the path to my homedir. I agree with #279 that Tootle should download to cache. It's desirable to me that Tootle can't access all my other downloaded files.Having similar issue, but instead of failing silently, I get "Error: Operation not supported", despite having sxiv as my default image viewer
You can work around this by granting Tootle access to your home directory.
The path where the file is downloaded becomes truncated to just the file name when the environment variable used isn't available in the sandbox, then the file:// prefix is added and the resulting string is passed to a program outside the sandbox.
As an aside, here's a funny thing you can do once you can open images: Click on an attached image twice, fast enough that your second click is registered before the file has been downloaded. You'll get an error saying that the file couldn't be opened because it exists.
You can work around this by granting Tootle access to your home directory.
In case it helps somebody, (and in case this is not the right way to do it..), I share here the command that helped me do it and did the trick for me :
sudo flatpak override com.github.bleakgrey.tootle --filesystem=home
What should happen:
I believe that the intended behaviour is: clicking on an image should open it in my system image viewer.
What happened instead:
Nothing visible.
Looking with Bustle I can see that Tootle calls the following portal method:
Notice the malformed URI which appears to be
file://
concatenated to a relative filepath.If I enter the running Tootle's sandbox I can see that the file (and some others I tried) have been saved to (what Tootle believes to be) my homedir:
How to reproduce:
Build context:
Logs: