-
-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use org.freedesktop.portal.OpenURI
for Providing the AppChooser
#1162
Conversation
makes the "Open In…" menu works on Flatpak.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments but otherwise this works as expected and the code looks good.
Added a new property on |
# Conflicts fixed in: # data/io.elementary.code.appdata.xml.in
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for overlloking this for so long.
Is there a reason for the context menu for folder items to differ from that for file items (compared to master running natively)? The former has an ellipsis and launches straight into the AppChooser whereas the latter has a submenu offering an immediate option to open in the FileManager as well as an "Other applications" option (which offers the File Manager).
Otherwise this is looking good. Will changing to the OS7 platform require any changes?
Since we don't have access to the AppInfo inside the sandbox, the submenu in In master, the file manager entry is created manually by querying the default AppInfo for
You say the flatpak runtime? since we are using Gtk3 here, no changes should be needed. For Gtk4, we need to adapt the |
I still do not really see why a fileitem and a folderitem should have a different "Open in..." submenu. Can we not offer a "Open in FIleManager" item for folder items as well as file items? It could make sense to offer a "New Window" option for folders as well as files but that is outside the scope of this PR. |
we can, but it's less useful for folders, since the AppChooser will show the FileManager anyway. that not the case for files.
Well, projects folders aren't unique per-window, so any new window will already have all the folders anyway. |
I see. I guess it can be left to the UX team to decide whether the context menu needs redesign - it it is not blocking for this PR anyway.
Yes, we would have to implement different projects per window for that to be useful. |
Sorry for taking so long for reviewing it, but it doesn't seems to be the solution we want here as the portal is already implemented elsewhere. |
Implementing the OpenURI portal inside Code is not the way to go, a portal implementation has to be out of the container |
The only way to trigger a portal for opening a file would be:
|
@danrabbit We should make a blog post about how app developers should replace the in-app "Open In…" menus with something that works in containers |
Sorry, but I think you misunderstood the PR, we aren't implementing the OpenURI portal here, but using it directly. Neither Glib or GTK expose the |
@tintou yeah the problem is there isn't a replacement portal yet 😅 elementary/portals#38 |
@danrabbit So should this PR be blocked pending a wrapper for the OpenUri portal appearing in Gtk or Granite, which it can then use? |
@jeremypw it seems like generally the OpenURI Portal probably isn't the appropriate portal to use here long-term anyways so this is more of a work around to preserve some functionality inside the sandbox. The proper long-term solution would be to create a sharing portal that's actually designed for this. Since we're not shipping Code in a Flatpak currently, I'm not sure this specific workaround is a huge priority? We could probably wait for a new portal? |
The only "Open in ..." functionality I use is "Open in Terminal". |
In view of this I think this can be closed and the matter reviewed when we come to FlatPak Code (not soon afaik) |
supersedes #1029
Make use of the OpenURI portal for showing an AppChooser and for opening the file on the File Manager.
This one can be used on host too.