elementary / default-settings

Default settings for elementary OS
GNU General Public License v3.0
39 stars 28 forks source link

Revert "Force the use of the portal by default for native GTK widgets" #215

Closed danirabbit closed 3 years ago

danirabbit commented 3 years ago

Reverts elementary/default-settings#204

Fixes https://github.com/elementary/notifications/issues/109 Fixes https://github.com/elementary/wingpanel-indicator-notifications/issues/179 Fixes https://github.com/elementary/files/issues/1553

Turns out this is breaking some other things like notifications, so it seems its better to not do this and just deal with the two different filechoosers for now

davidmhewitt commented 3 years ago

@tintou I understand this was put in to force GTK to use the filechooser portal instead of its own built in widget? Meaning that we didn't need to include the module that hooked and modified the dialog?

It turns out that this makes lots of things in GTK and GLib use portals when they wouldn't normally. For example, notifications are being sent via the portal (which means they don't include the desktop ID) and trashing files seems to want to use the trash portal.

I've looked at the notifications code in GLib and it looks like the only option we'd have if we wanted to keep this environment variable is to patch GLib (in os-patches) to not use/support the notifications portal. We could in theory patch out all portal support in GTK and GLib (except from the file chooser), since there will be a different instance of GLib/GTK that did support portals in sandboxed applications where we want them to actually use portals.

I'm assuming we don't really want to carry patches for GTK and GLib though. I also spoke to Dan about this briefly on the standup call, and I think the opinion was that we'd rather have two different looking file choosers than keep finding weird bugs caused by using portals outside of a sandbox. So I'll approve this and if there's a better solution for the file chooser, we can revisit it later.

tintou commented 3 years ago

The intend of the GTK_USEPORTAL variable was indeed to use the portal in GTK because its occurences made sense, I had no idea that it was also the environment variable used by GLib itself (and it looks very wrong to use a GTK* variable there…) so let's remove this for now and flatpak all our apps.