Created attachment 402481 [details] A patch for this issue modifying "Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp" WebKitGtk has support for automatic detection of dark mode when it comes to GTK themes with the "-dark" and ":dark" suffixes. However, when using GTK themes that end with "-Dark" or ":Dark", this is not the case. This affects many themes like "Arc" and "Flat-Remix", so adding this funcitonality would be very helpful. I have attached to this bug report a possible patch for this, however I am not sure if any other parts of the library need to be modified other than "Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp". If that is the case, then my patch should be a good example of what needs to be done.
:Dark doesn't make any sense as that refers to GTK variants and AFAIK nothing has used a variant by that name. -Dark seems like a harmless change although Arc-Dark is a light theme.
Created attachment 402525 [details] Updated patch
(In reply to Patrick Griffis from comment #1) > :Dark doesn't make any sense as that refers to GTK variants and AFAIK > nothing has used a variant by that name. > > -Dark seems like a harmless change although Arc-Dark is a light theme. Ah, sorry for the mix up. Here's a better patch with that information in mind... Hope it can be easily applied!
Comment on attachment 402525 [details] Updated patch >Index: Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp >=================================================================== >@@ -625,7 +625,7 @@ > GUniqueOutPtr<char> themeNameSetting; > g_object_get(gtk_widget_get_settings(m_viewWidget), "gtk-theme-name", &themeNameSetting.outPtr(), nullptr); > String name = String::fromUTF8(themeNameSetting.get()); >- if (name.endsWith("-dark")) >+ if (name.endsWith("-dark") || name.endsWith("-dark")) Typo.
Created attachment 402527 [details] Fixed typo Fixed typo
Created attachment 402528 [details] Fixed typo + obsolete old patch
Created attachment 403042 [details] Patch for landing
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Committed r263652: <https://trac.webkit.org/changeset/263652> All reviewed patches have been landed. Closing bug and clearing flags on attachment 403042 [details].