Closed Bug 1646499 Opened 2 years ago Closed 2 years ago

GTK_USE_PORTAL evaluated incorrectly


(Core :: Widget: Gtk, defect)




Tracking Status
firefox79 --- fixed


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



(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].


Assignee: nobody → m.weghorn
Pushed by
Fix GTK_USE_PORTAL env variable evaluation. r=stransky
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla79
You need to log in before you can comment on or make changes to this bug.