[Webkit-unassigned] [Bug 197947] [GTK] Should use light theme unless website declares support for dark themes in color-schemes property

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jan 29 06:54:49 PST 2020


https://bugs.webkit.org/show_bug.cgi?id=197947

--- Comment #25 from Michael Catanzaro <mcatanzaro at gnome.org> ---
(In reply to Carlos Garcia Campos from comment #22)
> > > Source/WebKit/WebProcess/gtk/WebProcessMainGtk.cpp:60
> > >          gtk_init(nullptr, nullptr);
> > 
> > GTK actually uses a library constructor to unset environment variables, to
> > avoid crashes that could occur if it were to do so in gtk_init(). On
> > Windows, where library constructors aren't available, it risks crashing.
> 
> I don't understand this.

It's simple! gtk_init() is a library call, so it has no way to guarantee that it will be called before the application creates a secondary thread. And you know that you cannot mutate the environment after threads are created, because setenv() and unsetenv() are "MT-Unsafe const:env" (meaning: cannot be used in multithreaded programs unless you guarantee no other threads ever use getenv(), which is wildly unrealistic and never possible for a library to guarantee). I'm sure you're well aware of that, because we discussed it many times in the past. :) So by using a library constructor, GTK guarantees it can call unsetenv() before application code ever runs. The only way this fails is if another library uses a library constructor that decides to initialize threads.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20200129/8f9c4a31/attachment.htm>


More information about the webkit-unassigned mailing list