⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 255349 in webkit


Ignore:
Timestamp:
Jan 29, 2020, 2:38:26 AM (7 years ago)
Author:
Carlos Garcia Campos
Message:

[GTK] Fix logic of dark theme detection
https://bugs.webkit.org/show_bug.cgi?id=202276

  • If GTK_THEME is set it has a higher priority to GtkSettings.
  • GTK_THEME may be a -dark theme or :dark variant, handle both.

Reviewed by Michael Catanzaro.

  • UIProcess/API/gtk/PageClientImpl.cpp:

(WebKit::PageClientImpl::effectiveAppearanceIsDark const):

Location:
releases/WebKitGTK/webkit-2.26/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • releases/WebKitGTK/webkit-2.26/Source/WebKit/ChangeLog

    r255344 r255349  
     12019-09-26  Patrick Griffis  <pgriffis@igalia.com>
     2
     3        [GTK] Fix logic of dark theme detection
     4        https://bugs.webkit.org/show_bug.cgi?id=202276
     5
     6        - If GTK_THEME is set it has a higher priority to GtkSettings.
     7        - GTK_THEME may be a -dark theme or :dark variant, handle both.
     8
     9        Reviewed by Michael Catanzaro.
     10
     11        * UIProcess/API/gtk/PageClientImpl.cpp:
     12        (WebKit::PageClientImpl::effectiveAppearanceIsDark const):
     13
    1142020-01-28  Carlos Garcia Campos  <cgarcia@igalia.com>
    215
  • releases/WebKitGTK/webkit-2.26/Source/WebKit/UIProcess/API/gtk/PageClientImpl.cpp

    r248846 r255349  
    562562        return true;
    563563
     564    if (auto* themeNameEnv = g_getenv("GTK_THEME"))
     565        return g_str_has_suffix(themeNameEnv, "-dark") || g_str_has_suffix(themeNameEnv, ":dark");
     566
    564567    GUniqueOutPtr<char> themeName;
    565568    g_object_get(settings, "gtk-theme-name", &themeName.outPtr(), nullptr);
     
    567570        return true;
    568571
    569     if (auto* themeNameEnv = g_getenv("GTK_THEME"))
    570         return g_str_has_suffix(themeNameEnv, ":dark");
    571 
    572572    return false;
    573573}
Note: See TracChangeset for help on using the changeset viewer.