[epiphany/mcatanzaro/dark-mode] web-view: stop setting background color
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/mcatanzaro/dark-mode] web-view: stop setting background color
- Date: Wed, 29 Jan 2020 22:52:19 +0000 (UTC)
commit ef55787dc32d6a0577e2ae67be51459523b2d29b
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Wed Jan 29 16:47:12 2020 -0600
web-view: stop setting background color
With WebKitGTK 2.26.4, it's now finally possibly to use dark GTK themes
without horribly breaking the web, since
https://trac.webkit.org/r255342. At long last!
Problem is, Epiphany breaks this badly by setting the view's background
color from the system theme. We cannot use dark background color by
default. This results in dark text on dark background. See
https://bugs.webkit.org/show_bug.cgi?id=206953 for details.
This will reintroduce #960, so we'll need to reopen that when this
lands. If we want to manually set the background color, we're going to
need to compute the desired background color in the web process, where
WebKit now forces the light GTK theme. The color computed in the UI
process is no longer safe to use.
embed/ephy-web-view.c | 23 -----------------------
1 file changed, 23 deletions(-)
---
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 98d883768..a81a1711e 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -840,25 +840,6 @@ process_terminated_cb (EphyWebView *web_view,
}
}
-static void
-style_updated_cb (EphyWebView *web_view,
- gpointer user_data)
-{
- GtkStyleContext *context;
- GdkRGBA color;
-
- context = gtk_widget_get_style_context (GTK_WIDGET (web_view));
- if (!gtk_style_context_lookup_color (context, "theme_base_color", &color)) {
- /* Fall back to white */
- color.red = 1;
- color.green = 1;
- color.blue = 1;
- color.alpha = 1;
- }
-
- webkit_web_view_set_background_color (WEBKIT_WEB_VIEW (web_view), &color);
-}
-
static gboolean
decide_policy_cb (WebKitWebView *web_view,
WebKitPolicyDecision *decision,
@@ -3516,10 +3497,6 @@ ephy_web_view_constructed (GObject *object)
G_CALLBACK (process_terminated_cb), NULL);
g_signal_connect_swapped (webkit_web_view_get_back_forward_list (WEBKIT_WEB_VIEW (web_view)),
"changed", G_CALLBACK (update_navigation_flags), web_view);
-
- g_signal_connect (web_view, "style-updated",
- G_CALLBACK (style_updated_cb), NULL);
- style_updated_cb (web_view, NULL);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]