summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES4
-rw-r--r--PATCHES4
-rw-r--r--browser.c15
3 files changed, 19 insertions, 4 deletions
diff --git a/CHANGES b/CHANGES
index dfc17e4..0d0cbe5 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,9 @@
Release history for lariza
+v21.06 2021-06-19
+ [Fixed]
+ - Setting a preferred language works again (workaround in place).
+
v21.01 2021-01-22
[Changed]
- The file "adblock.black" has been renamed to "adblock".
diff --git a/PATCHES b/PATCHES
index 174b734..1a3a4d1 100644
--- a/PATCHES
+++ b/PATCHES
@@ -10,7 +10,9 @@ The project used to be hosted on GitHub, so there is a couple of forks:
https://github.com/vain/lariza/network/members
-I'm not aware of any non-GitHub forks at the moment.
+Non-GitHub forks:
+
+ https://chorizo.armaanb.net
Why?
diff --git a/browser.c b/browser.c
index 3408a9d..2ecf0b5 100644
--- a/browser.c
+++ b/browser.c
@@ -129,6 +129,7 @@ client_new(const gchar *uri, WebKitWebView *related_wv, gboolean show,
struct Client *c;
gchar *f;
GtkWidget *evbox, *tabbox;
+ WebKitWebContext *wc;
if (uri != NULL && cooperative_instances && !cooperative_alone)
{
@@ -153,6 +154,17 @@ client_new(const gchar *uri, WebKitWebView *related_wv, gboolean show,
else
c->web_view = webkit_web_view_new_with_related_view(related_wv);
+ /* XXX We have just created a new WebView with either the default
+ * WebContext (if related_wv == NULL) or a WebView with an inherited
+ * context. Still, it doesn't use the preferred languages we might
+ * have set on the default WebContext. This used to work. New bug in
+ * WebKit or changed API? */
+ if (accepted_language[0] != NULL)
+ {
+ wc = webkit_web_view_get_context(WEBKIT_WEB_VIEW(c->web_view));
+ webkit_web_context_set_preferred_languages(wc, accepted_language);
+ }
+
webkit_web_view_set_zoom_level(WEBKIT_WEB_VIEW(c->web_view), global_zoom);
g_signal_connect(G_OBJECT(c->web_view), "notify::favicon",
G_CALLBACK(changed_favicon), c);
@@ -861,9 +873,6 @@ init_default_web_context(void)
webkit_web_context_set_web_extensions_directory(wc, p);
g_free(p);
- if (accepted_language[0] != NULL)
- webkit_web_context_set_preferred_languages(wc, accepted_language);
-
g_signal_connect(G_OBJECT(wc), "download-started",
G_CALLBACK(download_handle_start), NULL);