Closed Bug 1646499 Opened 2 months ago Closed 2 months ago

GTK_USE_PORTAL evaluated incorrectly

Categories

(Core :: Widget: Gtk, defect)

defect

Tracking

()

RESOLVED FIXED
mozilla79
Tracking Status
firefox79 --- fixed

People

(Reporter: m.weghorn, Assigned: m.weghorn)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0

Steps to reproduce:

start Firefox with environment variable GTK_USE_PORTAL=0 set to avoid bug 1517074

Actual results:

Bug 1517074 was still reproducible with gtk 3.24.20 in use.

Expected results:

Bug 1517074 should not have occured due to non-native Gtk file dialog being used, s. bug 1517074 for more details.

While the comment for 'GetFlatpakPortalEnv' says
"We use the same code as gtk_should_use_portal() to detect
if we're in flatpak env", this was not actually true, since the
code only checked whether the environment variable 'GTK_USE_PORTAL'
was set at all, ignoring its value, while the gtk implementation
checks that it is set and that the first character is '1'
(which was already true in the gtk as of the commit that the
comment refers to, [1]).

Adapt it likewise here.

I ran into this while looking at why bug 1517074 still occured
with the native file chooser presumably having been disabled by
starting Firefox using

GTK_USE_PORTAL=0 firefox

with gtk 3.24.20 that does not yet have the fix for gtk issue [2].

[1] https://github.com/GNOME/gtk/blob/e0ce028c88858b96aeda9e41734a39a3a04f705d/gtk/gtkprivate.c#L272
[2] https://gitlab.gnome.org/GNOME/gtk/-/issues/1820

Assignee: nobody → m.weghorn
Pushed by rmaries@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8226410d91fd
Fix GTK_USE_PORTAL env variable evaluation. r=stransky
Status: UNCONFIRMED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla79
You need to log in before you can comment on or make changes to this bug.