RESOLVED FIXED 213465
[GTK] Dark mode for GTK themes that end with -Dark
https://bugs.webkit.org/show_bug.cgi?id=213465
Summary [GTK] Dark mode for GTK themes that end with -Dark
Elliot
Reported 2020-06-22 09:03:19 PDT
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.
Attachments
A patch for this issue modifying "Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp" (1.73 KB, patch)
2020-06-22 09:03 PDT, Elliot
no flags
Updated patch (1.66 KB, patch)
2020-06-22 18:50 PDT, Elliot
no flags
Fixed typo (1.66 KB, patch)
2020-06-22 19:58 PDT, Elliot
no flags
Fixed typo + obsolete old patch (1.66 KB, patch)
2020-06-22 20:00 PDT, Elliot
no flags
Patch for landing (2.76 KB, patch)
2020-06-29 02:44 PDT, Carlos Garcia Campos
no flags
Patrick Griffis
Comment 1 2020-06-22 16:34:31 PDT
: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.
Elliot
Comment 2 2020-06-22 18:50:58 PDT
Created attachment 402525 [details] Updated patch
Elliot
Comment 3 2020-06-22 18:51:41 PDT
(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!
Patrick Griffis
Comment 4 2020-06-22 19:49:18 PDT
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.
Elliot
Comment 5 2020-06-22 19:58:48 PDT
Created attachment 402527 [details] Fixed typo Fixed typo
Elliot
Comment 6 2020-06-22 20:00:44 PDT
Created attachment 402528 [details] Fixed typo + obsolete old patch
Carlos Garcia Campos
Comment 7 2020-06-29 02:44:29 PDT
Created attachment 403042 [details] Patch for landing
EWS Watchlist
Comment 8 2020-06-29 02:45:07 PDT
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
EWS
Comment 9 2020-06-29 03:19:15 PDT
Committed r263652: <https://trac.webkit.org/changeset/263652> All reviewed patches have been landed. Closing bug and clearing flags on attachment 403042 [details].
Note You need to log in before you can comment on or make changes to this bug.