diff options
author | Michael Weiss <dev.primeos@gmail.com> | 2022-01-15 20:09:44 +0100 |
---|---|---|
committer | Michael Weiss <dev.primeos@gmail.com> | 2022-01-16 11:39:50 +0100 |
commit | a8affa912c883c59f7052779a2440c796715ced8 (patch) | |
tree | 48ba8eb87842ea2db22eb1a638588578a636cf2c | |
parent | fcb92f6d7e34c344b2fac922bf0a43e2a19dd89e (diff) |
chromium: Backport important fixes for Wayland
This is 843508dad46 for M97 (upstream didn't backport them so far).
-rw-r--r-- | pkgs/applications/networking/browsers/chromium/common.nix | 12 | ||||
-rw-r--r-- | pkgs/applications/networking/browsers/chromium/patches/m97-ozone-wayland-fix-surface_augmenter.patch | 31 |
2 files changed, 42 insertions, 1 deletions
diff --git a/pkgs/applications/networking/browsers/chromium/common.nix b/pkgs/applications/networking/browsers/chromium/common.nix index b4fdf61d16686..d9385ceb0427e 100644 --- a/pkgs/applications/networking/browsers/chromium/common.nix +++ b/pkgs/applications/networking/browsers/chromium/common.nix @@ -161,13 +161,23 @@ let ./patches/no-build-timestamps.patch # For bundling Widevine (DRM), might be replaceable via bundle_widevine_cdm=true in gnFlags: ./patches/widevine-79.patch - ] ++ lib.optionals (versionRange "98" "99") [ + ] ++ lib.optionals (versionRange "97" "98") [ # A critical Ozone/Wayland fix: + # (Note: The patch for surface_augmenter.cc doesn't apply on M97 so we extract that part.) + (fetchpatch { + # [linux/wayland] Fixed terminate caused by binding to wrong version. + url = "https://github.com/chromium/chromium/commit/dd4c3ddadbb9869f59cee201a38e9ca3b9154f4d.patch"; + excludes = [ "ui/ozone/platform/wayland/host/surface_augmenter.cc" ]; + sha256 = "sha256-lp4kxPNAkafdE9NfD3ittTCpomRpX9Hqhtt9GFf4Ntw="; + }) + ./patches/m97-ozone-wayland-fix-surface_augmenter.patch + ] ++ lib.optionals (versionRange "98" "99") [ (githubPatch { # [linux/wayland] Fixed terminate caused by binding to wrong version. commit = "dd4c3ddadbb9869f59cee201a38e9ca3b9154f4d"; sha256 = "sha256-FH7lBQTruMzkBT2XQ+kgADmJA0AxJfaV/gvtoqfQ4a4="; }) + ] ++ lib.optionals (versionRange "97" "99") [ (githubPatch { # [linux/wayland] Fixed terminate caused by binding to wrong version. (fixup) commit = "a84b79daa8897b822336b8f348ef4daaae07af37"; diff --git a/pkgs/applications/networking/browsers/chromium/patches/m97-ozone-wayland-fix-surface_augmenter.patch b/pkgs/applications/networking/browsers/chromium/patches/m97-ozone-wayland-fix-surface_augmenter.patch new file mode 100644 index 0000000000000..e63000fabc1c0 --- /dev/null +++ b/pkgs/applications/networking/browsers/chromium/patches/m97-ozone-wayland-fix-surface_augmenter.patch @@ -0,0 +1,31 @@ +diff --git a/ui/ozone/platform/wayland/host/surface_augmenter.cc b/ui/ozone/platform/wayland/host/surface_augmenter.cc +index d971d15e71426..6e5408398bcea 100644 +--- a/ui/ozone/platform/wayland/host/surface_augmenter.cc ++++ b/ui/ozone/platform/wayland/host/surface_augmenter.cc +@@ -13,7 +13,8 @@ + namespace ui { + + namespace { +-constexpr uint32_t kMaxSurfaceAugmenterVersion = 1; ++constexpr uint32_t kMinVersion = 1; ++constexpr uint32_t kMaxVersion = 1; + } + + // static +@@ -27,11 +28,13 @@ void SurfaceAugmenter::Instantiate(WaylandConnection* connection, + uint32_t version) { + DCHECK_EQ(interface, kInterfaceName); + +- if (connection->surface_augmenter_) ++ if (connection->surface_augmenter_ || ++ !wl::CanBind(interface, version, kMinVersion, kMaxVersion)) { + return; ++ } + +- auto augmenter = wl::Bind<surface_augmenter>( +- registry, name, std::min(version, kMaxSurfaceAugmenterVersion)); ++ auto augmenter = wl::Bind<surface_augmenter>(registry, name, ++ std::min(version, kMaxVersion)); + if (!augmenter) { + LOG(ERROR) << "Failed to bind surface_augmenter"; + return; |