summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Williamson <awilliam@redhat.com>2023-04-26 09:44:39 -0700
committerAdam Williamson <awilliam@redhat.com>2023-04-26 11:13:14 -0700
commit15770afebe8aa5e8b367733e1e24c1f08ef10c23 (patch)
tree3116ec59f4f99de6601b7916610b16e50fb67789
parent548ca2f19c8d42fbe62e179f5b1cffc0362b4664 (diff)
downloadzenity-15770afebe8aa5e8b367733e1e24c1f08ef10c23.tar.gz
Port to webkitgtk 6.0
webkitgtk 5.0 is gone from Fedora 38 and Fedora Rawhide, so our CI 'build_fedora' task is always failing. This ports the code to webkitgtk 6.0 and updates the build and CI configs. I based the changes on Epiphany code. I tested it with: zenity --text-info --html --url=https://www.happyassassin.net and it seems to work OK. Signed-off-by: Adam Williamson <awilliam@redhat.com>
-rw-r--r--.gitlab-ci.yml2
-rw-r--r--meson.build2
-rw-r--r--src/text.c10
3 files changed, 9 insertions, 5 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index d406aa9..8d08a5f 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,5 +1,5 @@
variables:
- DEPENDENCIES: gettext gettext-devel gcc git libadwaita-devel meson gtk4-devel yelp-tools webkit2gtk5.0-devel
+ DEPENDENCIES: gettext gettext-devel gcc git libadwaita-devel meson gtk4-devel yelp-tools webkitgtk6.0-devel
build_fedora:
image: fedora:latest
diff --git a/meson.build b/meson.build
index d431809..062fed4 100644
--- a/meson.build
+++ b/meson.build
@@ -65,7 +65,7 @@ opt_missing_str = '''
Requested optional @0@ support but library not found.
Please ensure you have any required development libraries installed.'''
-webkitgtk_dep = dependency('webkit2gtk-5.0', required: false)
+webkitgtk_dep = dependency('webkitgtk-6.0', required: false)
if get_option('webkitgtk')
if webkitgtk_dep.found()
zenity_conf.set('HAVE_WEBKITGTK', true)
diff --git a/src/text.c b/src/text.c
index 2e9f2fb..56d8de1 100644
--- a/src/text.c
+++ b/src/text.c
@@ -31,7 +31,7 @@
#include <gio/gio.h>
#ifdef HAVE_WEBKITGTK
-#include <webkit2/webkit2.h>
+#include <webkit/webkit.h>
#endif
#include <config.h>
@@ -358,9 +358,13 @@ zenity_text (ZenityData *data, ZenityTextData *text_data)
if (text_data->html)
{
/* "ephemeral" == private browsing */
- g_autoptr(WebKitWebContext) wk_context = webkit_web_context_new_ephemeral ();
+ g_autoptr(WebKitWebContext) wk_context = webkit_web_context_new ();
+ g_autoptr(WebKitNetworkSession) wk_session = webkit_network_session_new_ephemeral ();
- web_kit = webkit_web_view_new_with_context (wk_context);
+ web_kit = WEBKIT_WEB_VIEW (g_object_ref_sink (g_object_new (WEBKIT_TYPE_WEB_VIEW,
+ "web-context", wk_context,
+ "network-session", wk_session,
+ NULL)));
scrolled_window = GTK_WIDGET (
gtk_builder_get_object (builder, "zenity_text_scrolled_window"));