From 0ea37486d8125de4054c991bd2abc3a12038b8f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=8A?= =?UTF-8?q?=D1=80=20=D0=9A=D1=83=D1=80=D1=82=D0=B0=D0=BA=D0=BE=D0=B2?= Date: Mon, 10 Feb 2025 12:13:56 +0200 Subject: [PATCH] [GTK4] Stop disabling Webkit hardware acceleration hardware-acceleration-policy has always 2 values "always"(0) and "never"(1) as per https://webkitgtk.org/reference/webkitgtk/stable/enum.HardwareAccelerationPolicy.html thus value of 2 is no longer supported. Fixes "(SWT:330330): GLib-GObject-CRITICAL **: 10:47:39.032: value "((WebKitHardwareAccelerationPolicy) 2)" of type 'WebKitHardwareAccelerationPolicy' is invalid or out of range for property 'hardware-acceleration-policy' of type 'WebKitHardwareAccelerationPolicy'" when running on GTK4. As GTK 4 is fairly different from GTK 3 where it was disabled in an effort to fix crash let's keep the default setting unless there is a problem that is fixed by disabling hardware acceleration. --- .../gtk/org/eclipse/swt/browser/WebKit.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/browser/WebKit.java b/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/browser/WebKit.java index 68b8f4cdc61..23d0a4f6d46 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/browser/WebKit.java +++ b/bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/browser/WebKit.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2024 IBM Corporation and others. + * Copyright (c) 2010, 2025 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -736,7 +736,9 @@ public void create (Composite parent, int style) { OS.g_object_set (settings, WebKitGTK.enable_developer_extras, 1, 0); //disable hardware acceleration due to https://bugs.webkit.org/show_bug.cgi?id=239429#c11 //even evolution ended up doing the same https://gitlab.gnome.org/GNOME/evolution/-/commit/eb62ccaa28bbbca7668913ce7d8056a6d75f9b05 - OS.g_object_set (settings, WebKitGTK.hardware_acceleration_policy, 2, 0); + if (!GTK.GTK4) { + OS.g_object_set (settings, WebKitGTK.hardware_acceleration_policy, 2, 0); + } OS.g_object_set (settings, WebKitGTK.default_charset, utfBytes, 0); if (WebKitGTK.webkit_get_minor_version() >= 14) {