extra/webkit2gtk-4.1 to 2.44.0-1

This commit is contained in:
Kevin Mihelich 2024-03-23 23:11:14 +00:00
parent 3cdb9dcf28
commit 8bdb2347de
4 changed files with 15 additions and 210 deletions

View file

@ -1,7 +1,7 @@
pkgbase = webkit2gtk-4.1 pkgbase = webkit2gtk-4.1
pkgdesc = Web content engine for GTK pkgdesc = Web content engine for GTK
pkgver = 2.42.5 pkgver = 2.44.0
pkgrel = 2 pkgrel = 1
url = https://webkitgtk.org url = https://webkitgtk.org
arch = x86_64 arch = x86_64
license = custom license = custom
@ -65,20 +65,14 @@ pkgbase = webkit2gtk-4.1
depends = wpebackend-fdo depends = wpebackend-fdo
depends = xdg-dbus-proxy depends = xdg-dbus-proxy
depends = zlib depends = zlib
source = https://webkitgtk.org/releases/webkitgtk-2.42.5.tar.xz source = https://webkitgtk.org/releases/webkitgtk-2.44.0.tar.xz
source = https://webkitgtk.org/releases/webkitgtk-2.42.5.tar.xz.asc source = https://webkitgtk.org/releases/webkitgtk-2.44.0.tar.xz.asc
source = GTK-MiniBrowser-should-hide-the-toolbar-when-using-full-screen.patch
source = GTK-Disable-DMABuf-renderer-for-NVIDIA-proprietary-drivers.patch
validpgpkeys = D7FCF61CF9A2DEAB31D81BD3F3D322D0EC4582C3 validpgpkeys = D7FCF61CF9A2DEAB31D81BD3F3D322D0EC4582C3
validpgpkeys = 5AA3BC334FD7E3369E7C77B291C559DBE4C9123B validpgpkeys = 5AA3BC334FD7E3369E7C77B291C559DBE4C9123B
sha256sums = b64278c1f20b8cfdbfb5ff573c37d871aba74a1db26d9b39f74e8953fe61e749 sha256sums = c66530e41ba59b1edba4ee89ef20b2188e273bed0497e95084729e3cfbe30c87
sha256sums = SKIP sha256sums = SKIP
sha256sums = a921d6be1303e9f23474971f381886fd291ec5bb1a7ff1e85acede8cfb88bef2 b2sums = 02e6427fde20252b4a523483814d62e82612ed43843e8902aa62a6718a9716d68b31d2cd2326c819c3bd70cf09e0c5ac4095ab544d7e8bd4031cfb4791a625bc
sha256sums = 655f3b2c96355ac83c4fa1fc6048e3256bbfdbfb9727e1e18c5af12613536206
b2sums = 4b772d91d3e2c3fc3a48455f43016d2cc1699b18fcc78253d1527eecabbfc1f47cd3bf3c512508fd683d29de68f980511d2057e4c65979bab38083a2da5cb516
b2sums = SKIP b2sums = SKIP
b2sums = d440d82c769f1b35caf5464dc850cdf1c896224205c90c17d8b0a44aee62e4b1383e11306936aaca067fde8836770d346d5122d7b05c91a5c7c1741c89c65e2f
b2sums = daa782d4d40cc12a05c02b2494e879333f66f32820f1a1b89b7ab68f62fd53043b116ecb5ef476004095a7c7b924b12695b7e87e21dd547f66e72fa02a972f0d
pkgname = webkit2gtk-4.1 pkgname = webkit2gtk-4.1
depends = at-spi2-core depends = at-spi2-core

View file

@ -1,76 +0,0 @@
From 745633e606ca70bf926545149beed35aab6450b7 Mon Sep 17 00:00:00 2001
From: Carlos Garcia Campos <cgarcia@igalia.com>
Date: Wed, 4 Oct 2023 10:19:28 +0200
Subject: [PATCH] [GTK] Disable DMABuf renderer for NVIDIA proprietary drivers
https://bugs.webkit.org/show_bug.cgi?id=262607
Reviewed by NOBODY (OOPS!).
Some NVIDIA users are reporting nothing is rendered, so let's just
disable the DMA-BUF renderer until we figure out how to make it work.
* Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.cpp:
(WebKit::isNVIDIA):
(WebKit::AcceleratedBackingStoreDMABuf::rendererBufferMode):
---
.../gtk/AcceleratedBackingStoreDMABuf.cpp | 28 +++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.cpp b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.cpp
index 9c0f5efdfb0e3..a03842e15db0e 100644
--- a/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.cpp
+++ b/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreDMABuf.cpp
@@ -38,11 +38,13 @@
#include <WebCore/GLContext.h>
#include <WebCore/IntRect.h>
#include <WebCore/PlatformDisplay.h>
+#include <WebCore/PlatformDisplaySurfaceless.h>
#include <epoxy/egl.h>
#include <wtf/glib/GUniquePtr.h>
#if USE(GBM)
#include <WebCore/DMABufFormat.h>
+#include <WebCore/PlatformDisplayGBM.h>
#include <gbm.h>
static constexpr uint64_t s_dmabufInvalidModifier = uint64_t(WebCore::DMABufFormat::Modifier::Invalid);
#else
@@ -55,6 +57,29 @@ static constexpr uint64_t s_dmabufInvalidModifier = ((1ULL << 56) - 1);
namespace WebKit {
+static bool isNVIDIA()
+{
+ const char* forceDMABuf = getenv("WEBKIT_FORCE_DMABUF_RENDERER");
+ if (forceDMABuf && strcmp(forceDMABuf, "0"))
+ return false;
+
+ std::unique_ptr<WebCore::PlatformDisplay> platformDisplay;
+#if USE(GBM)
+ const char* disableGBM = getenv("WEBKIT_DMABUF_RENDERER_DISABLE_GBM");
+ if (!disableGBM || !strcmp(disableGBM, "0")) {
+ if (auto* device = WebCore::PlatformDisplay::sharedDisplay().gbmDevice())
+ platformDisplay = WebCore::PlatformDisplayGBM::create(device);
+ }
+#endif
+ if (!platformDisplay)
+ platformDisplay = WebCore::PlatformDisplaySurfaceless::create();
+
+ WebCore::GLContext::ScopedGLContext glContext(WebCore::GLContext::createOffscreen(platformDisplay ? *platformDisplay : WebCore::PlatformDisplay::sharedDisplay()));
+ if (strstr(reinterpret_cast<const char*>(glGetString(GL_VENDOR)), "NVIDIA"))
+ return true;
+ return false;
+}
+
OptionSet<DMABufRendererBufferMode> AcceleratedBackingStoreDMABuf::rendererBufferMode()
{
static OptionSet<DMABufRendererBufferMode> mode;
@@ -70,6 +95,9 @@ OptionSet<DMABufRendererBufferMode> AcceleratedBackingStoreDMABuf::rendererBuffe
return;
}
+ if (isNVIDIA())
+ return;
+
mode.add(DMABufRendererBufferMode::SharedMemory);
const auto& eglExtensions = WebCore::PlatformDisplay::sharedDisplay().eglExtensions();

View file

@ -1,100 +0,0 @@
From e07345343415dd2496edc721daa61a3b42703131 Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Tue, 19 Sep 2023 12:16:39 -0700
Subject: [PATCH] [GTK] MiniBrowser should hide the toolbar when using
--full-screen #17909 https://bugs.webkit.org/show_bug.cgi?id=261732
Reviewed by Michael Catanzaro.
Entering fullscreen mode with F11 works as expected.
Starting with command line switch `--full-screen` does make the window
fullscreen, but does not hide the toolbar. Let's change that.
Instead of just making the window fullscreen with `gtk_window_fullscreen()`
this introduces a new function `browser_window_fullscreen()` that hides
the toolbar as well.
Also introduce new function `browserWindowUnfullscreen()`, use both
in `toggleFullScreen()`, and drop extra inversion.
* Tools/MiniBrowser/gtk/BrowserWindow.c
* Tools/MiniBrowser/gtk/BrowserWindow.h
* Tools/MiniBrowser/gtk/main.c
Canonical link: https://commits.webkit.org/268141@main
---
Tools/MiniBrowser/gtk/BrowserWindow.c | 27 ++++++++++++++++++---------
Tools/MiniBrowser/gtk/BrowserWindow.h | 1 +
Tools/MiniBrowser/gtk/main.c | 2 +-
3 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/Tools/MiniBrowser/gtk/BrowserWindow.c b/Tools/MiniBrowser/gtk/BrowserWindow.c
index 626ce2207e845..58eb5ae39e2e0 100644
--- a/Tools/MiniBrowser/gtk/BrowserWindow.c
+++ b/Tools/MiniBrowser/gtk/BrowserWindow.c
@@ -482,6 +482,20 @@ static GtkWidget *webViewCreate(WebKitWebView *webView, WebKitNavigationAction *
return GTK_WIDGET(newWebView);
}
+void browser_window_fullscreen(BrowserWindow *window)
+{
+ gtk_window_fullscreen(GTK_WINDOW(window));
+ gtk_widget_hide(window->toolbar);
+ window->fullScreenIsEnabled = TRUE;
+}
+
+static void browserWindowUnfullscreen(BrowserWindow *window)
+{
+ gtk_window_unfullscreen(GTK_WINDOW(window));
+ gtk_widget_show(window->toolbar);
+ window->fullScreenIsEnabled = FALSE;
+}
+
static gboolean webViewEnterFullScreen(WebKitWebView *webView, BrowserWindow *window)
{
gtk_widget_hide(window->toolbar);
@@ -867,15 +881,10 @@ static void loadHomePage(GSimpleAction *action, GVariant *parameter, gpointer us
static void toggleFullScreen(GSimpleAction *action, GVariant *parameter, gpointer userData)
{
BrowserWindow *window = BROWSER_WINDOW(userData);
- if (!window->fullScreenIsEnabled) {
- gtk_window_fullscreen(GTK_WINDOW(window));
- gtk_widget_hide(window->toolbar);
- window->fullScreenIsEnabled = TRUE;
- } else {
- gtk_window_unfullscreen(GTK_WINDOW(window));
- gtk_widget_show(window->toolbar);
- window->fullScreenIsEnabled = FALSE;
- }
+ if (window->fullScreenIsEnabled)
+ browserWindowUnfullscreen(window);
+ else
+ browser_window_fullscreen(window);
}
static void webKitPrintOperationFailedCallback(WebKitPrintOperation *printOperation, GError *error)
diff --git a/Tools/MiniBrowser/gtk/BrowserWindow.h b/Tools/MiniBrowser/gtk/BrowserWindow.h
index c58ebc2beec7e..1fd07efb828b8 100644
--- a/Tools/MiniBrowser/gtk/BrowserWindow.h
+++ b/Tools/MiniBrowser/gtk/BrowserWindow.h
@@ -58,6 +58,7 @@ GtkWidget* browser_window_new(GtkWindow*, WebKitWebContext*);
#endif
WebKitWebContext* browser_window_get_web_context(BrowserWindow*);
void browser_window_append_view(BrowserWindow*, WebKitWebView*);
+void browser_window_fullscreen(BrowserWindow*);
void browser_window_load_uri(BrowserWindow*, const char *uri);
void browser_window_load_session(BrowserWindow *, const char *sessionFile);
void browser_window_set_background_color(BrowserWindow*, GdkRGBA*);
diff --git a/Tools/MiniBrowser/gtk/main.c b/Tools/MiniBrowser/gtk/main.c
index 8be643a541511..451e0333dd4e8 100644
--- a/Tools/MiniBrowser/gtk/main.c
+++ b/Tools/MiniBrowser/gtk/main.c
@@ -925,7 +925,7 @@ static void activate(GApplication *application, WebKitSettings *webkitSettings)
if (darkMode)
g_object_set(gtk_widget_get_settings(GTK_WIDGET(mainWindow)), "gtk-application-prefer-dark-theme", TRUE, NULL);
if (fullScreen)
- gtk_window_fullscreen(GTK_WINDOW(mainWindow));
+ browser_window_fullscreen(mainWindow);
if (backgroundColor)
browser_window_set_background_color(mainWindow, backgroundColor);

View file

@ -11,8 +11,8 @@ pkgname=(
webkit2gtk-4.1 webkit2gtk-4.1
webkit2gtk-4.1-docs webkit2gtk-4.1-docs
) )
pkgver=2.42.5 pkgver=2.44.0
pkgrel=2 pkgrel=1
pkgdesc="Web content engine for GTK" pkgdesc="Web content engine for GTK"
url="https://webkitgtk.org" url="https://webkitgtk.org"
arch=(x86_64) arch=(x86_64)
@ -83,17 +83,11 @@ makedepends=(
) )
source=( source=(
$url/releases/webkitgtk-$pkgver.tar.xz{,.asc} $url/releases/webkitgtk-$pkgver.tar.xz{,.asc}
GTK-MiniBrowser-should-hide-the-toolbar-when-using-full-screen.patch
GTK-Disable-DMABuf-renderer-for-NVIDIA-proprietary-drivers.patch
) )
sha256sums=('b64278c1f20b8cfdbfb5ff573c37d871aba74a1db26d9b39f74e8953fe61e749' sha256sums=('c66530e41ba59b1edba4ee89ef20b2188e273bed0497e95084729e3cfbe30c87'
'SKIP' 'SKIP')
'a921d6be1303e9f23474971f381886fd291ec5bb1a7ff1e85acede8cfb88bef2' b2sums=('02e6427fde20252b4a523483814d62e82612ed43843e8902aa62a6718a9716d68b31d2cd2326c819c3bd70cf09e0c5ac4095ab544d7e8bd4031cfb4791a625bc'
'655f3b2c96355ac83c4fa1fc6048e3256bbfdbfb9727e1e18c5af12613536206') 'SKIP')
b2sums=('4b772d91d3e2c3fc3a48455f43016d2cc1699b18fcc78253d1527eecabbfc1f47cd3bf3c512508fd683d29de68f980511d2057e4c65979bab38083a2da5cb516'
'SKIP'
'd440d82c769f1b35caf5464dc850cdf1c896224205c90c17d8b0a44aee62e4b1383e11306936aaca067fde8836770d346d5122d7b05c91a5c7c1741c89c65e2f'
'daa782d4d40cc12a05c02b2494e879333f66f32820f1a1b89b7ab68f62fd53043b116ecb5ef476004095a7c7b924b12695b7e87e21dd547f66e72fa02a972f0d')
validpgpkeys=( validpgpkeys=(
'D7FCF61CF9A2DEAB31D81BD3F3D322D0EC4582C3' # Carlos Garcia Campos <cgarcia@igalia.com> 'D7FCF61CF9A2DEAB31D81BD3F3D322D0EC4582C3' # Carlos Garcia Campos <cgarcia@igalia.com>
'5AA3BC334FD7E3369E7C77B291C559DBE4C9123B' # Adrián Pérez de Castro <aperez@igalia.com> '5AA3BC334FD7E3369E7C77B291C559DBE4C9123B' # Adrián Pérez de Castro <aperez@igalia.com>
@ -101,14 +95,6 @@ validpgpkeys=(
prepare() { prepare() {
cd webkitgtk-$pkgver cd webkitgtk-$pkgver
# Requested by eworm
# https://github.com/WebKit/WebKit/pull/17909
patch -Np1 -i ../GTK-MiniBrowser-should-hide-the-toolbar-when-using-full-screen.patch
# https://bugs.archlinux.org/task/79783
# https://github.com/WebKit/WebKit/pull/18614
patch -Np1 -i ../GTK-Disable-DMABuf-renderer-for-NVIDIA-proprietary-drivers.patch
} }
build() { build() {
@ -119,7 +105,8 @@ build() {
-DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_INSTALL_LIBDIR=lib
-DCMAKE_INSTALL_LIBEXECDIR=lib -DCMAKE_INSTALL_LIBEXECDIR=lib
-DCMAKE_SKIP_RPATH=ON -DCMAKE_SKIP_RPATH=ON
-DUSE_AVIF=ON -DUSE_GTK4=OFF
-DUSE_LIBBACKTRACE=OFF
-DUSE_SOUP2=OFF -DUSE_SOUP2=OFF
-DENABLE_DOCUMENTATION=ON -DENABLE_DOCUMENTATION=ON
-DENABLE_MINIBROWSER=ON -DENABLE_MINIBROWSER=ON
@ -170,7 +157,7 @@ package_webkit2gtk-4.1() {
rm -r "$pkgdir/usr/bin" rm -r "$pkgdir/usr/bin"
mkdir -p doc/usr/share mkdir -p doc/usr/share
mv {"$pkgdir",doc}/usr/share/gtk-doc mv {"$pkgdir",doc}/usr/share/doc
cd webkitgtk-$pkgver cd webkitgtk-$pkgver
find Source -name 'COPYING*' -or -name 'LICENSE*' -print0 | sort -z | find Source -name 'COPYING*' -or -name 'LICENSE*' -print0 | sort -z |