Open Bug 1832319 Opened 1 year ago Updated 10 months ago

The external applications are not visible in the Select Applications for flatpak builds

Categories

(Core :: Widget: Gtk, defect)

Firefox 114
Desktop
Linux
defect

Tracking

()

Tracking Status
firefox114 --- affected

People

(Reporter: danibodea, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Note

  • When the user sets specific file types to be asked when opened, then loads the specific file type, Fx will show the "Opening name.type" window to help you choose how to open it. If the user selects the "Open with" radio button, opens the drop-down and clicks on "Other...", the "Select Application" window is also displayed. Here, the only application listed is Firefox.
  • This issue does NOT occur on non flatpak installations.

Found in

  • Beta v114.0b2

Affected versions

  • Beta v114.0b2

Tested platforms

  • Affected platforms: Ubuntu 22
  • Unaffected platforms: Windows/Mac

Steps to reproduce

  1. Install flatpak build
  2. Set PDFs to "always ask" how to open in preferences.
  3. Load a PDF file.
  4. "Opening" modal displayed; Select "Open with" radio button, then select "Other..." from the drop-down.
  5. "Select Application" modal displayed;

Expected result

  • many applications are listed.

Actual result

  • Only Fx is listed.

Regression range

  • unknown.

Additional notes

  • dows NOT occur with non flatpak builds.

This picker is provided by GTK, I believe, so moving over there. Did this not happen with earlier versions of flatpak Firefox?

Blocks: flatpak
Component: File Handling → Widget: Gtk
Flags: needinfo?(dbodea)
Product: Firefox → Core

Yes, the gtk creates the list of applications from looking up the .desktop files on the system. The application running in flatpak does not have the access to the .desktop files on the host system so the list is beside Firefox empty. The Other... is basically unusable under flatpak. The similar behavior gives System Handler. It opens the Open With... dialog.

Under flatpak we could probably remove the Other... option from dropdown menu (which will make the dropdown menu contains only one option) because there's no plan to give the flatpak application list of installed application - due to privacy reasons.

Flags: needinfo?(dbodea)

This also relates to the General/Applications settings. It's even more confusing because the file open portal is used to browse for the custom executable which obviously is not reachable under flatpak when trying to later open the file with specific mime type.

(In reply to Jan Horak [:jhorak] from comment #3)

This also relates to the General/Applications settings. It's even more confusing because the file open portal is used to browse for the custom executable which obviously is not reachable under flatpak when trying to later open the file with specific mime type.

Is this unique to flatpak, ie does the same not happen under snap?

And is there really no intention for flatpak to allow opening the file with any other application? Does opening with the system handler still work, or also not? Can we obtain the name and icon of this system handler, or is it going to be "system handler" or something similar, no matter what application it is?

Is any other UI affected, other than the settings pages, and the "what do you want to do with this file" dialog?

This all seems very user-hostile. :-(
We will probably need some kind of support page that we can point people to to explain why core features of the browser do not work properly under flatpak, to use as a replacement for the UI that normally offers this possibility.

Flags: needinfo?(jhorak)

(In reply to :Gijs (he/him) from comment #4)

(In reply to Jan Horak [:jhorak] from comment #3)

This also relates to the General/Applications settings. It's even more confusing because the file open portal is used to browse for the custom executable which obviously is not reachable under flatpak when trying to later open the file with specific mime type.

Is this unique to flatpak, ie does the same not happen under snap?

It's the same for snap AFAIK - looking at the firefox snap right now.

And is there really no intention for flatpak to allow opening the file with any other application? Does opening with the system handler still work, or also not? Can we obtain the name and icon of this system handler, or is it going to be "system handler" or something similar, no matter what application it is?
For flatpak/snap the preferred way is to use portal org.freedesktop.portal.OpenURI [1], specifically OpenFile method. Alternatively the gtk_show_uri can be used - which basically use the same portal but using method OpenURI.

Using the System handler - which is implemented by gtk_show_uri in Firefox basically shows the list of the available applications as shown in the first screenshot in this report. But Firefox is unable to get any data from the request, like which application has been chosen or its icon etc.

When using OpenFile method it's up to the portal how is the choice remembered. Currently when the same application is chosen for the three times in a row the target application is remembered and the dialog does not show again. It partially resembles the Android application chooser where the system handles it based on mime type.

Is any other UI affected, other than the settings pages, and the "what do you want to do with this file" dialog?

I'm not aware of anything else.
In the Applications settings the Use other... is most likely unusable - as long as the Firefox does not have access to the host filesystem. Other options could stay, like Always ask, Save File, Open in Firefox and for the uris the handlers which are opened in Firefox like mailto: -> Use Gmail.

This all seems very user-hostile. :-(

Probably is, it forces us to pass the functionality of the mime type handling to the system/portal.

We will probably need some kind of support page that we can point people to to explain why core features of the browser do not work properly under flatpak, to use as a replacement for the UI that normally offers this possibility.

[1] https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.freedesktop.portal.OpenURI

Flags: needinfo?(jhorak)
Severity: S2 → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: