Open alexmo1997 opened 1 year ago
Thanks for opening the issue. I am happy to remove it if it doesn't break the app. Have you already tested how KiCad behaves without the filesystem=home permissions?
If you create a PR removing the permissions, a test build will automatically be created that could easily be tested.
Weirdly, it doesn't, even though wxwidgets supports using the xdg documents portal afaik. Could be due to a old wxwidgets version or using the wrong APIs, that's going to need more investigation.
I suspect the reason is that a KiCad project consists of multiple files. While you can easily File-Open a project file (using the xdg portal), or double click on a schematic file from you file browser, that doesn't give KiCad permissions to also access the board file, footprints, symbols, and all other project related files needed to work correctly. Those are loaded automatically by the individual tool using traditional file opening calls, which are then blocked as they don't go through the portal.
I am afraid this is not something that we can fix only by altering the flathub flatpak manifest (this repo), but it is a topic that should be brought up with the KiCad main repo at https://gitlab.com/kicad/code/kicad . I'd suggest you file an issue there where it will be seen by the main KiCad Devs.
Yet I don't think that it is an easy to solve task, but I assume it will need major re-enigineering of the whole set of KiCad applications.
The xdg portal doesn't allow a concept like "auxillary files" next to the file you actually opened through a portal, yet (see https://github.com/flatpak/xdg-desktop-portal/issues/463).
At least in the short term I don't think that we can get rid of the filesystem=home permission. Yet I am leaving this open for further discussion.
FWIW we are using the most recent stable wxWidgets version, which is 3.2.2.1 at the time of writing this comment.
Using filesystem=home is not really a good practice as it allows access to the whole user home directory which is not needed here.