xwidgets: re-enable with newer webkit2gtk

By disabling hw-acceleration we can re-enable xwidgets with newer
webkit2gtk versions (Bug#80728).
Newer versions were disallowed (Bug#66068) since they abort when a
webkit view is created; however, they work fine as long as we disable
hw-acceleration, since the off-screen windows that xwidgets uses do not
support that.
* configure.ac: Remove upper-bound for webkit2gtk version check.
* src/xwidget.c (Fmake_xwidget): Turn off hardware-acceleration.

Copyright-paperwork-exempt: yes
This commit is contained in:
Dirk-Jan C. Binnema
2026-04-03 09:41:13 +03:00
committed by Eli Zaretskii
parent be2b4a9831
commit 4e855f90d1
2 changed files with 11 additions and 3 deletions

View File

@@ -4456,11 +4456,10 @@ XWIDGETS_OBJ=
if test "$with_xwidgets" != "no"; then
if test "$USE_GTK_TOOLKIT" = "GTK3" && test "$window_system" != "none"; then
WEBKIT_REQUIRED=2.12
WEBKIT_BROKEN=2.41.92
WEBKIT_MODULES="webkit2gtk-4.1 >= $WEBKIT_REQUIRED webkit2gtk-4.1 < $WEBKIT_BROKEN"
WEBKIT_MODULES="webkit2gtk-4.1 >= $WEBKIT_REQUIRED"
EMACS_CHECK_MODULES([WEBKIT], [$WEBKIT_MODULES])
if test "$HAVE_WEBKIT" = "no"; then
WEBKIT_MODULES="webkit2gtk-4.0 >= $WEBKIT_REQUIRED webkit2gtk-4.0 < $WEBKIT_BROKEN"
WEBKIT_MODULES="webkit2gtk-4.0 >= $WEBKIT_REQUIRED"
EMACS_CHECK_MODULES([WEBKIT], [$WEBKIT_MODULES])
fi
HAVE_XWIDGETS=$HAVE_WEBKIT

View File

@@ -380,6 +380,15 @@ fails. */)
g_object_set (G_OBJECT (settings), "enable-developer-extras", TRUE, NULL);
g_object_set (G_OBJECT (settings), "enable-javascript",
(gboolean) (!xwidget_webkit_disable_javascript), NULL);
#if WEBKIT_CHECK_VERSION (2, 16, 0)
/* the webkit view is created on an *offscreen* window, on
which hardware acceleration is not supported; we need to
tell webkitgtk _not_ to try that, since it will fail & abort()
with recent versions. */
webkit_settings_set_hardware_acceleration_policy
(settings, WEBKIT_HARDWARE_ACCELERATION_POLICY_NEVER);
#endif
}
gtk_widget_set_size_request (GTK_WIDGET (xw->widget_osr), xw->width,