elementary / switchboard

Extensible System Settings app designed for elementary OS
https://elementary.io
GNU Lesser General Public License v2.1
49 stars 15 forks source link

Application: force use portals #221

Closed danirabbit closed 2 years ago

danirabbit commented 3 years ago

This forces Switchboard to use portals even though it's not in a sandbox. What this means practically is that Switchboard plugs will use the native file chooser instead of the one from Gtk

davidmhewitt commented 3 years ago

Remember that this will potentially stop notifications and deleting files from working for the same reasons as https://github.com/elementary/default-settings/pull/215 and possibly any number of other random issues.

Probably nothing in switchboard sends notifications, but I imagine one of the plugs might need to be able to delete files.

davidmhewitt commented 3 years ago

My bad, it's not deleting files, it's trashing files, which we probably don't do in switchboard.

Either way, this environment variable causes GLib and GTK to use portals for a bunch of stuff which could potentially cause issues with stuff now, or issues with stuff in the future as more portals come along.

So I'm not sure this is a good thing to start adding in a bunch of places and then we'll wonder why random things don't work in a year or two.

jhaygood86 commented 3 years ago

One thing that is related and interesting:

GTK's documentation says this:

However, the very first thing the Portal implementation does is check for gdk_should_use_portal, which only returns true if the app is sandboxed OR that environment variable is in place... which is very different behavior from the documentation.

danirabbit commented 2 years ago

I'm gonna merge this into the gtk4 port so we have plenty of time to watch for issues :)