diff --git a/.gitignore b/.gitignore index ae1175a..fd8c1c6 100644 --- a/.gitignore +++ b/.gitignore @@ -345,3 +345,405 @@ firefox-3.6.4.source.tar.bz2 /firefox-67.0.source.tar.xz /firefox-langpacks-67.0-20190515.tar.xz /firefox-langpacks-67.0-20190517.tar.xz +/firefox-67.0.2.source.tar.xz +/firefox-langpacks-67.0.2-20190611.tar.xz +/firefox-langpacks-67.0.3-20190618.tar.xz +/firefox-67.0.3.source.tar.xz +/firefox-67.0.4.source.tar.xz +/firefox-langpacks-67.0.4-20190620.tar.xz +/firefox-68.0.source.tar.xz +/firefox-langpacks-68.0-20190702.tar.xz +/firefox-langpacks-68.0-20190708.tar.xz +/firefox-68.0.1.source.tar.xz +/firefox-langpacks-68.0.1-20190722.tar.xz +/firefox-68.0.2.source.tar.xz +/firefox-langpacks-68.0.2-20190814.tar.xz +/firefox-69.0.source.tar.xz +/firefox-langpacks-69.0-20190829.tar.xz +/firefox-69.0.1.source.tar.xz +/firefox-langpacks-69.0.1-20190918.tar.xz +/firefox-langpacks-69.0.2-20191003.tar.xz +/firefox-69.0.2.source.tar.xz +/firefox-69.0.3.source.tar.xz +/firefox-langpacks-69.0.3-20191010.tar.xz +/firefox-70.0.source.tar.xz +/firefox-langpacks-70.0-20191018.tar.xz +/firefox-70.0.1.source.tar.xz +/firefox-langpacks-70.0.1-20191101.tar.xz +/firefox-71.0b12.source.tar.xz +/firefox-71.0.source.tar.xz +/firefox-langpacks-71.0-20191126.tar.xz +/firefox-langpacks-71.0-20191202.tar.xz +/firefox-72.0.source.tar.xz +/firefox-langpacks-72.0-20200103.tar.xz +/firefox-langpacks-72.0-20200106.tar.xz +/firefox-72.0.1.source.tar.xz +/firefox-langpacks-72.0.1-20200108.tar.xz +/firefox-72.0.2.source.tar.xz +/firefox-langpacks-72.0.2-20200120.tar.xz +/firefox-73.0.source.tar.xz +/firefox-langpacks-73.0-20200211.tar.xz +/firefox-73.0.1.source.tar.xz +/firefox-langpacks-73.0.1-20200220.tar.xz +/firefox-74.0.source.tar.xz +/firefox-langpacks-74.0-20200303.tar.xz +/firefox-langpacks-74.0-20200309.tar.xz +/firefox-langpacks-74.0-20200310.tar.xz +/firefox-74.0.1.source.tar.xz +/firefox-langpacks-74.0.1-20200404.tar.xz +/firefox-75.0.source.tar.xz +/firefox-langpacks-75.0-20200406.tar.xz +/firefox-76.0.source.tar.xz +/firefox-langpacks-76.0-20200502.tar.xz +/firefox-76.0.1.source.tar.xz +/firefox-langpacks-76.0.1-20200508.tar.xz +/firefox-77.0.source.tar.xz +/firefox-langpacks-77.0-20200529.tar.xz +/firefox-langpacks-77.0-20200602.tar.xz +/firefox-77.0.1.source.tar.xz +/firefox-langpacks-77.0.1-20200603.tar.xz +/firefox-78.0.source.tar.xz +/firefox-langpacks-78.0-20200629.tar.xz +/firefox-78.0.1.source.tar.xz +/firefox-langpacks-78.0.1-20200701.tar.xz +/firefox-78.0.2.source.tar.xz +/firefox-langpacks-78.0.2-20200709.tar.xz +/firefox-79.0.source.tar.xz +/firefox-langpacks-79.0-20200727.tar.xz +/firefox-80.0.source.tar.xz +/firefox-langpacks-80.0-20200818.tar.xz +/firefox-langpacks-80.0-20200820.tar.xz +/firefox-80.0.1.source.tar.xz +/firefox-langpacks-80.0.1-20200901.tar.xz +/firefox-81.0.source.tar.xz +/firefox-langpacks-81.0-20200915.tar.xz +/firefox-langpacks-81.0-20200921.tar.xz +/firefox-81.0.1.source.tar.xz +/firefox-langpacks-81.0.1-20200930.tar.xz +/firefox-81.0.2.source.tar.xz +/firefox-langpacks-81.0.2-20201012.tar.xz +/firefox-82.0.source.tar.xz +/firefox-langpacks-82.0-20201015.tar.xz +/firefox-82.0.1.source.tar.xz +/firefox-langpacks-82.0.1-20201028.tar.xz +/firefox-82.0.2.source.tar.xz +/firefox-langpacks-82.0.2-20201029.tar.xz +/firefox-82.0.3.source.tar.xz +/firefox-langpacks-82.0.3-20201109.tar.xz +/firefox-83.0.source.tar.xz +/firefox-langpacks-83.0-20201112.tar.xz +/firefox-langpacks-83.0-20201116.tar.xz +/firefox-testing.tar.gz +/site-packages.tar.gz +/mochitest-python.tar.gz +/firefox-84.0.source.tar.xz +/firefox-langpacks-84.0-20201210.tar.xz +/firefox-langpacks-84.0-20201214.tar.xz +/firefox-84.0.1.source.tar.xz +/firefox-langpacks-84.0.1-20201222.tar.xz +/firefox-84.0.2.source.tar.xz +/firefox-langpacks-84.0.2-20210106.tar.xz +/firefox-85.0.source.tar.xz +/firefox-langpacks-85.0-20210120.tar.xz +/firefox-85.0.1.source.tar.xz +/firefox-langpacks-85.0.1-20210208.tar.xz +/firefox-86.0.source.tar.xz +/firefox-langpacks-86.0-20210222.tar.xz +/firefox-86.0.1.source.tar.xz +/firefox-langpacks-86.0.1-20210312.tar.xz +/firefox-87.0.source.tar.xz +/firefox-langpacks-87.0-20210322.tar.xz +/firefox-langpacks-88.0-20210419.tar.xz +/firefox-88.0.source.tar.xz +/firefox-88.0.1.source.tar.xz +/firefox-langpacks-88.0.1-20210510.tar.xz +/firefox-langpacks-89.0-20210601.tar.xz +/firefox-89.0.source.tar.xz +/firefox-89.0.2.source.tar.xz +/firefox-langpacks-89.0.2-20210624.tar.xz +/firefox-90.0.source.tar.xz +/firefox-langpacks-90.0-20210712.tar.xz +/firefox-90.0.1.source.tar.xz +/firefox-langpacks-90.0.1-20210721.tar.xz +/firefox-90.0.2.source.tar.xz +/firefox-langpacks-90.0.2-20210722.tar.xz +/firefox-91.0.source.tar.xz +/firefox-langpacks-91.0-20210810.tar.xz +/firefox-91.0.2.source.tar.xz +/firefox-langpacks-91.0.2-20210826.tar.xz +/firefox-langpacks-92.0-20210903.tar.xz +/firefox-92.0.source.tar.xz +/firefox-92.0.1.source.tar.xz +/firefox-langpacks-92.0.1-20210927.tar.xz +/firefox-93.0.source.tar.xz +/firefox-langpacks-93.0-20210929.tar.xz +/firefox-94.0.source.tar.xz +/firefox-langpacks-94.0-20211031.tar.xz +/firefox-94.0.2.source.tar.xz +/firefox-langpacks-94.0.2-20211125.tar.xz +/firefox-95.0.source.tar.xz +/firefox-langpacks-95.0-20211203.tar.xz +/firefox-95.0.2.source.tar.xz +/firefox-langpacks-95.0.2-20211220.tar.xz +/firefox-96.0.source.tar.xz +/firefox-langpacks-96.0-20220111.tar.xz +/firefox-langpacks-96.0.1-20220118.tar.xz +/firefox-96.0.1.source.tar.xz +/firefox-96.0.3.source.tar.xz +/firefox-langpacks-96.0.3-20220131.tar.xz +/firefox-97.0.source.tar.xz +/firefox-langpacks-97.0-20220208.tar.xz +/firefox-97.0.1.source.tar.xz +/firefox-langpacks-97.0.1-20220218.tar.xz +/firefox-98.0.source.tar.xz +/firefox-langpacks-98.0-20220301.tar.xz +/firefox-langpacks-98.0-20220304.tar.xz +/firefox-langpacks-98.0-20220305.tar.xz +/firefox-98.0.2.source.tar.xz +/firefox-langpacks-98.0.2-20220331.tar.xz +/firefox-99.0.source.tar.xz +/firefox-langpacks-99.0-20220331.tar.xz +/firefox-langpacks-99.0.1-20220413.tar.xz +/firefox-99.0.1.source.tar.xz +/firefox-100.0.source.tar.xz +/firefox-langpacks-100.0-20220502.tar.xz +/firefox-100.0.1.source.tar.xz +/firefox-langpacks-100.0.1-20220518.tar.xz +/firefox-100.0.2.source.tar.xz +/firefox-langpacks-100.0.2-20220520.tar.xz +/firefox-101.0.source.tar.xz +/firefox-langpacks-101.0-20220530.tar.xz +/firefox-101.0.1.source.tar.xz +/firefox-langpacks-101.0.1-20220609.tar.xz +/firefox-102.0.source.tar.xz +/firefox-langpacks-102.0-20220628.tar.xz +/firefox-103.0.source.tar.xz +/firefox-langpacks-103.0-20220721.tar.xz +/firefox-103.0.1.source.tar.xz +/firefox-langpacks-103.0.1-20220802.tar.xz +/firefox-103.0.2.source.tar.xz +/firefox-langpacks-103.0.2-20220812.tar.xz +/firefox-104.0.source.tar.xz +/firefox-langpacks-104.0-20220816.tar.xz +/firefox-langpacks-104.0-20220822.tar.xz +/firefox-langpacks-104.0.1-20220830.tar.xz +/firefox-104.0.1.source.tar.xz +/firefox-104.0.2.source.tar.xz +/firefox-langpacks-104.0.2-20220906.tar.xz +/firefox-langpacks-105.0-20220920.tar.xz +/firefox-105.0.source.tar.xz +/firefox-105.0.1.source.tar.xz +/firefox-langpacks-105.0.1-20220922.tar.xz +/firefox-105.0.2.source.tar.xz +/firefox-langpacks-105.0.2-20221005.tar.xz +/firefox-langpacks-106.0-20221014.tar.xz +/firefox-106.0.source.tar.xz +/firefox-106.0.1.source.tar.xz +/firefox-langpacks-106.0.1-20221023.tar.xz +/firefox-106.0.3.source.tar.xz +/firefox-langpacks-106.0.3-20221031.tar.xz +/firefox-langpacks-107.0-20221114.tar.xz +/firefox-107.0.source.tar.xz +/firefox-107.0.1.source.tar.xz +/firefox-langpacks-107.0.1-20221206.tar.xz +/firefox-108.0.source.tar.xz +/firefox-langpacks-108.0-20221206.tar.xz +/firefox-langpacks-108.0-20221214.tar.xz +/firefox-108.0.1.source.tar.xz +/firefox-langpacks-108.0.1-20221218.tar.xz +/firefox-108.0.2.source.tar.xz +/firefox-langpacks-108.0.2-20230112.tar.xz +/firefox-109.0.source.tar.xz +/firefox-langpacks-109.0-20230111.tar.xz +/firefox-109.0.1.source.tar.xz +/firefox-langpacks-109.0.1-20230201.tar.xz +/firefox-110.0.source.tar.xz +/firefox-langpacks-110.0-20230210.tar.xz +/firefox-langpacks-110.0-20230214.tar.xz +/firefox-111.0.source.tar.xz +/firefox-langpacks-111.0-20230320.tar.xz +/firefox-langpacks-111.0.1-20230322.tar.xz +/firefox-111.0.1.source.tar.xz +/firefox-112.0.source.tar.xz +/firefox-langpacks-112.0-20230405.tar.xz +/firefox-langpacks-112.0-20230406.tar.xz +/firefox-langpacks-112.0.1-20230417.tar.xz +/firefox-112.0.1.source.tar.xz +/firefox-langpacks-112.0.2-20230427.tar.xz +/firefox-112.0.2.source.tar.xz +/firefox-langpacks-113.0-20230509.tar.xz +/firefox-113.0.source.tar.xz +/firefox-langpacks-113.0.1-20230515.tar.xz +/firefox-113.0.1.source.tar.xz +/firefox-114.0.source.tar.xz +/firefox-langpacks-114.0-20230605.tar.xz +/firefox-langpacks-114.0.2-20230620.tar.xz +/firefox-114.0.2.source.tar.xz +/firefox-langpacks-115.0-20230629.tar.xz +/firefox-115.0.source.tar.xz +/firefox-langpacks-115.0-20230703.tar.xz +/firefox-115.0.2.source.tar.xz +/firefox-langpacks-115.0.2-20230717.tar.xz +/firefox-116.0.source.tar.xz +/firefox-langpacks-116.0-20230725.tar.xz +/firefox-langpacks-116.0-20230731.tar.xz +/firefox-116.0.1.source.tar.xz +/firefox-langpacks-116.0.1-20230804.tar.xz +/firefox-langpacks-116.0.2-20230807.tar.xz +/firefox-116.0.2.source.tar.xz +/firefox-langpacks-116.0.3-20230817.tar.xz +/firefox-116.0.3.source.tar.xz +/firefox-117.0.source.tar.xz +/firefox-langpacks-117.0-20230828.tar.xz +/firefox-117.0.1.source.tar.xz +/firefox-langpacks-117.0.1-20230913.tar.xz +/firefox-118.0.source.tar.xz +/firefox-langpacks-118.0-20230925.tar.xz +/firefox-langpacks-118.0.1-20230929.tar.xz +/firefox-118.0.1.source.tar.xz +/firefox-118.0.2.source.tar.xz +/firefox-langpacks-118.0.2-20231010.tar.xz +/dump_syms-vendor.tar.xz +/firefox-langpacks-119.0.1-20231110.tar.xz +/firefox-119.0.1.source.tar.xz +/firefox-120.0.source.tar.xz +/firefox-langpacks-120.0-20231114.tar.xz +/firefox-langpacks-120.0-20231120.tar.xz +/firefox-120.0.1.source.tar.xz +/firefox-langpacks-120.0.1-20231201.tar.xz +/firefox-121.0.source.tar.xz +/firefox-langpacks-121.0-20231218.tar.xz +/firefox-121.0.1.source.tar.xz +/firefox-langpacks-121.0.1-20240112.tar.xz +/firefox-122.0.source.tar.xz +/firefox-langpacks-122.0-20240119.tar.xz +/firefox-langpacks-122.0.1-20240213.tar.xz +/firefox-122.0.1.source.tar.xz +/firefox-langpacks-123.0-20240219.tar.xz +/firefox-123.0.source.tar.xz +/firefox-123.0.1.source.tar.xz +/firefox-langpacks-123.0.1-20240307.tar.xz +/firefox-124.0.source.tar.xz +/firefox-langpacks-124.0-20240313.tar.xz +/firefox-124.0.1.source.tar.xz +/firefox-langpacks-124.0.1-20240322.tar.xz +/wasi-sdk-20.tar.gz +/wasi-sdk-20-1.fc39.src.rpm +/firefox-124.0.2.source.tar.xz +/firefox-langpacks-124.0.2-20240404.tar.xz +/firefox-langpacks-125.0-20240409.tar.xz +/firefox-125.0.source.tar.xz +/firefox-125.0.2.source.tar.xz +/firefox-langpacks-125.0.2-20240420.tar.xz +/firefox-125.0.3.source.tar.xz +/firefox-langpacks-125.0.3-20240429.tar.xz +/firefox-126.0.source.tar.xz +/firefox-langpacks-126.0-20240507.tar.xz +/firefox-127.0.source.tar.xz +/firefox-langpacks-127.0-20240610.tar.xz +/firefox-langpacks-127.0.2-20240625.tar.xz +/firefox-127.0.2.source.tar.xz +/firefox-128.0.source.tar.xz +/firefox-langpacks-128.0-20240702.tar.xz +/firefox-langpacks-128.0-20240708.tar.xz +/firefox-128.0.3.source.tar.xz +/firefox-langpacks-128.0.3-20240729.tar.xz +/firefox-129.0.source.tar.xz +/firefox-langpacks-129.0-20240730.tar.xz +/firefox-langpacks-129.0-20240802.tar.xz +/firefox-129.0.2.source.tar.xz +/firefox-langpacks-192.0.2-20240820.tar.xz +/firefox-langpacks-129.0.2-20240820.tar.xz +/firefox-langpacks-130.0-20240828.tar.xz +/firefox-130.0.source.tar.xz +/firefox-130.0.1.source.tar.xz +/firefox-langpacks-130.0.1-20240918.tar.xz +/firefox-langpacks-131.0-20240924.tar.xz +/firefox-131.0.source.tar.xz +/firefox-131.0.2.source.tar.xz +/firefox-langpacks-131.0.2-20241009.tar.xz +/firefox-131.0.3.source.tar.xz +/firefox-langpacks-131.0.3-20241015.tar.xz +/firefox-132.0.source.tar.xz +/firefox-langpacks-132.0-20241023.tar.xz +/firefox-132.0.1.source.tar.xz +/firefox-langpacks-132.0.1-20241105.tar.xz +/firefox-langpacks-132.0.2-20241115.tar.xz +/firefox-132.0.2.source.tar.xz +/firefox-133.0.source.tar.xz +/firefox-langpacks-133.0-20241122.tar.xz +/firefox-langpacks-133.0.3-20241211.tar.xz +/firefox-133.0.3.source.tar.xz +/firefox-langpacks-134.0-20250102.tar.xz +/firefox-134.0.source.tar.xz +/firefox-langpacks-134.0.1-20250115.tar.xz +/firefox-134.0.1.source.tar.xz +/firefox-134.0.2.source.tar.xz +/firefox-langpacks-134.0.2-20250122.tar.xz +/wasi-sdk-25.tar.gz +/wasm-component-ld-vendor.tar.xz +/firefox-135.0.source.tar.xz +/firefox-langpacks-135.0-20250204.tar.xz +/firefox-136.0.source.tar.xz +/firefox-langpacks-136.0-20250225.tar.xz +/firefox-langpacks-136.0-20250228.tar.xz +/firefox-136.0.1.source.tar.xz +/firefox-langpacks-136.0.1-20250312.tar.xz +/firefox-langpacks-136.0.2-20250319.tar.xz +/firefox-136.0.2.source.tar.xz +/firefox-136.0.3.source.tar.xz +/firefox-langpacks-136.0.3-20250325.tar.xz +/firefox-langpacks-137.0-20250326.tar.xz +/firefox-137.0.source.tar.xz +/firefox-langpacks-137.0-20250331.tar.xz +/firefox-137.0.1.source.tar.xz +/firefox-langpacks-137.0.1-20250414.tar.xz +/firefox-138.0.source.tar.xz +/firefox-langpacks-138.0-20250422.tar.xz +/firefox-langpacks-138.0.1-20250501.tar.xz +/firefox-138.0.1.source.tar.xz +/firefox-138.0.3.source.tar.xz +/firefox-langpacks-138.0.3-20250512.tar.xz +/firefox-langpacks-138.0.4-20250519.tar.xz +/firefox-138.0.4.source.tar.xz +/firefox-139.0.source.tar.xz +/firefox-langpacks-139.0-20250527.tar.xz +/firefox-langpacks-139.0.4-20250610.tar.xz +/firefox-139.0.4.source.tar.xz +/firefox-140.0.source.tar.xz +/firefox-langpacks-140.0-20250617.tar.xz +/firefox-140.0.1.source.tar.xz +/firefox-langpacks-140.0.1-20250627.tar.xz +/firefox-140.0.4.source.tar.xz +/firefox-langpacks-140.0.4-20250708.tar.xz +/firefox-141.0.source.tar.xz +/firefox-langpacks-141.0-20250717.tar.xz +/firefox-langpacks-141.0-20250718.tar.xz +/firefox-langpacks-141.2.0-20250806.tar.xz +/firefox-141.0.2.source.tar.xz +/firefox-langpacks-141.0.2-20250806.tar.xz +/firefox-langpacks-141.0.3-20250811.tar.xz +/firefox-141.0.3.source.tar.xz +/firefox-142.0.source.tar.xz +/firefox-langpacks-142.0-20250812.tar.xz +/firefox-langpacks-142.0.1-20250827.tar.xz +/firefox-142.0.1.source.tar.xz +/firefox-143.0.1.source.tar.xz +/firefox-langpacks-143.0.1-20250919.tar.xz +/firefox-langpacks-143.0.3-20250930.tar.xz +/firefox-143.0.3.source.tar.xz +/firefox-langpacks-144.0-20251009.tar.xz +/firefox-144.0.source.tar.xz +/firefox-langpacks-144.0-20251010.tar.xz +/firefox-145.0.source.tar.xz +/firefox-langpacks-145.0-20251105.tar.xz +/firefox-langpacks-145.0-20251111.tar.xz +/firefox-145.0.1.source.tar.xz +/firefox-langpacks-145.0.1-20251119.tar.xz +/firefox-146.0.source.tar.xz +/firefox-langpacks-146.0-20251202.tar.xz +/firefox-langpacks-146.0-20251208.tar.xz +/firefox-146.0.1.source.tar.xz +/firefox-langpacks-146.0.1-20251219.tar.xz +/firefox-langpacks-147.0-20260106.tar.xz +/firefox-147.0.source.tar.xz diff --git a/0001-GLIBCXX-fix-for-GCC-12.patch b/0001-GLIBCXX-fix-for-GCC-12.patch new file mode 100644 index 0000000..55153a1 --- /dev/null +++ b/0001-GLIBCXX-fix-for-GCC-12.patch @@ -0,0 +1,31 @@ +diff -up firefox-142.0/build/unix/stdc++compat/stdc++compat.cpp.0001-GLIBCXX-fix-for-GCC-12 firefox-142.0/build/unix/stdc++compat/stdc++compat.cpp +--- firefox-142.0/build/unix/stdc++compat/stdc++compat.cpp.0001-GLIBCXX-fix-for-GCC-12 2025-08-11 20:04:27.000000000 +0200 ++++ firefox-142.0/build/unix/stdc++compat/stdc++compat.cpp 2025-08-14 15:02:05.496137133 +0200 +@@ -24,6 +24,7 @@ + GLIBCXX_3.4.27 is from gcc 10 + GLIBCXX_3.4.28 is from gcc 10 + GLIBCXX_3.4.29 is from gcc 11 ++ GLIBCXX_3.4.30 is from gcc 12 + + This file adds the necessary compatibility tricks to avoid symbols with + version GLIBCXX_3.4.20 and bigger, keeping binary compatibility with +@@ -94,6 +95,19 @@ void operator delete(void* ptr, size_t s + } + # endif + ++#if _GLIBCXX_RELEASE >= 12 ++namespace std { ++ ++/* This avoids the GLIBCXX_3.4.30 symbol version. */ ++void __attribute__((weak)) ++__glibcxx_assert_fail(const char* __file, int __line, const char* __function, ++ const char* __condition) { ++ MOZ_CRASH(); ++} ++ ++} // namespace std ++#endif ++ + /* While we generally don't build with exceptions, we have some host tools + * that do use them. libstdc++ from GCC 5.0 added exception constructors with + * char const* argument. Older versions only have a constructor with diff --git a/0025-Add-KDE-integration-to-Firefox-toolkit-parts.patch b/0025-Add-KDE-integration-to-Firefox-toolkit-parts.patch new file mode 100644 index 0000000..bd543b3 --- /dev/null +++ b/0025-Add-KDE-integration-to-Firefox-toolkit-parts.patch @@ -0,0 +1,1343 @@ +diff -up firefox-119.0/modules/libpref/moz.build.integration firefox-119.0/modules/libpref/moz.build +--- firefox-119.0/modules/libpref/moz.build.integration 2023-10-19 21:54:34.000000000 +0200 ++++ firefox-119.0/modules/libpref/moz.build 2023-10-31 08:59:03.719124766 +0100 +@@ -126,6 +126,10 @@ UNIFIED_SOURCES += [ + "SharedPrefMap.cpp", + ] + ++LOCAL_INCLUDES += [ ++ '/toolkit/xre' ++] ++ + gen_all_tuple = tuple(gen_h + gen_cpp + gen_rs) + + GeneratedFile( +diff -up firefox-119.0/modules/libpref/Preferences.cpp.integration firefox-119.0/modules/libpref/Preferences.cpp +--- firefox-119.0/modules/libpref/Preferences.cpp.integration 2023-10-19 21:54:34.000000000 +0200 ++++ firefox-119.0/modules/libpref/Preferences.cpp 2023-10-31 08:59:03.719124766 +0100 +@@ -95,6 +95,7 @@ + #ifdef MOZ_BACKGROUNDTASKS + # include "mozilla/BackgroundTasks.h" + #endif ++#include "nsKDEUtils.h" + + #ifdef DEBUG + # include +diff -up firefox-119.0/python/mozbuild/mozpack/chrome/flags.py.integration firefox-119.0/python/mozbuild/mozpack/chrome/flags.py +--- firefox-119.0/python/mozbuild/mozpack/chrome/flags.py.integration 2023-10-19 21:54:34.000000000 +0200 ++++ firefox-119.0/python/mozbuild/mozpack/chrome/flags.py 2023-10-31 08:59:03.719124766 +0100 +@@ -234,6 +234,7 @@ class Flags(OrderedDict): + "tablet": Flag, + "process": StringFlag, + "backgroundtask": StringFlag, ++ "desktop": StringFlag, + } + RE = re.compile(r"([!<>=]+)") + +diff -up firefox-119.0/python/mozbuild/mozpack/chrome/manifest.py.integration firefox-119.0/python/mozbuild/mozpack/chrome/manifest.py +--- firefox-119.0/python/mozbuild/mozpack/chrome/manifest.py.integration 2023-10-19 21:54:34.000000000 +0200 ++++ firefox-119.0/python/mozbuild/mozpack/chrome/manifest.py 2023-10-31 08:59:03.719124766 +0100 +@@ -43,6 +43,7 @@ class ManifestEntry(object): + "process", + "contentaccessible", + "backgroundtask", ++ "desktop", + ] + + def __init__(self, base, *flags): +diff -up firefox-119.0/toolkit/components/downloads/moz.build.integration firefox-119.0/toolkit/components/downloads/moz.build +--- firefox-119.0/toolkit/components/downloads/moz.build.integration 2023-10-19 21:54:43.000000000 +0200 ++++ firefox-119.0/toolkit/components/downloads/moz.build 2023-10-31 08:59:03.720124801 +0100 +@@ -51,5 +51,9 @@ if CONFIG["MOZ_PLACES"]: + + FINAL_LIBRARY = "xul" + ++LOCAL_INCLUDES += [ ++ '/toolkit/xre' ++] ++ + with Files("**"): + BUG_COMPONENT = ("Toolkit", "Downloads API") +diff -up firefox-119.0/toolkit/mozapps/downloads/HelperAppDlg.sys.mjs.integration firefox-119.0/toolkit/mozapps/downloads/HelperAppDlg.sys.mjs +--- firefox-119.0/toolkit/mozapps/downloads/HelperAppDlg.sys.mjs.integration 2023-10-19 21:54:43.000000000 +0200 ++++ firefox-119.0/toolkit/mozapps/downloads/HelperAppDlg.sys.mjs 2023-10-31 08:59:03.720124801 +0100 +@@ -1246,26 +1246,56 @@ nsUnknownContentTypeDialog.prototype = { + this.chosenApp = params.handlerApp; + } + } else if ("@mozilla.org/applicationchooser;1" in Cc) { +- var nsIApplicationChooser = Ci.nsIApplicationChooser; +- var appChooser = Cc["@mozilla.org/applicationchooser;1"].createInstance( +- nsIApplicationChooser +- ); +- appChooser.init( +- this.mDialog, +- this.dialogElement("strings").getString("chooseAppFilePickerTitle") +- ); +- var contentTypeDialogObj = this; +- let appChooserCallback = function appChooserCallback_done(aResult) { +- if (aResult) { +- contentTypeDialogObj.chosenApp = aResult.QueryInterface( +- Ci.nsILocalHandlerApp +- ); +- } +- contentTypeDialogObj.finishChooseApp(); +- }; +- appChooser.open(this.mLauncher.MIMEInfo.MIMEType, appChooserCallback); +- // The finishChooseApp is called from appChooserCallback +- return; ++ // handle the KDE case which is implemented in the filepicker ++ // therefore falling back to Gtk2 like behaviour if KDE is running ++ // FIXME this should be better handled in the nsIApplicationChooser ++ // interface ++ var env = Components.classes["@mozilla.org/process/environment;1"] ++ .getService(Components.interfaces.nsIEnvironment); ++ if (env.get('KDE_FULL_SESSION') == "true") ++ { ++ var nsIFilePicker = Ci.nsIFilePicker; ++ var fp = Cc["@mozilla.org/filepicker;1"] ++ .createInstance(nsIFilePicker); ++ fp.init(this.mDialog, ++ this.dialogElement("strings").getString("chooseAppFilePickerTitle"), ++ nsIFilePicker.modeOpen); ++ ++ fp.appendFilters(nsIFilePicker.filterApps); ++ ++ fp.open(aResult => { ++ if (aResult == nsIFilePicker.returnOK && fp.file) { ++ // Remember the file they chose to run. ++ var localHandlerApp = ++ Cc["@mozilla.org/uriloader/local-handler-app;1"]. ++ createInstance(Ci.nsILocalHandlerApp); ++ localHandlerApp.executable = fp.file; ++ this.chosenApp = localHandlerApp; ++ } ++ this.finishChooseApp(); ++ }); ++ } else { ++ var nsIApplicationChooser = Ci.nsIApplicationChooser; ++ var appChooser = Cc["@mozilla.org/applicationchooser;1"].createInstance( ++ nsIApplicationChooser ++ ); ++ appChooser.init( ++ this.mDialog, ++ this.dialogElement("strings").getString("chooseAppFilePickerTitle") ++ ); ++ var contentTypeDialogObj = this; ++ let appChooserCallback = function appChooserCallback_done(aResult) { ++ if (aResult) { ++ contentTypeDialogObj.chosenApp = aResult.QueryInterface( ++ Ci.nsILocalHandlerApp ++ ); ++ } ++ contentTypeDialogObj.finishChooseApp(); ++ }; ++ appChooser.open(this.mLauncher.MIMEInfo.MIMEType, appChooserCallback); ++ // The finishChooseApp is called from appChooserCallback ++ return; ++ } + } else { + var nsIFilePicker = Ci.nsIFilePicker; + var fp = Cc["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker); +diff -up firefox-119.0/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp.integration firefox-119.0/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp +--- firefox-119.0/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp.integration 2023-10-19 21:54:43.000000000 +0200 ++++ firefox-119.0/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp 2023-10-31 08:59:03.720124801 +0100 +@@ -16,6 +16,8 @@ + #include "nsISupportsPrimitives.h" + #include "nsIGSettingsService.h" + #include "nsReadableUtils.h" ++#include "nsPrintfCString.h" ++#include "nsKDEUtils.h" + + using namespace mozilla; + +@@ -39,6 +41,8 @@ class nsUnixSystemProxySettings final : + nsACString& aResult); + nsresult SetProxyResultFromGSettings(const char* aKeyBase, const char* aType, + nsACString& aResult); ++ nsresult GetProxyFromKDE(const nsACString& aScheme, const nsACString& aHost, ++ PRInt32 aPort, nsACString& aResult); + }; + + NS_IMPL_ISUPPORTS(nsUnixSystemProxySettings, nsISystemProxySettings) +@@ -393,6 +397,9 @@ nsresult nsUnixSystemProxySettings::GetP + const nsACString& aHost, + const int32_t aPort, + nsACString& aResult) { ++ if (nsKDEUtils::kdeSupport()) ++ return GetProxyFromKDE(aScheme, aHost, aPort, aResult); ++ + if (mProxySettings) { + nsresult rv = GetProxyFromGSettings(aScheme, aHost, aPort, aResult); + if (NS_SUCCEEDED(rv)) return rv; +@@ -401,6 +408,28 @@ nsresult nsUnixSystemProxySettings::GetP + return GetProxyFromEnvironment(aScheme, aHost, aPort, aResult); + } + ++nsresult nsUnixSystemProxySettings::GetProxyFromKDE(const nsACString& aScheme, ++ const nsACString& aHost, ++ PRInt32 aPort, ++ nsACString& aResult) { ++ nsAutoCString url; ++ url = aScheme; ++ url += "://"; ++ url += aHost; ++ if (aPort >= 0) { ++ url += ":"; ++ url += nsPrintfCString("%d", aPort); ++ } ++ nsTArray command; ++ command.AppendElement("GETPROXY"_ns); ++ command.AppendElement(url); ++ nsTArray result; ++ if (!nsKDEUtils::command(command, &result) || result.Length() != 1) ++ return NS_ERROR_FAILURE; ++ aResult = result[0]; ++ return NS_OK; ++} ++ + NS_IMPL_COMPONENT_FACTORY(nsUnixSystemProxySettings) { + auto result = MakeRefPtr(); + result->Init(); +diff -up firefox-119.0/toolkit/xre/moz.build.integration firefox-119.0/toolkit/xre/moz.build +--- firefox-119.0/toolkit/xre/moz.build.integration 2023-10-19 21:54:43.000000000 +0200 ++++ firefox-119.0/toolkit/xre/moz.build 2023-10-31 08:59:03.720124801 +0100 +@@ -96,7 +96,9 @@ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "ui + "UIKitDirProvider.mm", + ] + elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": ++ EXPORTS += ['nsKDEUtils.h'] + UNIFIED_SOURCES += [ ++ "nsKDEUtils.cpp", + "nsNativeAppSupportUnix.cpp", + ] + CXXFLAGS += CONFIG["MOZ_X11_SM_CFLAGS"] +diff -up firefox-119.0/toolkit/xre/nsKDEUtils.cpp.integration firefox-119.0/toolkit/xre/nsKDEUtils.cpp +--- firefox-119.0/toolkit/xre/nsKDEUtils.cpp.integration 2023-10-31 08:59:03.721124836 +0100 ++++ firefox-119.0/toolkit/xre/nsKDEUtils.cpp 2023-10-31 08:59:03.721124836 +0100 +@@ -0,0 +1,286 @@ ++/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ ++/* This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ ++ ++#include "nsKDEUtils.h" ++#include "nsIWidget.h" ++#include "nsISupportsPrimitives.h" ++#include "nsIMutableArray.h" ++#include "nsComponentManagerUtils.h" ++#include "nsArrayUtils.h" ++ ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++// copied from X11/X.h as a hack since for an unknown ++// reason it's not picked up from X11/X.h ++#ifndef None ++# define None 0L /* universal null resource or null atom */ ++#endif ++ ++// #define DEBUG_KDE ++#ifdef DEBUG_KDE ++# define KMOZILLAHELPER "kmozillahelper" ++#else ++// not need for lib64, it's a binary ++# define KMOZILLAHELPER "/usr/lib/mozilla/kmozillahelper" ++#endif ++ ++#define KMOZILLAHELPER_VERSION 6 ++#define MAKE_STR2(n) #n ++#define MAKE_STR(n) MAKE_STR2(n) ++ ++static bool getKdeSession() { ++ if (PR_GetEnv("KDE_FULL_SESSION")) { ++ return true; ++ } ++ return false; ++} ++ ++static bool getKdeSupport() { ++ nsTArray command; ++ command.AppendElement("CHECK"_ns); ++ command.AppendElement("KMOZILLAHELPER_VERSION"_ns); ++ bool kde = nsKDEUtils::command(command); ++#ifdef DEBUG_KDE ++ fprintf(stderr, "KDE RUNNING %d\n", kde); ++#endif ++ return kde; ++} ++ ++nsKDEUtils::nsKDEUtils() : commandFile(NULL), replyFile(NULL) {} ++ ++nsKDEUtils::~nsKDEUtils() { ++ // closeHelper(); not actually useful, exiting will close the fd too ++} ++ ++nsKDEUtils* nsKDEUtils::self() { ++ static nsKDEUtils s; ++ return &s; ++} ++ ++static bool helperRunning = false; ++static bool helperFailed = false; ++ ++bool nsKDEUtils::kdeSession() { ++ static bool session = getKdeSession(); ++ return session; ++} ++ ++bool nsKDEUtils::kdeSupport() { ++ static bool support = kdeSession() && getKdeSupport(); ++ return support && helperRunning; ++} ++ ++struct nsKDECommandData { ++ FILE* file; ++ nsTArray* output; ++ GMainLoop* loop; ++ bool success; ++}; ++ ++static gboolean kdeReadFunc(GIOChannel*, GIOCondition, gpointer data) { ++ nsKDECommandData* p = static_cast(data); ++ char buf[8192]; // TODO big enough ++ bool command_done = false; ++ bool command_failed = false; ++ while (!command_done && !command_failed && ++ fgets(buf, 8192, p->file) != ++ NULL) { // TODO what if the kernel splits a line into two chunks? ++ // #ifdef DEBUG_KDE ++ // fprintf( stderr, "READ: %s %d\n", buf, feof( p->file )); ++ // #endif ++ if (char* eol = strchr(buf, '\n')) *eol = '\0'; ++ command_done = (strcmp(buf, "\\1") == 0); ++ command_failed = (strcmp(buf, "\\0") == 0); ++ nsAutoCString line(buf); ++ line.ReplaceSubstring("\\n", "\n"); ++ line.ReplaceSubstring( ++ "\\" ++ "\\", ++ "\\"); // \\ -> \ , i.e. unescape ++ if (p->output && !(command_done || command_failed)) ++ p->output->AppendElement(nsCString(buf)); // TODO utf8? ++ } ++ bool quit = false; ++ if (feof(p->file) || command_failed) { ++ quit = true; ++ p->success = false; ++ } ++ if (command_done) { // reading one reply finished ++ quit = true; ++ p->success = true; ++ } ++ if (quit) { ++ if (p->loop) g_main_loop_quit(p->loop); ++ return FALSE; ++ } ++ return TRUE; ++} ++ ++bool nsKDEUtils::command(const nsTArray& command, ++ nsTArray* output) { ++ return self()->internalCommand(command, NULL, false, output); ++} ++ ++bool nsKDEUtils::command(nsIArray* command, nsIArray** output) { ++ nsTArray in; ++ PRUint32 length; ++ command->GetLength(&length); ++ for (PRUint32 i = 0; i < length; i++) { ++ nsCOMPtr str = do_QueryElementAt(command, i); ++ if (str) { ++ nsAutoCString s; ++ str->GetData(s); ++ in.AppendElement(s); ++ } ++ } ++ ++ nsTArray out; ++ bool ret = self()->internalCommand(in, NULL, false, &out); ++ ++ if (!output) return ret; ++ ++ nsCOMPtr result = do_CreateInstance(NS_ARRAY_CONTRACTID); ++ if (!result) return false; ++ ++ for (PRUint32 i = 0; i < out.Length(); i++) { ++ nsCOMPtr rstr = ++ do_CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID); ++ if (!rstr) return false; ++ ++ rstr->SetData(out[i]); ++ result->AppendElement(rstr); ++ } ++ ++ NS_ADDREF(*output = result); ++ return ret; ++} ++ ++bool nsKDEUtils::commandBlockUi(const nsTArray& command, ++ GtkWindow* parent, ++ nsTArray* output) { ++ return self()->internalCommand(command, parent, true, output); ++} ++ ++bool nsKDEUtils::internalCommand(const nsTArray& command, ++ GtkWindow* parent, bool blockUi, ++ nsTArray* output) { ++ if (!startHelper()) return false; ++ feedCommand(command); ++ // do not store the data in 'this' but in extra structure, just in case there ++ // is reentrancy (can there be? the event loop is re-entered) ++ nsKDECommandData data; ++ data.file = replyFile; ++ data.output = output; ++ data.success = false; ++ if (blockUi) { ++ data.loop = g_main_loop_new(NULL, FALSE); ++ GtkWidget* window = gtk_window_new(GTK_WINDOW_TOPLEVEL); ++ if (parent && gtk_window_get_group(parent)) ++ gtk_window_group_add_window(gtk_window_get_group(parent), ++ GTK_WINDOW(window)); ++ gtk_widget_realize(window); ++ gtk_widget_set_sensitive(window, TRUE); ++ gtk_grab_add(window); ++ GIOChannel* channel = g_io_channel_unix_new(fileno(data.file)); ++ g_io_add_watch(channel, ++ static_cast(G_IO_IN | G_IO_ERR | G_IO_HUP), ++ kdeReadFunc, &data); ++ g_io_channel_unref(channel); ++ g_main_loop_run(data.loop); ++ g_main_loop_unref(data.loop); ++ gtk_grab_remove(window); ++ gtk_widget_destroy(window); ++ } else { ++ data.loop = NULL; ++ while (kdeReadFunc(NULL, static_cast(0), &data)) ++ ; ++ } ++ return data.success; ++} ++ ++bool nsKDEUtils::startHelper() { ++ if (helperRunning) return true; ++ if (helperFailed) return false; ++ helperFailed = true; ++ int fdcommand[2]; ++ int fdreply[2]; ++ if (pipe(fdcommand) < 0) return false; ++ if (pipe(fdreply) < 0) { ++ close(fdcommand[0]); ++ close(fdcommand[1]); ++ return false; ++ } ++ char* args[2] = {const_cast(KMOZILLAHELPER), NULL}; ++ switch (fork()) { ++ case -1: { ++ close(fdcommand[0]); ++ close(fdcommand[1]); ++ close(fdreply[0]); ++ close(fdreply[1]); ++ return false; ++ } ++ case 0: // child ++ { ++ if (dup2(fdcommand[0], STDIN_FILENO) < 0) _exit(1); ++ if (dup2(fdreply[1], STDOUT_FILENO) < 0) _exit(1); ++ int maxfd = 1024; // close all other fds ++ struct rlimit rl; ++ if (getrlimit(RLIMIT_NOFILE, &rl) == 0) maxfd = rl.rlim_max; ++ for (int i = 3; i < maxfd; ++i) close(i); ++#ifdef DEBUG_KDE ++ execvp(KMOZILLAHELPER, args); ++#else ++ execv(KMOZILLAHELPER, args); ++#endif ++ _exit(1); // failed ++ } ++ default: // parent ++ { ++ commandFile = fdopen(fdcommand[1], "w"); ++ replyFile = fdopen(fdreply[0], "r"); ++ close(fdcommand[0]); ++ close(fdreply[1]); ++ if (commandFile == NULL || replyFile == NULL) { ++ closeHelper(); ++ return false; ++ } ++ // ok, helper ready, getKdeRunning() will check if it works ++ } ++ } ++ helperFailed = false; ++ helperRunning = true; ++ return true; ++} ++ ++void nsKDEUtils::closeHelper() { ++ if (commandFile != NULL) ++ fclose(commandFile); // this will also make the helper quit ++ if (replyFile != NULL) fclose(replyFile); ++ helperRunning = false; ++} ++ ++void nsKDEUtils::feedCommand(const nsTArray& command) { ++ for (int i = 0; i < command.Length(); ++i) { ++ nsCString line = command[i]; ++ line.ReplaceSubstring("\\", ++ "\\" ++ "\\"); // \ -> \\ , i.e. escape ++ line.ReplaceSubstring("\n", "\\n"); ++#ifdef DEBUG_KDE ++ fprintf(stderr, "COMM: %s\n", line.get()); ++#endif ++ fputs(line.get(), commandFile); ++ fputs("\n", commandFile); ++ } ++ fputs("\\E\n", ++ commandFile); // done as \E, so it cannot happen in normal data ++ fflush(commandFile); ++} +diff -up firefox-119.0/toolkit/xre/nsKDEUtils.h.integration firefox-119.0/toolkit/xre/nsKDEUtils.h +--- firefox-119.0/toolkit/xre/nsKDEUtils.h.integration 2023-10-31 08:59:03.721124836 +0100 ++++ firefox-119.0/toolkit/xre/nsKDEUtils.h 2023-10-31 08:59:03.721124836 +0100 +@@ -0,0 +1,53 @@ ++/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ ++/* This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ ++ ++#ifndef nsKDEUtils_h__ ++#define nsKDEUtils_h__ ++ ++#include "nsString.h" ++#include "nsTArray.h" ++#include ++ ++typedef struct _GtkWindow GtkWindow; ++ ++class nsIArray; ++ ++class NS_EXPORT nsKDEUtils { ++ public: ++ /* Returns true if running inside a KDE session (regardless of whether there ++ is KDE support available for Firefox). This should be used e.g. when ++ determining dialog button order but not for code that requires the KDE ++ support. */ ++ static bool kdeSession(); ++ /* Returns true if running inside a KDE session and KDE support is available ++ for Firefox. This should be used everywhere where the external helper is ++ needed. */ ++ static bool kdeSupport(); ++ /* Executes the given helper command, returns true if helper returned success. ++ */ ++ static bool command(const nsTArray& command, ++ nsTArray* output = NULL); ++ static bool command(nsIArray* command, nsIArray** output = NULL); ++ /* Like command(), but additionally blocks the parent widget like if there was ++ a modal dialog shown and enters the event loop (i.e. there are still paint ++ updates, this is for commands that take long). */ ++ static bool commandBlockUi(const nsTArray& command, ++ GtkWindow* parent, ++ nsTArray* output = NULL); ++ ++ private: ++ nsKDEUtils(); ++ ~nsKDEUtils(); ++ static nsKDEUtils* self(); ++ bool startHelper(); ++ void closeHelper(); ++ void feedCommand(const nsTArray& command); ++ bool internalCommand(const nsTArray& command, GtkWindow* parent, ++ bool isParent, nsTArray* output); ++ FILE* commandFile; ++ FILE* replyFile; ++}; ++ ++#endif // nsKDEUtils +diff -up firefox-119.0/uriloader/exthandler/HandlerServiceParent.cpp.integration firefox-119.0/uriloader/exthandler/HandlerServiceParent.cpp +--- firefox-119.0/uriloader/exthandler/HandlerServiceParent.cpp.integration 2023-10-19 21:54:43.000000000 +0200 ++++ firefox-119.0/uriloader/exthandler/HandlerServiceParent.cpp 2023-10-31 08:59:03.721124836 +0100 +@@ -18,7 +18,7 @@ + #include "nsComponentManagerUtils.h" + #include "nsServiceManagerUtils.h" + #ifdef MOZ_WIDGET_GTK +-# include "unix/nsGNOMERegistry.h" ++# include "unix/nsCommonRegistry.h" + #endif + + using mozilla::dom::ContentHandlerService; +@@ -310,8 +310,8 @@ mozilla::ipc::IPCResult HandlerServicePa + } + #ifdef MOZ_WIDGET_GTK + // Check the GNOME registry for a protocol handler +- *aHandlerExists = +- nsGNOMERegistry::HandlerExists(PromiseFlatCString(aProtocolScheme).get()); ++ *aHandlerExists = nsCommonRegistry::HandlerExists( ++ PromiseFlatCString(aProtocolScheme).get()); + #else + *aHandlerExists = false; + #endif +diff -up firefox-119.0/uriloader/exthandler/moz.build.integration firefox-119.0/uriloader/exthandler/moz.build +--- firefox-119.0/uriloader/exthandler/moz.build.integration 2023-10-19 21:54:43.000000000 +0200 ++++ firefox-119.0/uriloader/exthandler/moz.build 2023-10-31 08:59:03.721124836 +0100 +@@ -86,7 +86,9 @@ else: + + if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": + UNIFIED_SOURCES += [ ++ "unix/nsCommonRegistry.cpp", + "unix/nsGNOMERegistry.cpp", ++ "unix/nsKDERegistry.cpp", + "unix/nsMIMEInfoUnix.cpp", + ] + elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "android": +@@ -134,6 +136,7 @@ LOCAL_INCLUDES += [ + "/dom/ipc", + "/netwerk/base", + "/netwerk/protocol/http", ++ "/toolkit/xre", + ] + + if CONFIG["MOZ_ENABLE_DBUS"]: +diff -up firefox-119.0/uriloader/exthandler/unix/nsCommonRegistry.cpp.integration firefox-119.0/uriloader/exthandler/unix/nsCommonRegistry.cpp +--- firefox-119.0/uriloader/exthandler/unix/nsCommonRegistry.cpp.integration 2023-10-31 08:59:03.721124836 +0100 ++++ firefox-119.0/uriloader/exthandler/unix/nsCommonRegistry.cpp 2023-10-31 08:59:03.721124836 +0100 +@@ -0,0 +1,42 @@ ++/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ ++/* This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ ++ ++#include "nsCommonRegistry.h" ++ ++#include "nsGNOMERegistry.h" ++#include "nsKDERegistry.h" ++#include "nsString.h" ++#include "nsKDEUtils.h" ++ ++/* static */ bool nsCommonRegistry::HandlerExists(const char* aProtocolScheme) { ++ if (nsKDEUtils::kdeSupport()) ++ return nsKDERegistry::HandlerExists(aProtocolScheme); ++ return nsGNOMERegistry::HandlerExists(aProtocolScheme); ++} ++ ++/* static */ nsresult nsCommonRegistry::LoadURL(nsIURI* aURL) { ++ if (nsKDEUtils::kdeSupport()) return nsKDERegistry::LoadURL(aURL); ++ return nsGNOMERegistry::LoadURL(aURL); ++} ++ ++/* static */ void nsCommonRegistry::GetAppDescForScheme( ++ const nsACString& aScheme, nsAString& aDesc) { ++ if (nsKDEUtils::kdeSupport()) ++ return nsKDERegistry::GetAppDescForScheme(aScheme, aDesc); ++ return nsGNOMERegistry::GetAppDescForScheme(aScheme, aDesc); ++} ++ ++/* static */ already_AddRefed ++nsCommonRegistry::GetFromExtension(const nsACString& aFileExt) { ++ if (nsKDEUtils::kdeSupport()) ++ return nsKDERegistry::GetFromExtension(aFileExt); ++ return nsGNOMERegistry::GetFromExtension(aFileExt); ++} ++ ++/* static */ already_AddRefed nsCommonRegistry::GetFromType( ++ const nsACString& aMIMEType) { ++ if (nsKDEUtils::kdeSupport()) return nsKDERegistry::GetFromType(aMIMEType); ++ return nsGNOMERegistry::GetFromType(aMIMEType); ++} +diff -up firefox-119.0/uriloader/exthandler/unix/nsCommonRegistry.h.integration firefox-119.0/uriloader/exthandler/unix/nsCommonRegistry.h +--- firefox-119.0/uriloader/exthandler/unix/nsCommonRegistry.h.integration 2023-10-31 08:59:03.721124836 +0100 ++++ firefox-119.0/uriloader/exthandler/unix/nsCommonRegistry.h 2023-10-31 08:59:03.721124836 +0100 +@@ -0,0 +1,28 @@ ++/* This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ ++ ++#ifndef nsCommonRegistry_h__ ++#define nsCommonRegistry_h__ ++ ++#include "nsIURI.h" ++#include "nsCOMPtr.h" ++ ++class nsMIMEInfoBase; ++ ++class nsCommonRegistry { ++ public: ++ static bool HandlerExists(const char* aProtocolScheme); ++ ++ static nsresult LoadURL(nsIURI* aURL); ++ ++ static void GetAppDescForScheme(const nsACString& aScheme, nsAString& aDesc); ++ ++ static already_AddRefed GetFromExtension( ++ const nsACString& aFileExt); ++ ++ static already_AddRefed GetFromType( ++ const nsACString& aMIMEType); ++}; ++ ++#endif +diff -up firefox-119.0/uriloader/exthandler/unix/nsKDERegistry.cpp.integration firefox-119.0/uriloader/exthandler/unix/nsKDERegistry.cpp +--- firefox-119.0/uriloader/exthandler/unix/nsKDERegistry.cpp.integration 2023-10-31 08:59:03.722124870 +0100 ++++ firefox-119.0/uriloader/exthandler/unix/nsKDERegistry.cpp 2023-10-31 08:59:03.722124870 +0100 +@@ -0,0 +1,75 @@ ++/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ ++/* This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ ++ ++#include "mozilla/StaticPrefs_browser.h" ++#include "nsKDERegistry.h" ++#include "prlink.h" ++#include "prmem.h" ++#include "nsString.h" ++#include "nsMIMEInfoUnix.h" ++#include "nsKDEUtils.h" ++ ++/* static */ bool nsKDERegistry::HandlerExists(const char* aProtocolScheme) { ++ nsTArray command; ++ command.AppendElement("HANDLEREXISTS"_ns); ++ command.AppendElement(nsAutoCString(aProtocolScheme)); ++ return nsKDEUtils::command(command); ++} ++ ++/* static */ nsresult nsKDERegistry::LoadURL(nsIURI* aURL) { ++ nsTArray command; ++ command.AppendElement("OPEN"_ns); ++ nsCString url; ++ aURL->GetSpec(url); ++ command.AppendElement(url); ++ bool rv = nsKDEUtils::command(command); ++ if (!rv) return NS_ERROR_FAILURE; ++ ++ return NS_OK; ++} ++ ++/* static */ void nsKDERegistry::GetAppDescForScheme(const nsACString& aScheme, ++ nsAString& aDesc) { ++ nsTArray command; ++ command.AppendElement("GETAPPDESCFORSCHEME"_ns); ++ command.AppendElement(aScheme); ++ nsTArray output; ++ if (nsKDEUtils::command(command, &output) && output.Length() == 1) ++ CopyUTF8toUTF16(output[0], aDesc); ++} ++ ++/* static */ already_AddRefed nsKDERegistry::GetFromExtension( ++ const nsACString& aFileExt) { ++ NS_ASSERTION(aFileExt[0] != '.', "aFileExt shouldn't start with a dot"); ++ nsTArray command; ++ command.AppendElement("GETFROMEXTENSION"_ns); ++ command.AppendElement(aFileExt); ++ return GetFromHelper(command); ++} ++ ++/* static */ already_AddRefed nsKDERegistry::GetFromType( ++ const nsACString& aMIMEType) { ++ nsTArray command; ++ command.AppendElement("GETFROMTYPE"_ns); ++ command.AppendElement(aMIMEType); ++ return GetFromHelper(command); ++} ++ ++/* static */ already_AddRefed nsKDERegistry::GetFromHelper( ++ const nsTArray& command) { ++ nsTArray output; ++ if (nsKDEUtils::command(command, &output) && output.Length() == 3) { ++ nsCString mimetype = output[0]; ++ RefPtr mimeInfo = new nsMIMEInfoUnix(mimetype); ++ NS_ENSURE_TRUE(mimeInfo, nullptr); ++ nsCString description = output[1]; ++ mimeInfo->SetDescription(NS_ConvertUTF8toUTF16(description)); ++ nsCString handlerAppName = output[2]; ++ mimeInfo->SetPreferredAction(nsIMIMEInfo::saveToDisk); ++ mimeInfo->SetDefaultDescription(NS_ConvertUTF8toUTF16(handlerAppName)); ++ return mimeInfo.forget(); ++ } ++ return nullptr; ++} +diff -up firefox-119.0/uriloader/exthandler/unix/nsKDERegistry.h.integration firefox-119.0/uriloader/exthandler/unix/nsKDERegistry.h +--- firefox-119.0/uriloader/exthandler/unix/nsKDERegistry.h.integration 2023-10-31 08:59:03.722124870 +0100 ++++ firefox-119.0/uriloader/exthandler/unix/nsKDERegistry.h 2023-10-31 08:59:03.722124870 +0100 +@@ -0,0 +1,35 @@ ++/* This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ ++ ++#ifndef nsKDERegistry_h__ ++#define nsKDERegistry_h__ ++ ++#include "nsIURI.h" ++#include "nsCOMPtr.h" ++#include "nsTArray.h" ++ ++class nsMIMEInfoBase; ++// class nsAutoCString; ++// class nsCString; ++ ++class nsKDERegistry { ++ public: ++ static bool HandlerExists(const char* aProtocolScheme); ++ ++ static nsresult LoadURL(nsIURI* aURL); ++ ++ static void GetAppDescForScheme(const nsACString& aScheme, nsAString& aDesc); ++ ++ static already_AddRefed GetFromExtension( ++ const nsACString& aFileExt); ++ ++ static already_AddRefed GetFromType( ++ const nsACString& aMIMEType); ++ ++ private: ++ static already_AddRefed GetFromHelper( ++ const nsTArray& command); ++}; ++ ++#endif // nsKDERegistry_h__ +diff -up firefox-119.0/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp.integration firefox-119.0/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp +--- firefox-119.0/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp.integration 2023-10-19 21:54:43.000000000 +0200 ++++ firefox-119.0/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp 2023-10-31 08:59:03.722124870 +0100 +@@ -5,16 +5,19 @@ + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + #include "nsMIMEInfoUnix.h" +-#include "nsGNOMERegistry.h" ++#include "nsCommonRegistry.h" + #include "nsIGIOService.h" + #include "nsNetCID.h" + #include "nsIIOService.h" + #ifdef MOZ_ENABLE_DBUS + # include "nsDBusHandlerApp.h" + #endif ++#if defined(XP_UNIX) && !defined(XP_MACOSX) ++# include "nsKDEUtils.h" ++#endif + + nsresult nsMIMEInfoUnix::LoadUriInternal(nsIURI* aURI) { +- return nsGNOMERegistry::LoadURL(aURI); ++ return nsCommonRegistry::LoadURL(aURI); + } + + NS_IMETHODIMP +@@ -29,15 +32,15 @@ nsMIMEInfoUnix::GetHasDefaultHandler(boo + *_retval = false; + + if (mClass == eProtocolInfo) { +- *_retval = nsGNOMERegistry::HandlerExists(mSchemeOrType.get()); ++ *_retval = nsCommonRegistry::HandlerExists(mSchemeOrType.get()); + } else { + RefPtr mimeInfo = +- nsGNOMERegistry::GetFromType(mSchemeOrType); ++ nsCommonRegistry::GetFromType(mSchemeOrType); + if (!mimeInfo) { + nsAutoCString ext; + nsresult rv = GetPrimaryExtension(ext); + if (NS_SUCCEEDED(rv)) { +- mimeInfo = nsGNOMERegistry::GetFromExtension(ext); ++ mimeInfo = nsCommonRegistry::GetFromExtension(ext); + } + } + if (mimeInfo) *_retval = true; +@@ -59,6 +62,21 @@ nsresult nsMIMEInfoUnix::LaunchDefaultWi + nsAutoCString nativePath; + aFile->GetNativePath(nativePath); + ++ if (nsKDEUtils::kdeSupport()) { ++ bool supports; ++ if (NS_SUCCEEDED(GetHasDefaultHandler(&supports)) && supports) { ++ nsTArray command; ++ command.AppendElement("OPEN"_ns); ++ command.AppendElement(nativePath); ++ command.AppendElement("MIMETYPE"_ns); ++ command.AppendElement(mSchemeOrType); ++ if (nsKDEUtils::command(command)) return NS_OK; ++ } ++ if (!GetDefaultApplication()) return NS_ERROR_FILE_NOT_FOUND; ++ ++ return LaunchWithIProcess(GetDefaultApplication(), nativePath); ++ } ++ + nsCOMPtr giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID); + if (!giovfs) { + return NS_ERROR_FAILURE; +diff -up firefox-119.0/uriloader/exthandler/unix/nsOSHelperAppService.cpp.integration firefox-119.0/uriloader/exthandler/unix/nsOSHelperAppService.cpp +--- firefox-119.0/uriloader/exthandler/unix/nsOSHelperAppService.cpp.integration 2023-10-19 21:54:42.000000000 +0200 ++++ firefox-119.0/uriloader/exthandler/unix/nsOSHelperAppService.cpp 2023-10-31 08:59:03.722124870 +0100 +@@ -10,7 +10,7 @@ + #include "nsOSHelperAppService.h" + #include "nsMIMEInfoUnix.h" + #ifdef MOZ_WIDGET_GTK +-# include "nsGNOMERegistry.h" ++# include "nsCommonRegistry.h" + # ifdef MOZ_BUILD_APP_IS_BROWSER + # include "nsIToolkitShellService.h" + # include "nsIGNOMEShellService.h" +@@ -1106,7 +1106,7 @@ nsresult nsOSHelperAppService::OSProtoco + if (!XRE_IsContentProcess()) { + #ifdef MOZ_WIDGET_GTK + // Check the GNOME registry for a protocol handler +- *aHandlerExists = nsGNOMERegistry::HandlerExists(aProtocolScheme); ++ *aHandlerExists = nsCommonRegistry::HandlerExists(aProtocolScheme); + #else + *aHandlerExists = false; + #endif +@@ -1126,7 +1126,7 @@ nsresult nsOSHelperAppService::OSProtoco + NS_IMETHODIMP nsOSHelperAppService::GetApplicationDescription( + const nsACString& aScheme, nsAString& _retval) { + #ifdef MOZ_WIDGET_GTK +- nsGNOMERegistry::GetAppDescForScheme(aScheme, _retval); ++ nsCommonRegistry::GetAppDescForScheme(aScheme, _retval); + return _retval.IsEmpty() ? NS_ERROR_NOT_AVAILABLE : NS_OK; + #else + return NS_ERROR_NOT_AVAILABLE; +@@ -1231,7 +1231,7 @@ already_AddRefed nsOSHel + #ifdef MOZ_WIDGET_GTK + LOG("Looking in GNOME registry\n"); + RefPtr gnomeInfo = +- nsGNOMERegistry::GetFromExtension(aFileExt); ++ nsCommonRegistry::GetFromExtension(aFileExt); + if (gnomeInfo) { + LOG("Got MIMEInfo from GNOME registry\n"); + return gnomeInfo.forget(); +@@ -1344,7 +1344,7 @@ already_AddRefed nsOSHel + + #ifdef MOZ_WIDGET_GTK + if (handler.IsEmpty()) { +- RefPtr gnomeInfo = nsGNOMERegistry::GetFromType(aMIMEType); ++ RefPtr gnomeInfo = nsCommonRegistry::GetFromType(aMIMEType); + if (gnomeInfo) { + LOG("Got MIMEInfo from GNOME registry without extensions; setting them " + "to %s\n", +diff -up firefox-119.0/widget/gtk/moz.build.integration firefox-119.0/widget/gtk/moz.build +--- firefox-119.0/widget/gtk/moz.build.integration 2023-10-31 08:59:03.704124244 +0100 ++++ firefox-119.0/widget/gtk/moz.build 2023-10-31 08:59:03.723124906 +0100 +@@ -161,6 +161,7 @@ LOCAL_INCLUDES += [ + "/layout/xul", + "/other-licenses/atk-1.0", + "/third_party/cups/include", ++ "/toolkit/xre", + "/widget", + "/widget/headless", + "/widget/x11", +diff -up firefox-119.0/widget/gtk/nsFilePicker.cpp.integration firefox-119.0/widget/gtk/nsFilePicker.cpp +--- firefox-119.0/widget/gtk/nsFilePicker.cpp.integration 2023-10-19 21:54:43.000000000 +0200 ++++ firefox-119.0/widget/gtk/nsFilePicker.cpp 2023-10-31 08:59:03.723124906 +0100 +@@ -5,6 +5,7 @@ + + #include + #include ++#include + #include + #include + #include +@@ -30,6 +31,8 @@ + #include "WidgetUtilsGtk.h" + + #include "nsFilePicker.h" ++#include "nsKDEUtils.h" ++#include "nsURLHelper.h" + + #undef LOG + #ifdef MOZ_LOGGING +@@ -310,7 +313,8 @@ NS_IMETHODIMP + nsFilePicker::AppendFilter(const nsAString& aTitle, const nsAString& aFilter) { + if (aFilter.EqualsLiteral("..apps")) { + // No platform specific thing we can do here, really.... +- return NS_OK; ++ // Unless it's KDE. ++ if (mMode != modeOpen || !nsKDEUtils::kdeSupport()) return NS_OK; + } + + nsAutoCString filter, name; +@@ -420,6 +424,31 @@ nsFilePicker::Open(nsIFilePickerShownCal + // Can't show two dialogs concurrently with the same filepicker + if (mRunning) return NS_ERROR_NOT_AVAILABLE; + ++ // KDE file picker is not handled via callback ++ if (nsKDEUtils::kdeSupport()) { ++ mCallback = aCallback; ++ mRunning = true; ++ NS_ADDREF_THIS(); ++ g_idle_add( ++ [](gpointer data) -> gboolean { ++ nsFilePicker* queuedPicker = (nsFilePicker*)data; ++ nsIFilePicker::ResultCode result; ++ queuedPicker->kdeFileDialog(&result); ++ if (queuedPicker->mCallback) { ++ queuedPicker->mCallback->Done(result); ++ queuedPicker->mCallback = nullptr; ++ } else { ++ queuedPicker->mResult = result; ++ } ++ queuedPicker->mRunning = false; ++ NS_RELEASE(queuedPicker); ++ return G_SOURCE_REMOVE; ++ }, ++ this); ++ ++ return NS_OK; ++ } ++ + NS_ConvertUTF16toUTF8 title(mTitle); + + GtkWindow* parent_widget = +@@ -701,6 +730,205 @@ void nsFilePicker::Done(void* file_choos + NS_RELEASE_THIS(); + } + ++nsCString nsFilePicker::kdeMakeFilter(int index) { ++ nsCString buf = mFilters[index]; ++ for (PRUint32 i = 0; i < buf.Length(); ++i) ++ if (buf[i] == ';') // KDE separates just using spaces ++ buf.SetCharAt(' ', i); ++ if (!mFilterNames[index].IsEmpty()) { ++ buf += "|"; ++ buf += mFilterNames[index].get(); ++ } ++ return buf; ++} ++ ++static PRInt32 windowToXid(nsIWidget* widget) { ++ GtkWindow* parent_widget = ++ GTK_WINDOW(widget->GetNativeData(NS_NATIVE_SHELLWIDGET)); ++ GdkWindow* gdk_window = ++ gtk_widget_get_window(gtk_widget_get_toplevel(GTK_WIDGET(parent_widget))); ++ return GDK_WINDOW_XID(gdk_window); ++} ++ ++NS_IMETHODIMP nsFilePicker::kdeFileDialog(nsIFilePicker::ResultCode* aReturn) { ++ NS_ENSURE_ARG_POINTER(aReturn); ++ ++ if (mMode == modeOpen && mFilters.Length() == 1 && ++ mFilters[0].EqualsLiteral("..apps")) ++ return kdeAppsDialog(aReturn); ++ ++ nsCString title; ++ title.Adopt(ToNewUTF8String(mTitle)); ++ ++ const char* arg = NULL; ++ if (mAllowURLs) { ++ switch (mMode) { ++ case nsIFilePicker::modeOpen: ++ case nsIFilePicker::modeOpenMultiple: ++ arg = "GETOPENURL"; ++ break; ++ case nsIFilePicker::modeSave: ++ arg = "GETSAVEURL"; ++ break; ++ case nsIFilePicker::modeGetFolder: ++ arg = "GETDIRECTORYURL"; ++ break; ++ } ++ } else { ++ switch (mMode) { ++ case nsIFilePicker::modeOpen: ++ case nsIFilePicker::modeOpenMultiple: ++ arg = "GETOPENFILENAME"; ++ break; ++ case nsIFilePicker::modeSave: ++ arg = "GETSAVEFILENAME"; ++ break; ++ case nsIFilePicker::modeGetFolder: ++ arg = "GETDIRECTORYFILENAME"; ++ break; ++ } ++ } ++ ++ nsAutoCString directory; ++ if (mDisplayDirectory) { ++ mDisplayDirectory->GetNativePath(directory); ++ } else if (mPrevDisplayDirectory) { ++ mPrevDisplayDirectory->GetNativePath(directory); ++ } ++ ++ nsAutoCString startdir; ++ if (!directory.IsEmpty()) { ++ startdir = directory; ++ } ++ if (mMode == nsIFilePicker::modeSave) { ++ if (!startdir.IsEmpty()) { ++ startdir += "/"; ++ startdir += ToNewUTF8String(mDefault); ++ } else ++ startdir = ToNewUTF8String(mDefault); ++ } ++ ++ nsAutoCString filters; ++ PRInt32 count = mFilters.Length(); ++ if (count == 0) // just in case ++ filters = "*"; ++ else { ++ filters = kdeMakeFilter(0); ++ for (PRInt32 i = 1; i < count; ++i) { ++ filters += "\n"; ++ filters += kdeMakeFilter(i); ++ } ++ } ++ ++ nsTArray command; ++ command.AppendElement(nsAutoCString(arg)); ++ command.AppendElement(startdir); ++ if (mMode != nsIFilePicker::modeGetFolder) { ++ command.AppendElement(filters); ++ nsAutoCString selected; ++ selected.AppendInt(mSelectedType); ++ command.AppendElement(selected); ++ } ++ command.AppendElement(title); ++ if (mMode == nsIFilePicker::modeOpenMultiple) ++ command.AppendElement("MULTIPLE"_ns); ++ if (PRInt32 xid = windowToXid(mParentWidget)) { ++ command.AppendElement("PARENT"_ns); ++ nsAutoCString parent; ++ parent.AppendInt(xid); ++ command.AppendElement(parent); ++ } ++ ++ nsTArray output; ++ if (nsKDEUtils::commandBlockUi( ++ command, ++ GTK_WINDOW(mParentWidget->GetNativeData(NS_NATIVE_SHELLWIDGET)), ++ &output)) { ++ *aReturn = nsIFilePicker::returnOK; ++ mFiles.Clear(); ++ if (mMode != nsIFilePicker::modeGetFolder) { ++ mSelectedType = atoi(output[0].get()); ++ output.RemoveElementAt(0); ++ } ++ if (mMode == nsIFilePicker::modeOpenMultiple) { ++ mFileURL.Truncate(); ++ PRUint32 count = output.Length(); ++ for (PRUint32 i = 0; i < count; ++i) { ++ nsCOMPtr localfile; ++ nsresult rv = NS_NewNativeLocalFile(output[i], PR_FALSE, ++ getter_AddRefs(localfile)); ++ if (NS_SUCCEEDED(rv)) mFiles.AppendObject(localfile); ++ } ++ } else { ++ if (output.Length() == 0) ++ mFileURL = nsCString(); ++ else if (mAllowURLs) ++ mFileURL = output[0]; ++ else // GetFile() actually requires it to be url even for local files :-/ ++ { ++ nsCOMPtr localfile; ++ nsresult rv = NS_NewNativeLocalFile(output[0], PR_FALSE, ++ getter_AddRefs(localfile)); ++ if (NS_SUCCEEDED(rv)) ++ rv = net_GetURLSpecFromActualFile(localfile, mFileURL); ++ } ++ } ++ // Remember last used directory. ++ nsCOMPtr file; ++ GetFile(getter_AddRefs(file)); ++ if (file) { ++ nsCOMPtr dir; ++ file->GetParent(getter_AddRefs(dir)); ++ nsCOMPtr localDir(dir); ++ if (localDir) { ++ localDir.swap(mPrevDisplayDirectory); ++ } ++ } ++ if (mMode == nsIFilePicker::modeSave) { ++ nsCOMPtr file; ++ GetFile(getter_AddRefs(file)); ++ if (file) { ++ bool exists = false; ++ file->Exists(&exists); ++ if (exists) // TODO do overwrite check in the helper app ++ *aReturn = nsIFilePicker::returnReplace; ++ } ++ } ++ } else { ++ *aReturn = nsIFilePicker::returnCancel; ++ } ++ return NS_OK; ++} ++ ++NS_IMETHODIMP nsFilePicker::kdeAppsDialog(nsIFilePicker::ResultCode* aReturn) { ++ NS_ENSURE_ARG_POINTER(aReturn); ++ ++ nsCString title; ++ title.Adopt(ToNewUTF8String(mTitle)); ++ ++ nsTArray command; ++ command.AppendElement("APPSDIALOG"_ns); ++ command.AppendElement(title); ++ if (PRInt32 xid = windowToXid(mParentWidget)) { ++ command.AppendElement("PARENT"_ns); ++ nsAutoCString parent; ++ parent.AppendInt(xid); ++ command.AppendElement(parent); ++ } ++ ++ nsTArray output; ++ if (nsKDEUtils::commandBlockUi( ++ command, ++ GTK_WINDOW(mParentWidget->GetNativeData(NS_NATIVE_SHELLWIDGET)), ++ &output)) { ++ *aReturn = nsIFilePicker::returnOK; ++ mFileURL = output.Length() > 0 ? output[0] : nsCString(); ++ } else { ++ *aReturn = nsIFilePicker::returnCancel; ++ } ++ return NS_OK; ++} ++ + // All below functions available as of GTK 3.20+ + void* nsFilePicker::GtkFileChooserNew(const gchar* title, GtkWindow* parent, + GtkFileChooserAction action, +diff -up firefox-119.0/widget/gtk/nsFilePicker.h.integration firefox-119.0/widget/gtk/nsFilePicker.h +--- firefox-119.0/widget/gtk/nsFilePicker.h.integration 2023-10-19 21:54:43.000000000 +0200 ++++ firefox-119.0/widget/gtk/nsFilePicker.h 2023-10-31 08:59:03.723124906 +0100 +@@ -76,6 +76,12 @@ class nsFilePicker : public nsBaseFilePi + private: + static nsIFile* mPrevDisplayDirectory; + ++ bool kdeRunning(); ++ bool getKdeRunning(); ++ NS_IMETHODIMP kdeFileDialog(nsIFilePicker::ResultCode* aReturn); ++ NS_IMETHODIMP kdeAppsDialog(nsIFilePicker::ResultCode* aReturn); ++ nsCString kdeMakeFilter(int index); ++ + void* GtkFileChooserNew(const gchar* title, GtkWindow* parent, + GtkFileChooserAction action, + const gchar* accept_label); +diff -up firefox-119.0/xpcom/components/ManifestParser.cpp.integration firefox-119.0/xpcom/components/ManifestParser.cpp +--- firefox-119.0/xpcom/components/ManifestParser.cpp.integration 2023-10-19 21:54:43.000000000 +0200 ++++ firefox-119.0/xpcom/components/ManifestParser.cpp 2023-10-31 08:59:03.723124906 +0100 +@@ -43,6 +43,7 @@ + #include "nsIScriptError.h" + #include "nsIXULAppInfo.h" + #include "nsIXULRuntime.h" ++#include "nsKDEUtils.h" + + using namespace mozilla; + +@@ -394,6 +395,7 @@ void ParseManifest(NSLocationType aType, + constexpr auto kOs = u"os"_ns; + constexpr auto kOsVersion = u"osversion"_ns; + constexpr auto kABI = u"abi"_ns; ++ constexpr auto kDesktop = u"desktop"_ns; + constexpr auto kProcess = u"process"_ns; + #if defined(MOZ_WIDGET_ANDROID) + constexpr auto kTablet = u"tablet"_ns; +@@ -453,6 +455,7 @@ void ParseManifest(NSLocationType aType, + } + + nsAutoString osVersion; ++ nsAutoString desktop; + #if defined(XP_WIN) + # pragma warning(push) + # pragma warning(disable : 4996) // VC12+ deprecates GetVersionEx +@@ -461,14 +464,17 @@ void ParseManifest(NSLocationType aType, + nsTextFormatter::ssprintf(osVersion, u"%ld.%ld", info.dwMajorVersion, + info.dwMinorVersion); + } ++ desktop = u"win"_ns; + # pragma warning(pop) + #elif defined(MOZ_WIDGET_COCOA) + SInt32 majorVersion = nsCocoaFeatures::macOSVersionMajor(); + SInt32 minorVersion = nsCocoaFeatures::macOSVersionMinor(); + nsTextFormatter::ssprintf(osVersion, u"%ld.%ld", majorVersion, minorVersion); ++ desktop = u"macosx"_ns); + #elif defined(MOZ_WIDGET_GTK) + nsTextFormatter::ssprintf(osVersion, u"%ld.%ld", gtk_major_version, + gtk_minor_version); ++ desktop = nsKDEUtils::kdeSession() ? u"kde"_ns : u"gnome"_ns; + #elif defined(MOZ_WIDGET_ANDROID) + bool isTablet = false; + if (jni::IsAvailable()) { +@@ -476,6 +482,7 @@ void ParseManifest(NSLocationType aType, + osVersion.Assign(release->ToString()); + isTablet = java::GeckoAppShell::IsTablet(); + } ++ desktop = u"android"_ns; + #endif + + if (XRE_IsContentProcess()) { +@@ -576,6 +583,7 @@ void ParseManifest(NSLocationType aType, + : eUnspecified; + #endif + int flags = 0; ++ TriState stDesktop = eUnspecified; + + while ((token = nsCRT::strtok(whitespace, kWhitespace, &whitespace)) && + ok) { +@@ -585,6 +593,7 @@ void ParseManifest(NSLocationType aType, + if (CheckStringFlag(kApplication, wtoken, appID, stApp) || + CheckOsFlag(kOs, wtoken, osTarget, stOs) || + CheckStringFlag(kABI, wtoken, abi, stABI) || ++ CheckStringFlag(kDesktop, wtoken, desktop, stDesktop) || + CheckStringFlag(kProcess, wtoken, process, stProcess) || + CheckVersionFlag(kOsVersion, wtoken, osVersion, stOsVersion) || + CheckVersionFlag(kAppVersion, wtoken, appVersion, stAppVersion) || +@@ -644,6 +653,7 @@ void ParseManifest(NSLocationType aType, + + if (!ok || stApp == eBad || stAppVersion == eBad || + stGeckoVersion == eBad || stOs == eBad || stOsVersion == eBad || ++ stDesktop == eBad || + #ifdef MOZ_WIDGET_ANDROID + stTablet == eBad || + #endif +diff -up firefox-119.0/xpcom/components/moz.build.integration firefox-119.0/xpcom/components/moz.build +--- firefox-119.0/xpcom/components/moz.build.integration 2023-10-19 21:54:44.000000000 +0200 ++++ firefox-119.0/xpcom/components/moz.build 2023-10-31 08:59:03.723124906 +0100 +@@ -71,6 +71,7 @@ LOCAL_INCLUDES += [ + "/js/xpconnect/loader", + "/layout/build", + "/modules/libjar", ++ "/toolkit/xre", + ] + + if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": +diff -up firefox-119.0/xpcom/io/nsLocalFileUnix.cpp.integration firefox-119.0/xpcom/io/nsLocalFileUnix.cpp +--- firefox-119.0/xpcom/io/nsLocalFileUnix.cpp.integration 2023-10-19 21:54:43.000000000 +0200 ++++ firefox-119.0/xpcom/io/nsLocalFileUnix.cpp 2023-10-31 08:59:03.724124940 +0100 +@@ -51,6 +51,7 @@ + + #ifdef MOZ_WIDGET_GTK + # include "nsIGIOService.h" ++# include "nsKDEUtils.h" + #endif + + #ifdef MOZ_WIDGET_COCOA +@@ -2172,10 +2173,18 @@ nsLocalFile::Reveal() { + } + + #ifdef MOZ_WIDGET_GTK ++ nsAutoCString url; + nsCOMPtr giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID); +- if (!giovfs) { +- return NS_ERROR_FAILURE; ++ url = mPath; ++ if (nsKDEUtils::kdeSupport()) { ++ nsTArray command; ++ command.AppendElement("REVEAL"_ns); ++ command.AppendElement(mPath); ++ return nsKDEUtils::command(command) ? NS_OK : NS_ERROR_FAILURE; + } ++ ++ if (!giovfs) return NS_ERROR_FAILURE; ++ + return giovfs->RevealFile(this); + #elif defined(MOZ_WIDGET_COCOA) + CFURLRef url; +@@ -2197,6 +2206,13 @@ nsLocalFile::Launch() { + } + + #ifdef MOZ_WIDGET_GTK ++ if (nsKDEUtils::kdeSupport()) { ++ nsTArray command; ++ command.AppendElement("OPEN"_ns); ++ command.AppendElement(mPath); ++ return nsKDEUtils::command(command) ? NS_OK : NS_ERROR_FAILURE; ++ } ++ + nsCOMPtr giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID); + if (!giovfs) { + return NS_ERROR_FAILURE; diff --git a/0026-Add-KDE-integration-to-Firefox.patch b/0026-Add-KDE-integration-to-Firefox.patch new file mode 100644 index 0000000..1e2e938 --- /dev/null +++ b/0026-Add-KDE-integration-to-Firefox.patch @@ -0,0 +1,279 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Sirringhaus +Date: Tue, 8 Aug 2023 16:18:24 +0300 +Subject: [PATCH] Add KDE integration to Firefox + +Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=140751 +Bug: https://bugzilla.suse.com/show_bug.cgi?id=170055 + +How to apply this patch: + +1. Import and apply it +2. cp browser/base/content/browser.xul browser/base/content/browser-kde.xul +3. Find editBookmarkPanelDoneButton +4. Replace #ifndef with #ifdef in the line above (this hanges the button order from Gnome-style to KDE-style) +5. hg qrefresh +--- + browser/components/preferences/main.js | 18 +++ + browser/components/shell/moz.build | 2 + + .../components/shell/nsKDEShellService.cpp | 109 ++++++++++++++++++ + browser/components/shell/nsKDEShellService.h | 32 +++++ + .../components/shell/nsUnixShellService.cpp | 22 ++++ + browser/components/shell/nsUnixShellService.h | 15 +++ + 6 files changed, 198 insertions(+) + create mode 100644 browser/components/shell/nsKDEShellService.cpp + create mode 100644 browser/components/shell/nsKDEShellService.h + create mode 100644 browser/components/shell/nsUnixShellService.cpp + create mode 100644 browser/components/shell/nsUnixShellService.h + +diff --git a/browser/components/preferences/main.js b/browser/components/preferences/main.js +index 820e46fb006567bfdf93e2a46da5e3c07d42bf10..57d1c21bdecc2d55d0bed30246e684d3b97ad7fa 100644 +--- a/browser/components/preferences/main.js ++++ b/browser/components/preferences/main.js +@@ -294,6 +294,13 @@ var gMainPane = { + }, backoffTimes[this._backoffIndex]); + } + ++ var env = Components.classes["@mozilla.org/process/environment;1"] ++ .getService(Components.interfaces.nsIEnvironment); ++ var kde_session = 0; ++ if (env.get('KDE_FULL_SESSION') == "true") { ++ kde_session = 1; ++ } ++ + this.initBrowserContainers(); + this.buildContentProcessCountMenuList(); + +@@ -1727,6 +1734,17 @@ var gMainPane = { + } + try { + shellSvc.setDefaultBrowser(true, false); ++ if (kde_session == 1) { ++ var shellObj = Components.classes["@mozilla.org/file/local;1"] ++ .createInstance(Components.interfaces.nsILocalFile); ++ shellObj.initWithPath("/usr/bin/kwriteconfig"); ++ var process = Components.classes["@mozilla.org/process/util;1"] ++ .createInstance(Components.interfaces.nsIProcess); ++ process.init(shellObj); ++ var args = ["--file", "kdeglobals", "--group", "General", "--key", ++ "BrowserApplication", "firefox"]; ++ process.run(false, args, args.length); ++ } + } catch (ex) { + console.error(ex); + return; +diff --git a/browser/components/shell/moz.build b/browser/components/shell/moz.build +index eb88cb287dc3f04022b74b978666118bbd5fa6b2..95277533781a7224d108e3c45731a6d9a89ba1a0 100644 +--- a/browser/components/shell/moz.build ++++ b/browser/components/shell/moz.build +@@ -36,6 +36,8 @@ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": + + SOURCES += [ + "nsGNOMEShellService.cpp", ++ "nsKDEShellService.cpp", ++ "nsUnixShellService.cpp", + ] + if CONFIG["MOZ_ENABLE_DBUS"]: + SOURCES += [ +diff --git a/browser/components/shell/nsKDEShellService.cpp b/browser/components/shell/nsKDEShellService.cpp +new file mode 100644 +index 0000000000000000000000000000000000000000..152a3aca87ea73477bc75c4e93c01e5a52dda102 +--- /dev/null ++++ b/browser/components/shell/nsKDEShellService.cpp +@@ -0,0 +1,109 @@ ++/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ ++/* This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ ++ ++#include "mozilla/ArrayUtils.h" ++ ++#include "nsCOMPtr.h" ++#include "nsKDEShellService.h" ++#include "nsShellService.h" ++#include "nsKDEUtils.h" ++#include "nsIPrefService.h" ++#include "nsIProcess.h" ++#include "nsIFile.h" ++#include "nsServiceManagerUtils.h" ++#include "nsComponentManagerUtils.h" ++#include "nsIMutableArray.h" ++#include "nsISupportsPrimitives.h" ++#include "nsArrayUtils.h" ++ ++using namespace mozilla; ++ ++nsresult ++nsKDEShellService::Init() ++{ ++ if( !nsKDEUtils::kdeSupport()) ++ return NS_ERROR_NOT_AVAILABLE; ++ return NS_OK; ++} ++ ++NS_IMPL_ISUPPORTS(nsKDEShellService, nsIGNOMEShellService, nsIShellService) ++ ++NS_IMETHODIMP ++nsKDEShellService::IsDefaultBrowser(bool aForAllTypes, ++ bool* aIsDefaultBrowser) ++{ ++ *aIsDefaultBrowser = false; ++ ++ nsCOMPtr command = do_CreateInstance( NS_ARRAY_CONTRACTID ); ++ if (!command) ++ return NS_ERROR_FAILURE; ++ ++ nsCOMPtr str = do_CreateInstance( NS_SUPPORTS_CSTRING_CONTRACTID ); ++ if (!str) ++ return NS_ERROR_FAILURE; ++ ++ str->SetData("ISDEFAULTBROWSER"_ns); ++ command->AppendElement( str ); ++ ++ if( nsKDEUtils::command( command )) ++ *aIsDefaultBrowser = true; ++ return NS_OK; ++} ++ ++NS_IMETHODIMP ++nsKDEShellService::SetDefaultBrowser(bool aClaimAllTypes, ++ bool aForAllUsers) ++{ ++ nsCOMPtr command = do_CreateInstance( NS_ARRAY_CONTRACTID ); ++ if (!command) ++ return NS_ERROR_FAILURE; ++ ++ nsCOMPtr cmdstr = do_CreateInstance( NS_SUPPORTS_CSTRING_CONTRACTID ); ++ nsCOMPtr paramstr = do_CreateInstance( NS_SUPPORTS_CSTRING_CONTRACTID ); ++ if (!cmdstr || !paramstr) ++ return NS_ERROR_FAILURE; ++ ++ cmdstr->SetData("SETDEFAULTBROWSER"_ns); ++ command->AppendElement( cmdstr ); ++ ++ paramstr->SetData( aClaimAllTypes ? "ALLTYPES"_ns : "NORMAL"_ns ); ++ command->AppendElement( paramstr ); ++ ++ return nsKDEUtils::command( command ) ? NS_OK : NS_ERROR_FAILURE; ++} ++ ++NS_IMETHODIMP ++nsKDEShellService::GetCanSetDesktopBackground(bool* aResult) ++{ ++ *aResult = true; ++ return NS_OK; ++} ++ ++NS_IMETHODIMP ++nsKDEShellService::SetDesktopBackground(dom::Element* aElement, ++ int32_t aPosition, ++ const nsACString& aImageName) ++{ ++ return NS_ERROR_NOT_IMPLEMENTED; ++} ++ ++NS_IMETHODIMP ++nsKDEShellService::GetDesktopBackgroundColor(PRUint32 *aColor) ++{ ++ return NS_ERROR_NOT_IMPLEMENTED; ++} ++ ++NS_IMETHODIMP ++nsKDEShellService::SetDesktopBackgroundColor(PRUint32 aColor) ++{ ++ return NS_ERROR_NOT_IMPLEMENTED; ++} ++ ++NS_IMETHODIMP ++nsKDEShellService::IsDefaultForScheme(nsTSubstring const& aScheme, bool* aIsDefaultBrowser) ++{ ++ return NS_ERROR_NOT_IMPLEMENTED; ++} ++ +diff --git a/browser/components/shell/nsKDEShellService.h b/browser/components/shell/nsKDEShellService.h +new file mode 100644 +index 0000000000000000000000000000000000000000..8b0bb19164352453cfa453dd87c19263160b9ad8 +--- /dev/null ++++ b/browser/components/shell/nsKDEShellService.h +@@ -0,0 +1,32 @@ ++/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ ++/* This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ ++ ++#ifndef nskdeshellservice_h____ ++#define nskdeshellservice_h____ ++ ++#include "nsIGNOMEShellService.h" ++#include "nsToolkitShellService.h" ++#include "nsString.h" ++#include "mozilla/Attributes.h" ++ ++class nsKDEShellService final : public nsIGNOMEShellService, ++ public nsToolkitShellService ++{ ++public: ++ nsKDEShellService() : mCheckedThisSession(false) { } ++ ++ NS_DECL_ISUPPORTS ++ NS_DECL_NSISHELLSERVICE ++ NS_DECL_NSIGNOMESHELLSERVICE ++ ++ nsresult Init(); ++ ++private: ++ ~nsKDEShellService() {} ++ ++ bool mCheckedThisSession; ++}; ++ ++#endif // nskdeshellservice_h____ +diff --git a/browser/components/shell/nsUnixShellService.cpp b/browser/components/shell/nsUnixShellService.cpp +new file mode 100644 +index 0000000000000000000000000000000000000000..abf266ebdc52e136f495911da3454e69c770c6db +--- /dev/null ++++ b/browser/components/shell/nsUnixShellService.cpp +@@ -0,0 +1,22 @@ ++/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ ++/* This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ ++ ++ ++#include "nsUnixShellService.h" ++#include "nsGNOMEShellService.h" ++#include "nsKDEShellService.h" ++#include "nsKDEUtils.h" ++#include "mozilla/ModuleUtils.h" ++ ++NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGNOMEShellService, Init) ++NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsKDEShellService, Init) ++ ++NS_IMETHODIMP ++nsUnixShellServiceConstructor(REFNSIID aIID, void **aResult) ++{ ++ if( nsKDEUtils::kdeSupport()) ++ return nsKDEShellServiceConstructor( aIID, aResult ); ++ return nsGNOMEShellServiceConstructor( aIID, aResult ); ++} +diff --git a/browser/components/shell/nsUnixShellService.h b/browser/components/shell/nsUnixShellService.h +new file mode 100644 +index 0000000000000000000000000000000000000000..26b5dbac47dd9a8ec1fcb6c93575cca750692735 +--- /dev/null ++++ b/browser/components/shell/nsUnixShellService.h +@@ -0,0 +1,15 @@ ++/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ ++/* This Source Code Form is subject to the terms of the Mozilla Public ++ * License, v. 2.0. If a copy of the MPL was not distributed with this ++ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ ++ ++ ++#ifndef nsunixshellservice_h____ ++#define nsunixshellservice_h____ ++ ++#include "nsIGNOMEShellService.h" ++ ++NS_IMETHODIMP ++nsUnixShellServiceConstructor(nsISupports *aOuter, REFNSIID aIID, void **aResult); ++ ++#endif // nsunixshellservice_h____ diff --git a/Bug-1238661---fix-mozillaSignalTrampoline-to-work-.patch b/Bug-1238661---fix-mozillaSignalTrampoline-to-work-.patch deleted file mode 100644 index 70e45ff..0000000 --- a/Bug-1238661---fix-mozillaSignalTrampoline-to-work-.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff -up firefox-60.0/mfbt/LinuxSignal.h.mozilla-1238661 firefox-60.0/mfbt/LinuxSignal.h ---- firefox-60.0/mfbt/LinuxSignal.h.mozilla-1238661 2018-04-27 08:55:38.848241768 +0200 -+++ firefox-60.0/mfbt/LinuxSignal.h 2018-04-27 09:06:47.946769859 +0200 -@@ -25,10 +25,13 @@ SignalTrampoline(int aSignal, siginfo_t* - "nop; nop; nop; nop" - : : : "memory"); - -+ // Because the assembler may generate additional insturctions below, we -+ // need to ensure NOPs are inserted first by separating them out above. -+ - asm volatile ( -- "b %0" -+ "bx %0" - : -- : "X"(H) -+ : "r"(H), "l"(aSignal), "l"(aInfo), "l"(aContext) - : "memory"); - } - diff --git a/bug1375074-save-restore-x28.patch b/bug1375074-save-restore-x28.patch deleted file mode 100644 index 57a83a2..0000000 --- a/bug1375074-save-restore-x28.patch +++ /dev/null @@ -1,74 +0,0 @@ -# HG changeset patch -# User Lars T Hansen -# Date 1519822672 -3600 -# Wed Feb 28 13:57:52 2018 +0100 -# Node ID 672f0415217b202ae59a930769dffd9d6ba6b87c -# Parent 825fd04dacc6297d3a980ec4184079405950b35d -Bug 1375074 - Save and restore non-volatile x28 on ARM64 for generated unboxed object constructor. - -diff --git a/js/src/jit-test/tests/bug1375074.js b/js/src/jit-test/tests/bug1375074.js -new file mode 100644 ---- /dev/null -+++ b/js/src/jit-test/tests/bug1375074.js -@@ -0,0 +1,18 @@ -+// This forces the VM to start creating unboxed objects and thus stresses a -+// particular path into generated code for a specialized unboxed object -+// constructor. -+ -+var K = 2000; // 2000 should be plenty -+var s = "["; -+var i; -+for ( i=0; i < K-1; i++ ) -+ s = s + `{"i":${i}},`; -+s += `{"i":${i}}]`; -+var v = JSON.parse(s); -+ -+assertEq(v.length == K, true); -+ -+for ( i=0; i < K; i++) { -+ assertEq(v[i] instanceof Object, true); -+ assertEq(v[i].i, i); -+} -diff --git a/js/src/vm/UnboxedObject.cpp b/js/src/vm/UnboxedObject.cpp ---- a/js/src/vm/UnboxedObject.cpp -+++ b/js/src/vm/UnboxedObject.cpp -@@ -95,7 +95,15 @@ UnboxedLayout::makeConstructorCode(JSCon - #endif - - #ifdef JS_CODEGEN_ARM64 -- // ARM64 communicates stack address via sp, but uses a pseudo-sp for addressing. -+ // ARM64 communicates stack address via sp, but uses a pseudo-sp (PSP) for -+ // addressing. The register we use for PSP may however also be used by -+ // calling code, and it is nonvolatile, so save it. Do this as a special -+ // case first because the generic save/restore code needs the PSP to be -+ // initialized already. -+ MOZ_ASSERT(PseudoStackPointer64.Is(masm.GetStackPointer64())); -+ masm.Str(PseudoStackPointer64, vixl::MemOperand(sp, -16, vixl::PreIndex)); -+ -+ // Initialize the PSP from the SP. - masm.initStackPtr(); - #endif - -@@ -233,7 +241,22 @@ UnboxedLayout::makeConstructorCode(JSCon - masm.pop(ScratchDoubleReg); - masm.PopRegsInMask(savedNonVolatileRegisters); - -+#ifdef JS_CODEGEN_ARM64 -+ // Now restore the value that was in the PSP register on entry, and return. -+ -+ // Obtain the correct SP from the PSP. -+ masm.Mov(sp, PseudoStackPointer64); -+ -+ // Restore the saved value of the PSP register, this value is whatever the -+ // caller had saved in it, not any actual SP value, and it must not be -+ // overwritten subsequently. -+ masm.Ldr(PseudoStackPointer64, vixl::MemOperand(sp, 16, vixl::PostIndex)); -+ -+ // Perform a plain Ret(), as abiret() will move SP <- PSP and that is wrong. -+ masm.Ret(vixl::lr); -+#else - masm.abiret(); -+#endif - - masm.bind(&failureStoreOther); - diff --git a/build-aarch64-skia.patch b/build-aarch64-skia.patch index 1ecad24..9223bb8 100644 --- a/build-aarch64-skia.patch +++ b/build-aarch64-skia.patch @@ -1,12 +1,33 @@ -diff -up firefox-61.0/gfx/skia/skia/src/jumper/SkJumper_stages.cpp.aarch64-skia firefox-61.0/gfx/skia/skia/src/jumper/SkJumper_stages.cpp ---- firefox-61.0/gfx/skia/skia/src/jumper/SkJumper_stages.cpp.aarch64-skia 2018-06-20 09:19:11.411939714 +0200 -+++ firefox-61.0/gfx/skia/skia/src/jumper/SkJumper_stages.cpp 2018-06-20 09:23:36.831919894 +0200 -@@ -686,7 +686,7 @@ SI F from_half(U16 h) { +diff -up firefox-134.0-build/firefox-134.0/gfx/skia/skia/modules/skcms/src/Transform_inl.h.aarch64-skia firefox-134.0-build/firefox-134.0/gfx/skia/skia/modules/skcms/src/Transform_inl.h +--- firefox-134.0/gfx/skia/skia/modules/skcms/src/Transform_inl.h.aarch64-skia 2024-12-30 19:30:46.000000000 +0100 ++++ firefox-134.0/gfx/skia/skia/modules/skcms/src/Transform_inl.h 2025-01-02 20:51:07.855087265 +0100 +@@ -151,7 +151,7 @@ SI U32 to_fixed(F f) { return (U32)cast + + + SI F F_from_Half(U16 half) { +-#if defined(USING_NEON_F16C) ++#if 0 // defined(USING_NEON_F16C) + return vcvt_f32_f16((float16x4_t)half); + #elif defined(USING_AVX512F) + return (F)_mm512_cvtph_ps((__m256i)half); +@@ -178,7 +178,7 @@ SI F F_from_Half(U16 half) { + __attribute__((no_sanitize("unsigned-integer-overflow"))) + #endif + SI U16 Half_from_F(F f) { +-#if defined(USING_NEON_F16C) ++#if 0 //defined(USING_NEON_F16C) + return (U16)vcvt_f16_f32(f); + #elif defined(USING_AVX512F) + return (U16)_mm512_cvtps_ph((__m512 )f, _MM_FROUND_CUR_DIRECTION ); +diff -up firefox-134.0-build/firefox-134.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h.aarch64-skia firefox-134.0-build/firefox-134.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h +--- firefox-134.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h.aarch64-skia 2025-01-02 20:51:07.856087299 +0100 ++++ firefox-134.0/gfx/skia/skia/src/opts/SkRasterPipeline_opts.h 2025-01-02 23:09:47.802283444 +0100 +@@ -1421,7 +1421,7 @@ SI F from_half(U16 h) { } SI U16 to_half(F f) { --#if defined(JUMPER_IS_NEON) && defined(__aarch64__) && !defined(SK_BUILD_FOR_GOOGLE3) // Temporary workaround for some Google3 builds. -+#if 0 && defined(__aarch64__) && !defined(SK_BUILD_FOR_GOOGLE3) // Temporary workaround for some Google3 builds. - return vcvt_f16_f32(f); +-#if defined(SKRP_CPU_NEON) && defined(SK_CPU_ARM64) ++#if 0 // defined(SKRP_CPU_NEON) && defined(SK_CPU_ARM64) + return (U16)vcvt_f16_f32(f); - #elif defined(JUMPER_IS_HSW) || defined(JUMPER_IS_AVX512) + #elif defined(SKRP_CPU_SKX) diff --git a/build-c11-threads-avail.patch b/build-c11-threads-avail.patch new file mode 100644 index 0000000..f627a7b --- /dev/null +++ b/build-c11-threads-avail.patch @@ -0,0 +1,36 @@ +diff -up firefox-146.0/third_party/rust/glslopt/glsl-optimizer/include/c11/threads_posix.h.build-c11-threads-avail firefox-146.0/third_party/rust/glslopt/glsl-optimizer/include/c11/threads_posix.h +--- firefox-146.0/third_party/rust/glslopt/glsl-optimizer/include/c11/threads_posix.h.build-c11-threads-avail 2025-12-05 18:43:20.000000000 +0100 ++++ firefox-146.0/third_party/rust/glslopt/glsl-optimizer/include/c11/threads_posix.h 2025-12-11 13:30:50.463371937 +0100 +@@ -66,7 +66,7 @@ typedef pthread_cond_t cnd_t; + typedef pthread_t thrd_t; + typedef pthread_key_t tss_t; + typedef pthread_mutex_t mtx_t; +-typedef pthread_once_t once_flag; ++//typedef pthread_once_t once_flag; + + + /* +@@ -90,12 +90,13 @@ impl_thrd_routine(void *p) + + /*--------------- 7.25.2 Initialization functions ---------------*/ + // 7.25.2.1 +-static inline void ++// ++/*static inline void + call_once(once_flag *flag, void (*func)(void)) + { + pthread_once(flag, func); + } +- ++*/ + + /*------------- 7.25.3 Condition variable functions -------------*/ + // 7.25.3.1 +diff -up firefox-147.0/third_party/rust/glslopt/.cargo-checksum.json.backup firefox-147.0/third_party/rust/glslopt/.cargo-checksum.json +--- firefox-147.0/third_party/rust/glslopt/.cargo-checksum.json.backup 2026-01-07 12:48:27.390768071 +0100 ++++ firefox-147.0/third_party/rust/glslopt/.cargo-checksum.json 2026-01-07 12:48:29.538659136 +0100 +@@ -1 +1 @@ +-{"files":{"Cargo.lock":"f7970552595dc803ace9ef19b5f5d7b1fc784aac30cb27b2ebc3002d97122b9d","Cargo.toml":"7c53ee20d848f9913cacbfcb3ab2e89e30deee8d619d173c95130c7c5d065827","README.md":"4468e08c64c19977707d792bfab0080e35ff927b64990eab77873f8ba056ba1c","build.rs":"92e29699487c21389fc823c50b410cfbfc74cc774265d24958489909ee48a076","glsl-optimizer/CMakeLists.txt":"42ce94744e82ffa000da8b64d81fc140e293b9f5da7dd4cf6b49e7404a2448d9","glsl-optimizer/README.md":"b18eef11a92d267d88a937b1154f7670ee433c730b102fdf7e2da0b02722b146","glsl-optimizer/contrib/glslopt/Main.cpp":"14ba213210c62e234b8d9b0052105fed28eedd83d535ebe85acc10bda7322dd4","glsl-optimizer/contrib/glslopt/Readme":"65d2a6f1aa1dc61e903e090cdade027abad33e02e7c9c81e07dc80508acadec4","glsl-optimizer/generateParsers.sh":"878a97db5d3b69eb3b4c3a95780763b373cfcc0c02e0b28894f162dbbd1b8848","glsl-optimizer/include/GL/gl.h":"1989b51365b6d7d0c48ff6e8b181ef75e2cdf71bfb1626b1cc4362e2f54854a3","glsl-optimizer/include/GL/glext.h":"2ac3681045a35a2194a81a960cad395c04bef1c8a20ef46b799fb24af3ec5f70","glsl-optimizer/include/KHR/khrplatform.h":"1448141a0c054d7f46edfb63f4fe6c203acf9591974049481c32442fb03fd6ed","glsl-optimizer/include/c11/threads.h":"56e9e592b28df19f0db432125223cb3eb5c0c1f960c22db96a15692e14776337","glsl-optimizer/include/c11/threads_posix.h":"f8ad2b69fa472e332b50572c1b2dcc1c8a0fa783a1199aad245398d3df421b4b","glsl-optimizer/include/c11/threads_win32.h":"95bf19d7fc14d328a016889afd583e4c49c050a93bcfb114bd2e9130a4532488","glsl-optimizer/include/c11_compat.h":"103fedb48f658d36cb416c9c9e5ea4d70dff181aab551fcb1028107d098ffa3e","glsl-optimizer/include/c99_compat.h":"aafad02f1ea90a7857636913ea21617a0fcd6197256dcfc6dd97bb3410ba892e","glsl-optimizer/include/no_extern_c.h":"40069dbb6dd2843658d442f926e609c7799b9c296046a90b62b570774fd618f5","glsl-optimizer/license.txt":"e26a745226f4a46b3ca00ffbe8be18507362189a2863d04b4f563ba176a9a836","glsl-optimizer/src/compiler/builtin_type_macros.h":"5b4fc4d4da7b07f997b6eb569e37db79fa0735286575ef1fab08d419e76776ff","glsl-optimizer/src/compiler/glsl/README":"e7d408b621c1b605857c4cab63902f615edb06b530142b91ac040808df6e22f7","glsl-optimizer/src/compiler/glsl/TODO":"dd3b7a098e6f9c85ca8c99ce6dea49d65bb75d4cea243b917f29e4ad2c974603","glsl-optimizer/src/compiler/glsl/ast.h":"3e68ff374350c49211a9931f7f55a485d8d89fc4b21caaffbf6655009ad95bf8","glsl-optimizer/src/compiler/glsl/ast_array_index.cpp":"92b4d501f33e0544c00d14e4f8837753afd916c2b42e076ccc95c9e8fc37ba94","glsl-optimizer/src/compiler/glsl/ast_expr.cpp":"afd712a7b1beb2b633888f4a0911b0a8e4ae5eb5ab9c1e3f247d518cdaaa56d6","glsl-optimizer/src/compiler/glsl/ast_function.cpp":"74f4fbd490e366b37f4715168bb3465ecd9334d4130942f75dcc8e80e8e7f027","glsl-optimizer/src/compiler/glsl/ast_to_hir.cpp":"d0f798eb09271d41d068b9e7b18220d37f1ed0083300ab51eba30989698fe23d","glsl-optimizer/src/compiler/glsl/ast_type.cpp":"8eb790b24b26dfb72bdc333744b566c26d8464c5d47d20eae659461f5c4899f7","glsl-optimizer/src/compiler/glsl/builtin_functions.cpp":"454189d643c220fcb49116ee5c8a34f7b349aa67564040deb8607f6a41a15e70","glsl-optimizer/src/compiler/glsl/builtin_functions.h":"a37cad7ed09b522c5b8bec7b80115a36846e7ba6e0874a2a858e32f7f202c665","glsl-optimizer/src/compiler/glsl/builtin_int64.h":"619def6f3aebf180da3944ef08f159ab12a58b24767e41d8b985ac37ded54d62","glsl-optimizer/src/compiler/glsl/builtin_types.cpp":"afec060b62d6f3b00bfbf94e9fa5f96341ce096c128d1eef322791e6ed9cea4d","glsl-optimizer/src/compiler/glsl/builtin_variables.cpp":"6563bfb1345cbca4c77e00eef09ad152f3e1dc271d246a08c5ce9e1f4ce4250a","glsl-optimizer/src/compiler/glsl/float64.glsl":"1072fd888be48c2a7a5117cd2d92a65f034965a66375f598bb856bff5d7be766","glsl-optimizer/src/compiler/glsl/generate_ir.cpp":"e5f0175370a0d07f93c48d3f0f1b8233d12c64a7b02de02dcc753ef7b398ef0f","glsl-optimizer/src/compiler/glsl/glcpp/README":"a0332a1b221d047e9cce5181a64d4ac4056046fd878360ec8ae3a7b1e062bcff","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-lex.c":"2d179879b1ffe84f58875eee5b0c19b6bae9c973b0c48e6bcd99978f2f501c80","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-lex.l":"e4c5744c837200dafd7c15a912d13f650308ea552454d4fa67271bc0a5bde118","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-parse.c":"03494f9ce1cb82260506e2559e73a3eeb622c4bd51b65eaa0a2c3351862bd4c8","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-parse.h":"264d9a18421cde255ce34a0a62b3d8e73465359f0d167e64aa3973062aae5bdd","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-parse.y":"fafb66e3a8f149d19e085f18a4273ba6d4c11af9e9a01d665cc784dddf97b79f","glsl-optimizer/src/compiler/glsl/glcpp/glcpp.c":"37ed294403c2abfd17fd999d1ae8d11b170e5e9c878979fefac74a31195c96b0","glsl-optimizer/src/compiler/glsl/glcpp/glcpp.h":"85ac8b444bcbd0822b66448a1da407b6ae5467b649f5afaf5c58325bd7569468","glsl-optimizer/src/compiler/glsl/glcpp/pp.c":"a52d94f1bcb3fb2747a95709c4a77c25de7eea8354d2b83bb18efd96976a4473","glsl-optimizer/src/compiler/glsl/glcpp/pp_standalone_scaffolding.c":"d11aeb3acfe966d1b78f1ee49804093f2434214c41391d139ffcb67b69dc9862","glsl-optimizer/src/compiler/glsl/glcpp/pp_standalone_scaffolding.h":"abbf1f36ec5a92d035bfbb841b9452287d147616e56373cdbee1c0e55af46406","glsl-optimizer/src/compiler/glsl/glsl_lexer.cpp":"272b9fc1383d72b81bfc03fa11fdf82270ed91a294e523f9ce2b4554bd3effa9","glsl-optimizer/src/compiler/glsl/glsl_lexer.ll":"2b57d9f9eb830c3d7961d4533048a158ee6f458c8d05c65bea7b7cfbc36e4458","glsl-optimizer/src/compiler/glsl/glsl_optimizer.cpp":"f8095d20629d0af70be930b0612e169edb274551a1d25a3cd1bf9995a11ce2e8","glsl-optimizer/src/compiler/glsl/glsl_optimizer.h":"22e843b4ec53ba5f6cd85ca5f7bad33922dca8061b19fb512d46f1caca8d4757","glsl-optimizer/src/compiler/glsl/glsl_parser.cpp":"126baf368d525aba301854e3d91ba60b5aee32e1102376af71416f32cb95ec48","glsl-optimizer/src/compiler/glsl/glsl_parser.h":"2ea9a50716098a8f7bef782d2a030d757b68da73afb01b4d4940d3e8381d44e8","glsl-optimizer/src/compiler/glsl/glsl_parser.yy":"6b1fd1576b29fce005dff744a6dbd0219e4c695c361d61864e1f3a8d6fa6b764","glsl-optimizer/src/compiler/glsl/glsl_parser_extras.cpp":"aad64b5b66467da650091430681e8c6a820cf3cadc4db3c160bf2f15875390ae","glsl-optimizer/src/compiler/glsl/glsl_parser_extras.h":"71fd0e92bbdb193dfb067d7bfdb1200d77392be2fbd0cbfc9ca89d1bb4c7e741","glsl-optimizer/src/compiler/glsl/glsl_symbol_table.cpp":"6660fb83c0ddddbbd64581d46ccfdb9c84bfaa99d13348c289e6442ab00df046","glsl-optimizer/src/compiler/glsl/glsl_symbol_table.h":"24682b8304e0ea3f6318ddb8c859686bd1faee23cd0511d1760977ae975d41bf","glsl-optimizer/src/compiler/glsl/hir_field_selection.cpp":"72a039b0fcab4161788def9e4bedac7ac06a20d8e13146529c6d246bd5202afd","glsl-optimizer/src/compiler/glsl/int64.glsl":"303dbe95dde44b91aee3e38b115b92028400d6a92f9268975d607471984e13eb","glsl-optimizer/src/compiler/glsl/ir.cpp":"2b4741cce90b5d4abff5d719c7324e2693c67294d4d99736cb241554adb281bc","glsl-optimizer/src/compiler/glsl/ir.h":"990b1c74447c4eb4835353ccb0ed9aea644f97fc1129ef1739cd935075d85d2e","glsl-optimizer/src/compiler/glsl/ir_array_refcount.cpp":"8cdc1cffe01e42e0566fa2193a75f789628e8025ad1b82f0ee6f204451b7f9f7","glsl-optimizer/src/compiler/glsl/ir_array_refcount.h":"75f06ec81342b379096ca52e1dc0fd5f19a11ff8e9b58203c20628179d644c12","glsl-optimizer/src/compiler/glsl/ir_basic_block.cpp":"1e2920b1c0ecb08424c745c558f84d0d7e44b74585cf2cc2265dc4dfede3fa2f","glsl-optimizer/src/compiler/glsl/ir_basic_block.h":"81be7da0fc0ee547cd13ec60c1fcd7d3ce3d70d7e5e988f01a3b43a827acdf05","glsl-optimizer/src/compiler/glsl/ir_builder.cpp":"daba29c5a1efdd5a9754f420eb3e2ebdf73485273497f40d4863dadeddb23c0d","glsl-optimizer/src/compiler/glsl/ir_builder.h":"2822e74dd3f6e3df8b300af27d5b11ea2dd99d0e5e7ca809b7bbcce9833c483c","glsl-optimizer/src/compiler/glsl/ir_builder_print_visitor.cpp":"8c6df5abf2fe313363f285f171c19ca6c8ee4f3bc2ed79d33c0c88cc8be45c48","glsl-optimizer/src/compiler/glsl/ir_builder_print_visitor.h":"799852adc3a0e54d04080655e7cebfa0d3bf5b6ffed5d8414f141380665d4db7","glsl-optimizer/src/compiler/glsl/ir_clone.cpp":"d897a4e1f5bbec4a6a2f15044c1be9a4d13899c73be77335b041049a4589aa5d","glsl-optimizer/src/compiler/glsl/ir_constant_expression.cpp":"78bd87ddb09db67f6c499067728d72aef4f16aa02721a99a4b769d1e0cfa9010","glsl-optimizer/src/compiler/glsl/ir_equals.cpp":"bca28533a6310b0fc152b56d80872368f1510dc62ed6e8ac199b9ffa7fac02e7","glsl-optimizer/src/compiler/glsl/ir_expression_flattening.cpp":"7e918d4e1f237eca01396004015865ce345afe32a876c9dbc6728576a1a7eae4","glsl-optimizer/src/compiler/glsl/ir_expression_flattening.h":"f45b66aa9497520e7e08e612d24b308477c34477fbd963ee9320eac664957f16","glsl-optimizer/src/compiler/glsl/ir_expression_operation.h":"cc9f10727dbd26cac506804f51456302c702650f9eeb59054a7e1575d5cf6687","glsl-optimizer/src/compiler/glsl/ir_expression_operation.py":"7b86c96021b9fbe165957f4ecb0b612fefcde1c2cf3c6d75e3cdb22e369216ba","glsl-optimizer/src/compiler/glsl/ir_expression_operation_constant.h":"9ad3346416392e3efa11e12ecf2feca7453c5253d241eb96c91dfb85d4f2b971","glsl-optimizer/src/compiler/glsl/ir_expression_operation_strings.h":"a6826daf496a8b9e89885bc2a161ac3445d501b23c6e0ac33e2c01b506b273c8","glsl-optimizer/src/compiler/glsl/ir_function.cpp":"7537365fc0fbe4b37a26b9a2146cc64d3e9a774d60eab63b65002ad165ae8fc7","glsl-optimizer/src/compiler/glsl/ir_function_can_inline.cpp":"faddbf112187a048d502716a3fb82570a322299ba2a3abd79388382c82040bfc","glsl-optimizer/src/compiler/glsl/ir_function_detect_recursion.cpp":"9176973eaf5c0a984701f953bb7a80f37dca43d59b5bce50fc69b3f02f2902d7","glsl-optimizer/src/compiler/glsl/ir_function_inlining.h":"9739493f99c489987d650762fccdd3fb3d432f6481d67f6c799176685bd59632","glsl-optimizer/src/compiler/glsl/ir_hierarchical_visitor.cpp":"3725861fbe2b98e0617f52d3b14cf6d3b25fb5ec00f5ef5d308b03642f592767","glsl-optimizer/src/compiler/glsl/ir_hierarchical_visitor.h":"e0560210e966c0c31e4ca843e80ea154e64db5a444b8c2df845b6ba5b3a43fc1","glsl-optimizer/src/compiler/glsl/ir_hv_accept.cpp":"caf7ce2cd9494aadd3c58bcf77f29de58368dc9e347a362bbf37f8bda9509b80","glsl-optimizer/src/compiler/glsl/ir_optimization.h":"8b3dcfc7f9e96b21a8dd47a0040d90be483a9e67a2cdce3a697188fb758d4630","glsl-optimizer/src/compiler/glsl/ir_print_glsl_visitor.cpp":"f8e34a983452be0dcb5a695e9c8e895eead24f9e540992a8afe510ae85da4c4c","glsl-optimizer/src/compiler/glsl/ir_print_glsl_visitor.h":"1ad1bd3efd1ace39051c13f904c05fd80425d329444f9a8d47fd6d948faf46e0","glsl-optimizer/src/compiler/glsl/ir_print_visitor.cpp":"643f5a68aae3fb37267fd793f1216d1cfdeb2c09338c26b1f30e4c6deaef4de5","glsl-optimizer/src/compiler/glsl/ir_print_visitor.h":"4573eb93268a2654c14b505253dd651e2695d43dc745904d824da18305269b95","glsl-optimizer/src/compiler/glsl/ir_reader.cpp":"06bfba802c8354e5a8b2334b6d78d6297de18235bedd3f8fbb382c89870b02f2","glsl-optimizer/src/compiler/glsl/ir_reader.h":"63e3f7f1597936a7011d5b520e171b197bf82bee6c1560d822c3edf5aaa6f9e9","glsl-optimizer/src/compiler/glsl/ir_rvalue_visitor.cpp":"84b5c5d746555adca85759c2912fe48010232b7c1c0bd2cf03bd04067a85e66f","glsl-optimizer/src/compiler/glsl/ir_rvalue_visitor.h":"fd8c561b71085d3211fff85ed514fecb299d8ce19a04bc063419a55b6d840525","glsl-optimizer/src/compiler/glsl/ir_set_program_inouts.cpp":"ab9f115ce9e7f312d9c7978340ced0dc4ae6d13a80e08442ba9709d11d50cae5","glsl-optimizer/src/compiler/glsl/ir_uniform.h":"683ae6896b1a08470c090be5f822fc31cd434eab9216e954b9bba24a46975109","glsl-optimizer/src/compiler/glsl/ir_unused_structs.cpp":"9c1620c45f2fc071fe5ed828472040b14c5f42effe06aa0e3b8352c95ef78786","glsl-optimizer/src/compiler/glsl/ir_unused_structs.h":"13387b49c23093575276b25b9dfd31fedd8f131c5c4f3128ab04cf03e15b5295","glsl-optimizer/src/compiler/glsl/ir_validate.cpp":"6b232be5999a86ea278f4f15b2832d76843246509118d924243055a3b9b0299f","glsl-optimizer/src/compiler/glsl/ir_variable_refcount.cpp":"2764a3cad937d53f36db7447c3a5b98b04bf153acf81074d971857fc5bca460d","glsl-optimizer/src/compiler/glsl/ir_variable_refcount.h":"b0668e3eb1501ef65e38fe12830742ecb3d28e6039f30e366c8924efc29b4a39","glsl-optimizer/src/compiler/glsl/ir_visitor.h":"f21b3534c3d66d5fb707d1581fece7e1eb043523afbaedf89918cfb031c6df94","glsl-optimizer/src/compiler/glsl/link_atomics.cpp":"360f0209e11f367ba358223597b0a118bae095bff16337cf03f1fb89c5b80ca6","glsl-optimizer/src/compiler/glsl/link_functions.cpp":"de7895da8aa33a1e3c2c1eb2fdaf267ab5d1fbfdb79ae2e67f95211e946e294c","glsl-optimizer/src/compiler/glsl/link_interface_blocks.cpp":"1926cfa73810704eb19b916c1b2cdb9321155e2f98b2a0a57c7c3c6e960540cd","glsl-optimizer/src/compiler/glsl/link_uniform_block_active_visitor.cpp":"1e14e06ca3b2c1089cfba2e8eaf0c1f373d9d6374b6082f320962dd71ae09611","glsl-optimizer/src/compiler/glsl/link_uniform_block_active_visitor.h":"fd58c155af645295bb6aec08797889de586f4d919731de2bce57e8dce59bb048","glsl-optimizer/src/compiler/glsl/link_uniform_blocks.cpp":"09589f49776dce32e6c4044937de7e0c839a9754ad31960148f8f9e010658997","glsl-optimizer/src/compiler/glsl/link_uniform_initializers.cpp":"bf98e08c12db466acf9623cbeb8fa8e3b4002512722e7a6521287f558a099f37","glsl-optimizer/src/compiler/glsl/link_uniforms.cpp":"84bad5b1377362cecf259b05124239be5220b03ce1c0c61b59bd9a47e4379af2","glsl-optimizer/src/compiler/glsl/link_varyings.cpp":"a5f1a53e7c80d635515fe808ff223d89fef1767abb0f2b7aa28fa6773dca353f","glsl-optimizer/src/compiler/glsl/link_varyings.h":"b9dbe018f038df69763df2e928742ce81bbc6e3aaba26f50621e30a6d9aa6220","glsl-optimizer/src/compiler/glsl/linker.cpp":"40b1ecd5d4f6c7f13d5a87ce390561a51fdf6f3fcd9b2197b9c88b03a773ba94","glsl-optimizer/src/compiler/glsl/linker.h":"ecf94b4ad75ef461c27c557fda4bd25f34c91930822b8e1d729ec84520d4a049","glsl-optimizer/src/compiler/glsl/linker_util.cpp":"1663ad88e2a369305659aeeffaedb5bd752cf76340a2ba5797fc0bf600633cf9","glsl-optimizer/src/compiler/glsl/linker_util.h":"6db788daf9c8e87ae2764b61a8b37ebe419e69c1b82ddee01986e37c978c6993","glsl-optimizer/src/compiler/glsl/list.h":"b1f46ce0e552fe7c45b2a19408a9d97662e23e4b182ab335491c26f8cf25886f","glsl-optimizer/src/compiler/glsl/loop_analysis.cpp":"57ecd573477c68091c7cc99537faa7139a8f395935e3d4f10144cefdefb5a611","glsl-optimizer/src/compiler/glsl/loop_analysis.h":"a85f045a038ee5b5176063e85d7988865862c44ab0580f771b993a042d0b69cc","glsl-optimizer/src/compiler/glsl/loop_unroll.cpp":"bd4292ea2809f5a669bcb76ceaa1ac365772dcd638c579c3ed10275214901a54","glsl-optimizer/src/compiler/glsl/lower_blend_equation_advanced.cpp":"8cfbef140d9c4b4d2f57bfa05c9c374d31a121d0f87afce94333f049023b654a","glsl-optimizer/src/compiler/glsl/lower_buffer_access.cpp":"1ae221c3c7a95aeb867207e7a742be635f91b406c157747bfd6ddf10274d97fb","glsl-optimizer/src/compiler/glsl/lower_buffer_access.h":"807886953a576a323591798cbca5e2df24295ea893b28affd8ffb5926cebaa04","glsl-optimizer/src/compiler/glsl/lower_builtins.cpp":"4d81afc32cf58e1481fcb5e42888ab93dbe6820310a20ff7a9982b77b2152d9b","glsl-optimizer/src/compiler/glsl/lower_const_arrays_to_uniforms.cpp":"608403f0eeeedf21cfcd3014116e0f44e28cbdf6c4c32aac7e613e64e30205e1","glsl-optimizer/src/compiler/glsl/lower_cs_derived.cpp":"179905cd47a294122adeb5b0abfed6f2f67782dcde21b544d1ee2c1985154e66","glsl-optimizer/src/compiler/glsl/lower_discard.cpp":"3b361b2db0004d544d64611cb50d5a6e364cf6c5f2e60c449085d7d753dd7fb0","glsl-optimizer/src/compiler/glsl/lower_discard_flow.cpp":"f5c29b6a27690bb5c91f196d1a1cf9f6be4f1025292311fe2dac561ce6774dee","glsl-optimizer/src/compiler/glsl/lower_distance.cpp":"a118c85493d5d22b2c059a930c51a5854896d4b1dade76598eaa985e5a3dff8c","glsl-optimizer/src/compiler/glsl/lower_if_to_cond_assign.cpp":"469e617757fd1728709cce021aac5c8da05ee503bf5366977bdc4ef7a6d83950","glsl-optimizer/src/compiler/glsl/lower_instructions.cpp":"6ff5c396abe40d8a2145d571e99e2bbe9143393e15aafc28adc2803a01d821b6","glsl-optimizer/src/compiler/glsl/lower_int64.cpp":"d1ed41196880dd53c7b13e2782f9423f8442bf1d46186e8be92b1b66218a83ee","glsl-optimizer/src/compiler/glsl/lower_jumps.cpp":"34de7b493f281589fb0c2c0f6e885d0a0fabbe7a4e97a73de374dd714777a58c","glsl-optimizer/src/compiler/glsl/lower_mat_op_to_vec.cpp":"dff7a308edc4846c348ed4225c6699a9c75abac68d88f41f85954276552779f4","glsl-optimizer/src/compiler/glsl/lower_named_interface_blocks.cpp":"16063ac127bff75a68272070ab11c21c25101edbff62b4c68f4983b4cd941af0","glsl-optimizer/src/compiler/glsl/lower_offset_array.cpp":"3b00773399135aea85746a5a68b96ef000bc6841be1a2c8e6f25c516628b0949","glsl-optimizer/src/compiler/glsl/lower_output_reads.cpp":"a0fc9975d5aa1617e21fc6c353659a9802da9e83779a3eef4ec584f74b4dadc5","glsl-optimizer/src/compiler/glsl/lower_packed_varyings.cpp":"7550099d4ae123d71541c2fc88bc04fbfe9271ec75d7e210987d1c8cac3cf3ea","glsl-optimizer/src/compiler/glsl/lower_packing_builtins.cpp":"79a13d161fe505a410ab948d92769395708693ec888153630fa240e5b97e356f","glsl-optimizer/src/compiler/glsl/lower_precision.cpp":"f82a185b879872b977a1787d8061b9a80bc4cf8db1b970db6efba2ad9cc20fa2","glsl-optimizer/src/compiler/glsl/lower_shared_reference.cpp":"ea2dccf50a83bc19391bf6b7ab6aa53c0005f427af4066d25140340af9a4beef","glsl-optimizer/src/compiler/glsl/lower_subroutine.cpp":"f69fa53650eeb6f2944fce4d36a6e0a423e6705f3a3bd3389c7fadb83cfc8802","glsl-optimizer/src/compiler/glsl/lower_tess_level.cpp":"b196c9d424c0569f3e85d75c2d125af21566cb113d69036db87c0990703e0fa7","glsl-optimizer/src/compiler/glsl/lower_texture_projection.cpp":"4d247f244272adc8250fd888d8d932a140dd5de4d1efc7a58492c3c2b8291527","glsl-optimizer/src/compiler/glsl/lower_ubo_reference.cpp":"89bdbc6c1669230c644c0857db1ce2781ec61d349ecd08c7914146e1f4750a4a","glsl-optimizer/src/compiler/glsl/lower_variable_index_to_cond_assign.cpp":"fce930f29ac9405b297d1f749d68f59506b89c70b4ee1b1ab8cf49a34cc71ecf","glsl-optimizer/src/compiler/glsl/lower_vec_index_to_cond_assign.cpp":"3c67d851a11a55fad1c49a550f3a0cfe50892d33a3f238ce266cd829eba510a8","glsl-optimizer/src/compiler/glsl/lower_vec_index_to_swizzle.cpp":"f5ec666b73e1415cbab32519a53605ed385f3b03e889560373dbce69dda5000e","glsl-optimizer/src/compiler/glsl/lower_vector.cpp":"f7c13f5572ebe09b6a71553133b2cf003cd4b77b9657600672ee3b21bf890725","glsl-optimizer/src/compiler/glsl/lower_vector_derefs.cpp":"b05793da6dd620a531b43df5af8b2ecbc37b9db0c88910f5724ea10bcd057e19","glsl-optimizer/src/compiler/glsl/lower_vector_insert.cpp":"fee772ec17eea5e86a529bf9c5fa2ee0d29a5982bb75ebc6d68ed36cd19aa299","glsl-optimizer/src/compiler/glsl/lower_vertex_id.cpp":"690e8715182e03fead5cc5a35251fb4f41b357e4c71a1dfbc4bd7be19862b56d","glsl-optimizer/src/compiler/glsl/lower_xfb_varying.cpp":"58c0e8b270e4bbde54250be03cdb2f36966bcafb785372ad2e2b786835df7f9f","glsl-optimizer/src/compiler/glsl/main.cpp":"ae5e88abbbc8a12f769e1296bad938b9d7398cc6da0d3d0caeceeeb876536850","glsl-optimizer/src/compiler/glsl/opt_add_neg_to_sub.h":"f5054944bfd068810629080d0ea11df78b3f57a8f86df75e13ca50157ad1964d","glsl-optimizer/src/compiler/glsl/opt_algebraic.cpp":"25f45b20e1972ee8c789177a1aeda6e4286c25db2eae3a43ff83029ae64969c0","glsl-optimizer/src/compiler/glsl/opt_array_splitting.cpp":"19d3ce0e815438f4df9ab2890e767b03a4f3f191b53bb30c0217cf2ae6a95430","glsl-optimizer/src/compiler/glsl/opt_conditional_discard.cpp":"0e44e0e126711a3725c1f3a2aa65ff03c381fed08680ffc30101aae60f716c4e","glsl-optimizer/src/compiler/glsl/opt_constant_folding.cpp":"a088d04d9b45f9e55e235835648f614c89b7803c03a6d4f6a6d1a6bc1f0228bd","glsl-optimizer/src/compiler/glsl/opt_constant_propagation.cpp":"8a9440d77ecd6dcf13e683cbb99943aab6311c8fd4b5f6a9189a8d4f270746f4","glsl-optimizer/src/compiler/glsl/opt_constant_variable.cpp":"63d3ccd4dd09f19c9cf1a2f51592111bed41284504f29f3c0de4cadebc439a37","glsl-optimizer/src/compiler/glsl/opt_copy_propagation_elements.cpp":"ffa0f50863995e0d2e31f55a52e82319edc71e520987bebd7f7e561ea331c64b","glsl-optimizer/src/compiler/glsl/opt_dead_builtin_variables.cpp":"84e8747b948232f01dd56b428b9315f96f9511f605f240119fc446fae28981a9","glsl-optimizer/src/compiler/glsl/opt_dead_builtin_varyings.cpp":"761523e88f5b3ba785170f4d7205e94fa99acb7e74d29efbe40e1c010e1dbdb3","glsl-optimizer/src/compiler/glsl/opt_dead_code.cpp":"fd1ba2da7337d4e5dad17f5c2d73d9cc8880305f423e85d64cf94553588fa401","glsl-optimizer/src/compiler/glsl/opt_dead_code_local.cpp":"969a598b4df322baf222258a66cd64a326ea20e5b3125be9d8d1771f522c69e0","glsl-optimizer/src/compiler/glsl/opt_dead_functions.cpp":"774cae6536d02edf26e996a2a895e1f62d5098f16dc96b44798b4fc731a9a95f","glsl-optimizer/src/compiler/glsl/opt_flatten_nested_if_blocks.cpp":"3696a5c55f02e20056e085bc2714f73ac992f221b6f3387d655068e86b512046","glsl-optimizer/src/compiler/glsl/opt_flip_matrices.cpp":"44f0fe05b49329667671f88c96dc86ab3fe1459ff7b87f2b2d88de2d49829f9f","glsl-optimizer/src/compiler/glsl/opt_function_inlining.cpp":"fb56a33c90419a01676b57cbd91d0674a54cca40e6defaacc88dd33facebc131","glsl-optimizer/src/compiler/glsl/opt_if_simplification.cpp":"ac406eb35e379c357641d6c5749f50c65961455924d3dc884e2b90046fa92c5c","glsl-optimizer/src/compiler/glsl/opt_minmax.cpp":"8abd59d3b14ef60ff14a9c69660e6945f5cf10b97edb4afebe56be3f81d96316","glsl-optimizer/src/compiler/glsl/opt_rebalance_tree.cpp":"8bb6329dc0f299042368fc81934c2df019b45ab9f7aa0415d4e57b8d1ff98c9f","glsl-optimizer/src/compiler/glsl/opt_redundant_jumps.cpp":"222c73e2ac7a938ebb6428cc6c780c908ff6156d8ff935b04fed93a48fc10496","glsl-optimizer/src/compiler/glsl/opt_structure_splitting.cpp":"2edc79cc13f3177934e0443ad62f5976a1991f01f86ea303a803434849b13a47","glsl-optimizer/src/compiler/glsl/opt_swizzle.cpp":"015d0abddfe507f67c4b96c82988d861d018ededf7bf055e2bcbe9ea92da694e","glsl-optimizer/src/compiler/glsl/opt_tree_grafting.cpp":"46d28ac983ea244a4315bdc0e8892979ec4d1f9b9a96ac8a8a08006d9bc5e878","glsl-optimizer/src/compiler/glsl/opt_vectorize.cpp":"d80ee43bb97d9f016fb9c5e1e06f5b2afa569811f368ba067be794ec11d085fb","glsl-optimizer/src/compiler/glsl/program.h":"2982447e2abd35371e273ad87951722782a8b21c08294f67c39d987da1e1c55f","glsl-optimizer/src/compiler/glsl/propagate_invariance.cpp":"080943e21baa32494723a2eefb185915d2daae1f46d6df420145c5ad6857e119","glsl-optimizer/src/compiler/glsl/s_expression.cpp":"1ced972bc6ecc8eab4116ea71fb0212ab9ae5bcc0be3b47aa5d9d903566b3af1","glsl-optimizer/src/compiler/glsl/s_expression.h":"65b847e30e22a809b57d0bc70243049c99d9c6318803c5b8d0826aba55dc217e","glsl-optimizer/src/compiler/glsl/serialize.cpp":"be0eb4251348a9d921acb839a5c48c6023a2e9d116d602bb0432787ab623655d","glsl-optimizer/src/compiler/glsl/serialize.h":"57425732eba1233d928e5f07f88b623ce65af46b3bb034bf147f0a4b7f94f9a1","glsl-optimizer/src/compiler/glsl/shader_cache.cpp":"e0c5c433f2df3fccdf1d61281bfcb0ee5633433339b97c697d64db99611cbaaf","glsl-optimizer/src/compiler/glsl/shader_cache.h":"9217164d8d7f54aca0fe5922c7187095a6ae0cb703b196b79805aeef07a7e697","glsl-optimizer/src/compiler/glsl/standalone.cpp":"8e6c416a14d631261917a5fe4cc91880c287b22b2dfd70eb22028289a8fa5364","glsl-optimizer/src/compiler/glsl/standalone.h":"a7c397d1dfdd1e7fb2cfe99db35cd9df93251e642059208533202b7f20497f83","glsl-optimizer/src/compiler/glsl/standalone_scaffolding.cpp":"970d14b7a9d58e5270321f97bf5d57795558b1c570a56678e04a65b26c60bf4f","glsl-optimizer/src/compiler/glsl/standalone_scaffolding.h":"d921a617ea82b9e49413314492a645c44356de503581b1be3f1b57de236e480d","glsl-optimizer/src/compiler/glsl/string_to_uint_map.cpp":"d824bf5b839bd39498dc9e457103cdbe3e5289ddf7564107c27b1505948dd31f","glsl-optimizer/src/compiler/glsl/string_to_uint_map.h":"e2f18e66359c9d620e085de7f4a334a47df9c66e65a5bfe8b734c627bec04104","glsl-optimizer/src/compiler/glsl/test_optpass.h":"b27b8f35f5387e7ce4982bb51c7b63ccf14f91757f3108a5d02ed006925bb8a0","glsl-optimizer/src/compiler/glsl/xxd.py":"376484142f27f45090ea8203ae2621abf73f06175cb0ee8d96f44a3b9327f4bd","glsl-optimizer/src/compiler/glsl_types.cpp":"044bb6754f45419a3151e7a25c39202a82009ae3c6bc54ff7f0bb4258a5deefe","glsl-optimizer/src/compiler/glsl_types.h":"fd899a42f34ddeb8601bc3cd6c5e3aed82fc8aef4042dde1b39b3c01e1dcc219","glsl-optimizer/src/compiler/shader_enums.c":"436bff5216b11b0980bdfada5885fc6ac9afa2037a3027fcd6eea2a8635597ac","glsl-optimizer/src/compiler/shader_enums.h":"13220442a5c02e83540cf2c0ad4f8417b2fbda5f2586dec4e92082544c937cdd","glsl-optimizer/src/compiler/shader_info.h":"4c5453e81197ca83593ee4f365074b23530f2ab21c78e1733b63dec6f344c12a","glsl-optimizer/src/gallium/auxiliary/util/u_half.h":"3c2b37bda3ccb64387e44b723d29cf9046decab1a893bf42d842e9603398bdee","glsl-optimizer/src/gallium/include/pipe/p_compiler.h":"c75620096ce8523dae90599e50aa2ef6468d3b0e368a77795edeb20dd1abfc0c","glsl-optimizer/src/gallium/include/pipe/p_config.h":"a27692fc35f9e55df3224b7529e66b3001e911e94e6bc5f8f569e493e1ee3fb7","glsl-optimizer/src/gallium/include/pipe/p_defines.h":"be26d68c0acc67c5e44788c6299716a9eee415fd81d7d747e3738a829e3b6b38","glsl-optimizer/src/gallium/include/pipe/p_format.h":"5674215fc41d27496f037cf837717daefbf23ebb38d40ace7c0c414bc08182b0","glsl-optimizer/src/gallium/include/pipe/p_state.h":"d600593aba5f5a17072a6c38f6baa81e01c7994b0174250f7e433bb41684b702","glsl-optimizer/src/mapi/glapi/glapi.h":"73632a625c0ddabc401205e8b5a81eb8af8506868efe4b170d7979ec3619e9c5","glsl-optimizer/src/mesa/main/config.h":"5800259373099e5405de2eb52619f9de242552a479902a3a642a333c8cb3c1e7","glsl-optimizer/src/mesa/main/context.c":"2f3208473d99c94f734b1137ba91889d4a1babb9e7534bf1dc85d851ee98274e","glsl-optimizer/src/mesa/main/context.h":"cc7e4194797db9d007f01884e23d786c453b3860821f7f2ddcdf0f1bf3f8ffb1","glsl-optimizer/src/mesa/main/dd.h":"6a964acd06b6c2d88700e69fb75fe3c6b3b3d45bbc41db24f3f897a29695fe0c","glsl-optimizer/src/mesa/main/debug_output.h":"7312422e90b8c0e34028ac27280e438139b5cba525c99deb3ac883cd3d87e452","glsl-optimizer/src/mesa/main/draw.h":"7eaef3a9e27a60ea6f7937109bf3a6190b831162fde0479abb12077ce27c353d","glsl-optimizer/src/mesa/main/enums.h":"87d562a6764f51c014a2274fa7c3aca17c04441537ddd56b2554f13c6fffea92","glsl-optimizer/src/mesa/main/errors.h":"c79444b5df289c90fbb22a33b2d0c23917d9fc4510960088f0b79e53bb56b1b2","glsl-optimizer/src/mesa/main/extensions.h":"a38b2f87cc93c513994281350d69e06c84ff8eded5313ec0a1be33f375e0ebbd","glsl-optimizer/src/mesa/main/extensions_table.c":"17642d1a8c9a0bf2bd61060052d33ff14a005d2b962e6cf91465797a50851e85","glsl-optimizer/src/mesa/main/extensions_table.h":"2c879571c238d2e14461031ac740372fd0f9ac3a34c0d5541bb9b7ed4c0376c8","glsl-optimizer/src/mesa/main/formats.h":"02e2f7ec3e39286cf9f27e2641043e6df8ecb1dfde9e643313210e214af2a929","glsl-optimizer/src/mesa/main/glheader.h":"58217b33eead6aa6b23cd4a291cefeaa6cb84e465f4960daffca97c44d6d1c35","glsl-optimizer/src/mesa/main/glthread.h":"51fb2711f77e7eafcfc52d29d5b844978832b24c930d88accd48d143a6eb9c6f","glsl-optimizer/src/mesa/main/hash.h":"7e7f782034c16a8e693de48e00c31d4a90b0129f4029fd074033d7d16ccbe718","glsl-optimizer/src/mesa/main/macros.h":"73d15ddfd64f2b57b9b2ffeeb993b9c2c0899a80563e9d6ff337b11ccbe6eee5","glsl-optimizer/src/mesa/main/menums.h":"5dfac0e2279d60b0cd0c7b9fc2a5021620d0f6282ed2e738c420214e3af152d3","glsl-optimizer/src/mesa/main/mesa_private.h":"edda678b93438944279a551f663b8858ad84814a9fc88ba9672ef195599c24ae","glsl-optimizer/src/mesa/main/mtypes.h":"6efddefa099e4d2e3fdd97f0055644f47aba21711385edfeabc2d9b0676f2eec","glsl-optimizer/src/mesa/main/shaderobj.h":"9f0dfe96d0c2154201adef942bd36053533ac7b2492fb3786acda5bea514c75e","glsl-optimizer/src/mesa/main/uniforms.h":"4e331e6ad6e9cbded978b4082dbe0a57c1f8f01327446bb6892bfc179976c38b","glsl-optimizer/src/mesa/main/version.h":"9d0a13a758099302dc55cf7d045791834a89b0f9d4cf17b2692259b369a8a9a1","glsl-optimizer/src/mesa/math/m_matrix.h":"a37b19f182e070db3df93b0ede43c22fb8be8c2906504133ee6dbd7db1185d8b","glsl-optimizer/src/mesa/program/dummy_errors.c":"1820e305515b4c5e041f5e1623266a48ec8f076a155310be7d60637101f593e4","glsl-optimizer/src/mesa/program/ir_to_mesa.h":"b47f58d22e3ca2ae42d52501ea769d15c4476834944fa97eeccd3a3439211d00","glsl-optimizer/src/mesa/program/prog_instruction.h":"ab3832152a7e144b59e5a2264b2c29db56d93be31e76bbd958527a56771b40eb","glsl-optimizer/src/mesa/program/prog_parameter.h":"ba18c743284eadbc837c2c364c73e5d372321a7637a76e589d8d39fe8b5de225","glsl-optimizer/src/mesa/program/prog_statevars.h":"fc413698f84bc52d45fdeae0471934ee9904bfb7eac1a2b5f70446e54bcbbdca","glsl-optimizer/src/mesa/program/program.h":"1f01026a4eff440a3f122fd9b519d03546fe7f7d8be60dca834e95a2f8fbbfd2","glsl-optimizer/src/mesa/program/symbol_table.c":"6611cb9f078035bf5ff8c9112093a6c7d99f8af99a3931d0c07f227cc72283ea","glsl-optimizer/src/mesa/program/symbol_table.h":"631dc35ac48d5e87962d45507461920f6575610960ffcc42a08cefeb43300cda","glsl-optimizer/src/mesa/vbo/vbo.h":"6eb1dcd9a08c92f276c5fe08da184ff9d455d1be421913b8ad732a7b65e858fb","glsl-optimizer/src/util/bitscan.h":"9e49e694e6b34fe035bc685f32588827eb8cbe7d82878963c7ab52843e1c16aa","glsl-optimizer/src/util/bitset.h":"c40f78515c6230fed18345c6751ce33833a49da7a27901c7e6d7340cbdcbc5e7","glsl-optimizer/src/util/blob.c":"8f729846f66efc9c15485cc5fc24c6ec861fc1fecb2f652573f2a237d481b791","glsl-optimizer/src/util/blob.h":"93e1eaac866b9a7cd6fc03b533c18fb2edf0e97f03395eff4f3a605c4fc14d0c","glsl-optimizer/src/util/compiler.h":"79e3bf40a5bab704e6c949f23a1352759607bb57d80e5d8df2ef159755f10b68","glsl-optimizer/src/util/crc32.c":"2f3467a046b3a76784ecb9aa55d527698c8607fd0b12c622f6691aaa77b58505","glsl-optimizer/src/util/crc32.h":"59bd81865e51042b73a86f8fb117c312418df095fed2d828c5c1d1c8b6fc6cd4","glsl-optimizer/src/util/debug.c":"c3d68e9752ccc19e66c669562cd113cf1d0ac83cbb30174789e7fb8d1df58f9c","glsl-optimizer/src/util/debug.h":"50068d745c4199ccbd33d68dd4c8a36d2b5179c7869a21e75906ddd0718ca456","glsl-optimizer/src/util/detect_os.h":"343a8790d17a3710c6dd015ee367f84e3902ff3f2e36faca2bf93f9d725d3574","glsl-optimizer/src/util/disk_cache.c":"f533937e5a4fffe76e2739ef4b6b1e1da097d96d63eb808e68ebbc7027641c23","glsl-optimizer/src/util/disk_cache.h":"e83314fb14134a8e079b15e470a6376ba5a8253701f048c890a62b7e55d64bc8","glsl-optimizer/src/util/fast_urem_by_const.h":"e108fce804616c47d071dfe4a04163eec1126e448ed1aa89abb6b3a6d772bd5b","glsl-optimizer/src/util/fnv1a.h":"ab2596f19c6adf431ae27618f62c5743e24ad23ef83bb359a4c4c218245ab459","glsl-optimizer/src/util/format/u_format.h":"4cdfc0c59cbc99a092e5ec5a396910f2d93b9643e5d8141050b011e66f11e45b","glsl-optimizer/src/util/futex.h":"26f7c9d86e9ffef4c0fa2761f1aaa1918337302e20bd6ca10e61dc3c47356deb","glsl-optimizer/src/util/half_float.c":"11bc2584493d5d9d46e8c8a619a0307cf150bf5ab5d0f96bb764b061dc37a00e","glsl-optimizer/src/util/half_float.h":"7f7c380f126da1400a91758cc0392f24bf967bce1672890b62be26fe9fbd922b","glsl-optimizer/src/util/hash_table.c":"0ca40352e35dedab0a84c64c903f1b16d47e950bb5f43b4d22bb57d499bfea6e","glsl-optimizer/src/util/hash_table.h":"217191bb360592e2232f187473c10287d2cda8ae6fa5c53d0ef74c8c206118b4","glsl-optimizer/src/util/list.h":"9fab03c6a78186bb5f173269f825f6ce976b409d931852e3d93bac632e07989a","glsl-optimizer/src/util/macros.h":"63faf65b51058c483b17f1f77da51d1c53c8beab52678cb6bd01f1228a63b6b0","glsl-optimizer/src/util/mesa-sha1.c":"00c692ec353ebc02c06c57c5a71de0ab7a119f86a4146f452e65ec87e4944417","glsl-optimizer/src/util/mesa-sha1.h":"bff4c29f4bf7cdbcefb30fa0c996a7604a380eba8976467c2a60e7cd328f7e26","glsl-optimizer/src/util/mesa-sha1_test.c":"25da89a59d51469f77b4c468ca23ffdce0a7a1166a70b6cc23026a6800b0143c","glsl-optimizer/src/util/os_memory.h":"64555faf1760ae6954f42c83727c38dfc4c278e9152115779ffaad58b42adacf","glsl-optimizer/src/util/os_memory_aligned.h":"12d86fa94be38c13f7eeebdf313795e1267dd5a7187d2f0072e0e896f41702f6","glsl-optimizer/src/util/os_memory_stdc.h":"07360363b88c927065e10df71bebf6c8a0cc3b9167c9dfce55f2d65f11e6f787","glsl-optimizer/src/util/os_misc.c":"a9936e613ec84803abd59ad47c192c8e3939993c950ac91973fdc4cec1801bb8","glsl-optimizer/src/util/os_misc.h":"cc68eb12e05b5e749c54298cb4a6f4cd20cc5af7db3403e70b3c27b56090c740","glsl-optimizer/src/util/os_time.h":"73e775f7335244ff5964c678c27eedf1aea6abea44c4169d327ea8c7ce4a3a88","glsl-optimizer/src/util/ralloc.c":"4b51189595ef67bcef52c40cbf654d969041dbd15e15d4a893ad494ac060aeca","glsl-optimizer/src/util/ralloc.h":"e573c45875ff1530f0dbee9a93ae55535fdac8d5cc88a79ebc327c688824bde5","glsl-optimizer/src/util/rounding.h":"0450722353caf83de07e67f335949dbe95fe53b534052d4ee9d28d2781387614","glsl-optimizer/src/util/set.c":"86f8c9a830bead5a5a79bc970b0ff97809312af07b3beb39ef9d90af04d40a1b","glsl-optimizer/src/util/set.h":"3e39ca161e7ed4ec7c436cc9c7919ed9a55ed1b71edbf2caf6f9bcfd9bc578ed","glsl-optimizer/src/util/sha1/README":"00af7419af05247081858acb2902efd99fcda2ce16e331079f701645bb3729c0","glsl-optimizer/src/util/sha1/sha1.c":"1403bbe0aad42ba3e6be7e09f7cad87a6a8c4ad5b63962f7b92b9f37d8133b04","glsl-optimizer/src/util/sha1/sha1.h":"68d9f240eab2918026ecdf22be36811abbd4f1389f6c36e31258041aeaedd247","glsl-optimizer/src/util/simple_mtx.h":"12c6c3c4b7db9168bc656d5b3c65912075084d2b388c415d5c3d3f5953a9d6c7","glsl-optimizer/src/util/softfloat.c":"a97e51a96fe5e6a052c02aa6bbec683fe73fb88a8c087d9c930503e2120d8a2e","glsl-optimizer/src/util/softfloat.h":"66664b0250e83bf5dd4cc743acd119d076efcea624a0eab3d6b60718e6ee8811","glsl-optimizer/src/util/string_buffer.c":"63a1d1b1e34926c88ea00159cafbcd56568b805c4f64d1e8c97169fe313921fc","glsl-optimizer/src/util/string_buffer.h":"7b88d1b1d9c6cfb8e93331813535c127289437c75f822029e9a3bca8ea6b52ee","glsl-optimizer/src/util/strndup.h":"0273c4fdb7482cd7746881a63d3998648c6d63415ba85af1d1860f0e0dc504c6","glsl-optimizer/src/util/strtod.c":"5cf610d8a37373cf37cfb7aae903525d943b2674b1f32594c70b0eb19a8c9697","glsl-optimizer/src/util/strtod.h":"237396def4e264d35ed4bedea00ef9a4ceab6d7a11a18c770d9747d22c69ed2d","glsl-optimizer/src/util/u_atomic.h":"c02e809526c6c09ba8fe51f50b2490d1b6c8e5c7f3c4031ae958250d098fc3bb","glsl-optimizer/src/util/u_debug.c":"8c060e379b816618f3dd22c9ea523c68b9425c76c36a7dfe5d6d375b337f5f4a","glsl-optimizer/src/util/u_debug.h":"e11e26edd9b9e4e6f8e6a435e69f4d9edda27e9a379f68f4c82ea2525aaaea68","glsl-optimizer/src/util/u_dynarray.h":"853d0fa6ff2261614488be624deb8a2b01e57c2c8eabc28578cbeed4ccc95694","glsl-optimizer/src/util/u_endian.h":"3ccea7e529740318d8a4b05c00db3adc9d1e292a52bdc56a05c9fae99209720f","glsl-optimizer/src/util/u_math.c":"c868a8c0886dc78f1b06b13404ba8b253090449045774dd56893ac9d75795184","glsl-optimizer/src/util/u_math.h":"a04e32e126db016413f9de0a2028a3e71737137463b1289eae576f884b06fcf1","glsl-optimizer/src/util/u_memory.h":"c5db17c724c70283ddbe04165722f6988d4e0eb9aa3602ae472feff016649af9","glsl-optimizer/src/util/u_queue.h":"92930ce236c0528a98b695f5cea8c5c6aa9683beaf71a2227bdc5d33d1b21506","glsl-optimizer/src/util/u_string.h":"c5a2f4ef576d1547bda12c4ea219179fefa54414977743ac094abcaf696ef6ca","glsl-optimizer/src/util/u_thread.h":"00b708459b27f9910d18db92c18cc65cfc618ac2b3cd144e45f8640057b10d58","glsl-optimizer/src/util/xxhash.h":"2f2aff2fc6c0c929f52cf6ae7314122124c5be026d41ad1c357608383c4a37ad","src/bindings.rs":"79993db2058bde39f99ef483d02560d33b1cb882f6a552319e8b86eb6f9021e1","src/lib.rs":"04be1554cd829eb40864b06d80b491dd48117a4e3a601c7d482117f7a0391e67","wrapper.hpp":"f3ea34cc496f7d90b9bfcada3250b37b314c3524dac693b2ece9517bc7d274ac"},"package":"8ba4741358604ca0848c27ecc069d68e62e11cde81e38aac1da3c54b79ab5adf"} +\ No newline at end of file ++{"files":{"Cargo.lock":"f7970552595dc803ace9ef19b5f5d7b1fc784aac30cb27b2ebc3002d97122b9d","Cargo.toml":"7c53ee20d848f9913cacbfcb3ab2e89e30deee8d619d173c95130c7c5d065827","README.md":"4468e08c64c19977707d792bfab0080e35ff927b64990eab77873f8ba056ba1c","build.rs":"92e29699487c21389fc823c50b410cfbfc74cc774265d24958489909ee48a076","glsl-optimizer/CMakeLists.txt":"42ce94744e82ffa000da8b64d81fc140e293b9f5da7dd4cf6b49e7404a2448d9","glsl-optimizer/README.md":"b18eef11a92d267d88a937b1154f7670ee433c730b102fdf7e2da0b02722b146","glsl-optimizer/contrib/glslopt/Main.cpp":"14ba213210c62e234b8d9b0052105fed28eedd83d535ebe85acc10bda7322dd4","glsl-optimizer/contrib/glslopt/Readme":"65d2a6f1aa1dc61e903e090cdade027abad33e02e7c9c81e07dc80508acadec4","glsl-optimizer/generateParsers.sh":"878a97db5d3b69eb3b4c3a95780763b373cfcc0c02e0b28894f162dbbd1b8848","glsl-optimizer/include/GL/gl.h":"1989b51365b6d7d0c48ff6e8b181ef75e2cdf71bfb1626b1cc4362e2f54854a3","glsl-optimizer/include/GL/glext.h":"2ac3681045a35a2194a81a960cad395c04bef1c8a20ef46b799fb24af3ec5f70","glsl-optimizer/include/KHR/khrplatform.h":"1448141a0c054d7f46edfb63f4fe6c203acf9591974049481c32442fb03fd6ed","glsl-optimizer/include/c11/threads.h":"56e9e592b28df19f0db432125223cb3eb5c0c1f960c22db96a15692e14776337","glsl-optimizer/include/c11/threads_posix.h":"f922e2c8613582a9340aa5ae37a4f7bd962dbc30e33a7a6ab14bed2d2995bc2b","glsl-optimizer/include/c11/threads_win32.h":"95bf19d7fc14d328a016889afd583e4c49c050a93bcfb114bd2e9130a4532488","glsl-optimizer/include/c11_compat.h":"103fedb48f658d36cb416c9c9e5ea4d70dff181aab551fcb1028107d098ffa3e","glsl-optimizer/include/c99_compat.h":"aafad02f1ea90a7857636913ea21617a0fcd6197256dcfc6dd97bb3410ba892e","glsl-optimizer/include/no_extern_c.h":"40069dbb6dd2843658d442f926e609c7799b9c296046a90b62b570774fd618f5","glsl-optimizer/license.txt":"e26a745226f4a46b3ca00ffbe8be18507362189a2863d04b4f563ba176a9a836","glsl-optimizer/src/compiler/builtin_type_macros.h":"5b4fc4d4da7b07f997b6eb569e37db79fa0735286575ef1fab08d419e76776ff","glsl-optimizer/src/compiler/glsl/README":"e7d408b621c1b605857c4cab63902f615edb06b530142b91ac040808df6e22f7","glsl-optimizer/src/compiler/glsl/TODO":"dd3b7a098e6f9c85ca8c99ce6dea49d65bb75d4cea243b917f29e4ad2c974603","glsl-optimizer/src/compiler/glsl/ast.h":"3e68ff374350c49211a9931f7f55a485d8d89fc4b21caaffbf6655009ad95bf8","glsl-optimizer/src/compiler/glsl/ast_array_index.cpp":"92b4d501f33e0544c00d14e4f8837753afd916c2b42e076ccc95c9e8fc37ba94","glsl-optimizer/src/compiler/glsl/ast_expr.cpp":"afd712a7b1beb2b633888f4a0911b0a8e4ae5eb5ab9c1e3f247d518cdaaa56d6","glsl-optimizer/src/compiler/glsl/ast_function.cpp":"74f4fbd490e366b37f4715168bb3465ecd9334d4130942f75dcc8e80e8e7f027","glsl-optimizer/src/compiler/glsl/ast_to_hir.cpp":"d0f798eb09271d41d068b9e7b18220d37f1ed0083300ab51eba30989698fe23d","glsl-optimizer/src/compiler/glsl/ast_type.cpp":"8eb790b24b26dfb72bdc333744b566c26d8464c5d47d20eae659461f5c4899f7","glsl-optimizer/src/compiler/glsl/builtin_functions.cpp":"454189d643c220fcb49116ee5c8a34f7b349aa67564040deb8607f6a41a15e70","glsl-optimizer/src/compiler/glsl/builtin_functions.h":"a37cad7ed09b522c5b8bec7b80115a36846e7ba6e0874a2a858e32f7f202c665","glsl-optimizer/src/compiler/glsl/builtin_int64.h":"619def6f3aebf180da3944ef08f159ab12a58b24767e41d8b985ac37ded54d62","glsl-optimizer/src/compiler/glsl/builtin_types.cpp":"afec060b62d6f3b00bfbf94e9fa5f96341ce096c128d1eef322791e6ed9cea4d","glsl-optimizer/src/compiler/glsl/builtin_variables.cpp":"6563bfb1345cbca4c77e00eef09ad152f3e1dc271d246a08c5ce9e1f4ce4250a","glsl-optimizer/src/compiler/glsl/float64.glsl":"1072fd888be48c2a7a5117cd2d92a65f034965a66375f598bb856bff5d7be766","glsl-optimizer/src/compiler/glsl/generate_ir.cpp":"e5f0175370a0d07f93c48d3f0f1b8233d12c64a7b02de02dcc753ef7b398ef0f","glsl-optimizer/src/compiler/glsl/glcpp/README":"a0332a1b221d047e9cce5181a64d4ac4056046fd878360ec8ae3a7b1e062bcff","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-lex.c":"2d179879b1ffe84f58875eee5b0c19b6bae9c973b0c48e6bcd99978f2f501c80","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-lex.l":"e4c5744c837200dafd7c15a912d13f650308ea552454d4fa67271bc0a5bde118","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-parse.c":"03494f9ce1cb82260506e2559e73a3eeb622c4bd51b65eaa0a2c3351862bd4c8","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-parse.h":"264d9a18421cde255ce34a0a62b3d8e73465359f0d167e64aa3973062aae5bdd","glsl-optimizer/src/compiler/glsl/glcpp/glcpp-parse.y":"fafb66e3a8f149d19e085f18a4273ba6d4c11af9e9a01d665cc784dddf97b79f","glsl-optimizer/src/compiler/glsl/glcpp/glcpp.c":"37ed294403c2abfd17fd999d1ae8d11b170e5e9c878979fefac74a31195c96b0","glsl-optimizer/src/compiler/glsl/glcpp/glcpp.h":"85ac8b444bcbd0822b66448a1da407b6ae5467b649f5afaf5c58325bd7569468","glsl-optimizer/src/compiler/glsl/glcpp/pp.c":"a52d94f1bcb3fb2747a95709c4a77c25de7eea8354d2b83bb18efd96976a4473","glsl-optimizer/src/compiler/glsl/glcpp/pp_standalone_scaffolding.c":"d11aeb3acfe966d1b78f1ee49804093f2434214c41391d139ffcb67b69dc9862","glsl-optimizer/src/compiler/glsl/glcpp/pp_standalone_scaffolding.h":"abbf1f36ec5a92d035bfbb841b9452287d147616e56373cdbee1c0e55af46406","glsl-optimizer/src/compiler/glsl/glsl_lexer.cpp":"272b9fc1383d72b81bfc03fa11fdf82270ed91a294e523f9ce2b4554bd3effa9","glsl-optimizer/src/compiler/glsl/glsl_lexer.ll":"2b57d9f9eb830c3d7961d4533048a158ee6f458c8d05c65bea7b7cfbc36e4458","glsl-optimizer/src/compiler/glsl/glsl_optimizer.cpp":"f8095d20629d0af70be930b0612e169edb274551a1d25a3cd1bf9995a11ce2e8","glsl-optimizer/src/compiler/glsl/glsl_optimizer.h":"22e843b4ec53ba5f6cd85ca5f7bad33922dca8061b19fb512d46f1caca8d4757","glsl-optimizer/src/compiler/glsl/glsl_parser.cpp":"126baf368d525aba301854e3d91ba60b5aee32e1102376af71416f32cb95ec48","glsl-optimizer/src/compiler/glsl/glsl_parser.h":"2ea9a50716098a8f7bef782d2a030d757b68da73afb01b4d4940d3e8381d44e8","glsl-optimizer/src/compiler/glsl/glsl_parser.yy":"6b1fd1576b29fce005dff744a6dbd0219e4c695c361d61864e1f3a8d6fa6b764","glsl-optimizer/src/compiler/glsl/glsl_parser_extras.cpp":"aad64b5b66467da650091430681e8c6a820cf3cadc4db3c160bf2f15875390ae","glsl-optimizer/src/compiler/glsl/glsl_parser_extras.h":"71fd0e92bbdb193dfb067d7bfdb1200d77392be2fbd0cbfc9ca89d1bb4c7e741","glsl-optimizer/src/compiler/glsl/glsl_symbol_table.cpp":"6660fb83c0ddddbbd64581d46ccfdb9c84bfaa99d13348c289e6442ab00df046","glsl-optimizer/src/compiler/glsl/glsl_symbol_table.h":"24682b8304e0ea3f6318ddb8c859686bd1faee23cd0511d1760977ae975d41bf","glsl-optimizer/src/compiler/glsl/hir_field_selection.cpp":"72a039b0fcab4161788def9e4bedac7ac06a20d8e13146529c6d246bd5202afd","glsl-optimizer/src/compiler/glsl/int64.glsl":"303dbe95dde44b91aee3e38b115b92028400d6a92f9268975d607471984e13eb","glsl-optimizer/src/compiler/glsl/ir.cpp":"2b4741cce90b5d4abff5d719c7324e2693c67294d4d99736cb241554adb281bc","glsl-optimizer/src/compiler/glsl/ir.h":"990b1c74447c4eb4835353ccb0ed9aea644f97fc1129ef1739cd935075d85d2e","glsl-optimizer/src/compiler/glsl/ir_array_refcount.cpp":"8cdc1cffe01e42e0566fa2193a75f789628e8025ad1b82f0ee6f204451b7f9f7","glsl-optimizer/src/compiler/glsl/ir_array_refcount.h":"75f06ec81342b379096ca52e1dc0fd5f19a11ff8e9b58203c20628179d644c12","glsl-optimizer/src/compiler/glsl/ir_basic_block.cpp":"1e2920b1c0ecb08424c745c558f84d0d7e44b74585cf2cc2265dc4dfede3fa2f","glsl-optimizer/src/compiler/glsl/ir_basic_block.h":"81be7da0fc0ee547cd13ec60c1fcd7d3ce3d70d7e5e988f01a3b43a827acdf05","glsl-optimizer/src/compiler/glsl/ir_builder.cpp":"daba29c5a1efdd5a9754f420eb3e2ebdf73485273497f40d4863dadeddb23c0d","glsl-optimizer/src/compiler/glsl/ir_builder.h":"2822e74dd3f6e3df8b300af27d5b11ea2dd99d0e5e7ca809b7bbcce9833c483c","glsl-optimizer/src/compiler/glsl/ir_builder_print_visitor.cpp":"8c6df5abf2fe313363f285f171c19ca6c8ee4f3bc2ed79d33c0c88cc8be45c48","glsl-optimizer/src/compiler/glsl/ir_builder_print_visitor.h":"799852adc3a0e54d04080655e7cebfa0d3bf5b6ffed5d8414f141380665d4db7","glsl-optimizer/src/compiler/glsl/ir_clone.cpp":"d897a4e1f5bbec4a6a2f15044c1be9a4d13899c73be77335b041049a4589aa5d","glsl-optimizer/src/compiler/glsl/ir_constant_expression.cpp":"78bd87ddb09db67f6c499067728d72aef4f16aa02721a99a4b769d1e0cfa9010","glsl-optimizer/src/compiler/glsl/ir_equals.cpp":"bca28533a6310b0fc152b56d80872368f1510dc62ed6e8ac199b9ffa7fac02e7","glsl-optimizer/src/compiler/glsl/ir_expression_flattening.cpp":"7e918d4e1f237eca01396004015865ce345afe32a876c9dbc6728576a1a7eae4","glsl-optimizer/src/compiler/glsl/ir_expression_flattening.h":"f45b66aa9497520e7e08e612d24b308477c34477fbd963ee9320eac664957f16","glsl-optimizer/src/compiler/glsl/ir_expression_operation.h":"cc9f10727dbd26cac506804f51456302c702650f9eeb59054a7e1575d5cf6687","glsl-optimizer/src/compiler/glsl/ir_expression_operation.py":"7b86c96021b9fbe165957f4ecb0b612fefcde1c2cf3c6d75e3cdb22e369216ba","glsl-optimizer/src/compiler/glsl/ir_expression_operation_constant.h":"9ad3346416392e3efa11e12ecf2feca7453c5253d241eb96c91dfb85d4f2b971","glsl-optimizer/src/compiler/glsl/ir_expression_operation_strings.h":"a6826daf496a8b9e89885bc2a161ac3445d501b23c6e0ac33e2c01b506b273c8","glsl-optimizer/src/compiler/glsl/ir_function.cpp":"7537365fc0fbe4b37a26b9a2146cc64d3e9a774d60eab63b65002ad165ae8fc7","glsl-optimizer/src/compiler/glsl/ir_function_can_inline.cpp":"faddbf112187a048d502716a3fb82570a322299ba2a3abd79388382c82040bfc","glsl-optimizer/src/compiler/glsl/ir_function_detect_recursion.cpp":"9176973eaf5c0a984701f953bb7a80f37dca43d59b5bce50fc69b3f02f2902d7","glsl-optimizer/src/compiler/glsl/ir_function_inlining.h":"9739493f99c489987d650762fccdd3fb3d432f6481d67f6c799176685bd59632","glsl-optimizer/src/compiler/glsl/ir_hierarchical_visitor.cpp":"3725861fbe2b98e0617f52d3b14cf6d3b25fb5ec00f5ef5d308b03642f592767","glsl-optimizer/src/compiler/glsl/ir_hierarchical_visitor.h":"e0560210e966c0c31e4ca843e80ea154e64db5a444b8c2df845b6ba5b3a43fc1","glsl-optimizer/src/compiler/glsl/ir_hv_accept.cpp":"caf7ce2cd9494aadd3c58bcf77f29de58368dc9e347a362bbf37f8bda9509b80","glsl-optimizer/src/compiler/glsl/ir_optimization.h":"8b3dcfc7f9e96b21a8dd47a0040d90be483a9e67a2cdce3a697188fb758d4630","glsl-optimizer/src/compiler/glsl/ir_print_glsl_visitor.cpp":"f8e34a983452be0dcb5a695e9c8e895eead24f9e540992a8afe510ae85da4c4c","glsl-optimizer/src/compiler/glsl/ir_print_glsl_visitor.h":"1ad1bd3efd1ace39051c13f904c05fd80425d329444f9a8d47fd6d948faf46e0","glsl-optimizer/src/compiler/glsl/ir_print_visitor.cpp":"643f5a68aae3fb37267fd793f1216d1cfdeb2c09338c26b1f30e4c6deaef4de5","glsl-optimizer/src/compiler/glsl/ir_print_visitor.h":"4573eb93268a2654c14b505253dd651e2695d43dc745904d824da18305269b95","glsl-optimizer/src/compiler/glsl/ir_reader.cpp":"06bfba802c8354e5a8b2334b6d78d6297de18235bedd3f8fbb382c89870b02f2","glsl-optimizer/src/compiler/glsl/ir_reader.h":"63e3f7f1597936a7011d5b520e171b197bf82bee6c1560d822c3edf5aaa6f9e9","glsl-optimizer/src/compiler/glsl/ir_rvalue_visitor.cpp":"84b5c5d746555adca85759c2912fe48010232b7c1c0bd2cf03bd04067a85e66f","glsl-optimizer/src/compiler/glsl/ir_rvalue_visitor.h":"fd8c561b71085d3211fff85ed514fecb299d8ce19a04bc063419a55b6d840525","glsl-optimizer/src/compiler/glsl/ir_set_program_inouts.cpp":"ab9f115ce9e7f312d9c7978340ced0dc4ae6d13a80e08442ba9709d11d50cae5","glsl-optimizer/src/compiler/glsl/ir_uniform.h":"683ae6896b1a08470c090be5f822fc31cd434eab9216e954b9bba24a46975109","glsl-optimizer/src/compiler/glsl/ir_unused_structs.cpp":"9c1620c45f2fc071fe5ed828472040b14c5f42effe06aa0e3b8352c95ef78786","glsl-optimizer/src/compiler/glsl/ir_unused_structs.h":"13387b49c23093575276b25b9dfd31fedd8f131c5c4f3128ab04cf03e15b5295","glsl-optimizer/src/compiler/glsl/ir_validate.cpp":"6b232be5999a86ea278f4f15b2832d76843246509118d924243055a3b9b0299f","glsl-optimizer/src/compiler/glsl/ir_variable_refcount.cpp":"2764a3cad937d53f36db7447c3a5b98b04bf153acf81074d971857fc5bca460d","glsl-optimizer/src/compiler/glsl/ir_variable_refcount.h":"b0668e3eb1501ef65e38fe12830742ecb3d28e6039f30e366c8924efc29b4a39","glsl-optimizer/src/compiler/glsl/ir_visitor.h":"f21b3534c3d66d5fb707d1581fece7e1eb043523afbaedf89918cfb031c6df94","glsl-optimizer/src/compiler/glsl/link_atomics.cpp":"360f0209e11f367ba358223597b0a118bae095bff16337cf03f1fb89c5b80ca6","glsl-optimizer/src/compiler/glsl/link_functions.cpp":"de7895da8aa33a1e3c2c1eb2fdaf267ab5d1fbfdb79ae2e67f95211e946e294c","glsl-optimizer/src/compiler/glsl/link_interface_blocks.cpp":"1926cfa73810704eb19b916c1b2cdb9321155e2f98b2a0a57c7c3c6e960540cd","glsl-optimizer/src/compiler/glsl/link_uniform_block_active_visitor.cpp":"1e14e06ca3b2c1089cfba2e8eaf0c1f373d9d6374b6082f320962dd71ae09611","glsl-optimizer/src/compiler/glsl/link_uniform_block_active_visitor.h":"fd58c155af645295bb6aec08797889de586f4d919731de2bce57e8dce59bb048","glsl-optimizer/src/compiler/glsl/link_uniform_blocks.cpp":"09589f49776dce32e6c4044937de7e0c839a9754ad31960148f8f9e010658997","glsl-optimizer/src/compiler/glsl/link_uniform_initializers.cpp":"bf98e08c12db466acf9623cbeb8fa8e3b4002512722e7a6521287f558a099f37","glsl-optimizer/src/compiler/glsl/link_uniforms.cpp":"84bad5b1377362cecf259b05124239be5220b03ce1c0c61b59bd9a47e4379af2","glsl-optimizer/src/compiler/glsl/link_varyings.cpp":"a5f1a53e7c80d635515fe808ff223d89fef1767abb0f2b7aa28fa6773dca353f","glsl-optimizer/src/compiler/glsl/link_varyings.h":"b9dbe018f038df69763df2e928742ce81bbc6e3aaba26f50621e30a6d9aa6220","glsl-optimizer/src/compiler/glsl/linker.cpp":"40b1ecd5d4f6c7f13d5a87ce390561a51fdf6f3fcd9b2197b9c88b03a773ba94","glsl-optimizer/src/compiler/glsl/linker.h":"ecf94b4ad75ef461c27c557fda4bd25f34c91930822b8e1d729ec84520d4a049","glsl-optimizer/src/compiler/glsl/linker_util.cpp":"1663ad88e2a369305659aeeffaedb5bd752cf76340a2ba5797fc0bf600633cf9","glsl-optimizer/src/compiler/glsl/linker_util.h":"6db788daf9c8e87ae2764b61a8b37ebe419e69c1b82ddee01986e37c978c6993","glsl-optimizer/src/compiler/glsl/list.h":"b1f46ce0e552fe7c45b2a19408a9d97662e23e4b182ab335491c26f8cf25886f","glsl-optimizer/src/compiler/glsl/loop_analysis.cpp":"57ecd573477c68091c7cc99537faa7139a8f395935e3d4f10144cefdefb5a611","glsl-optimizer/src/compiler/glsl/loop_analysis.h":"a85f045a038ee5b5176063e85d7988865862c44ab0580f771b993a042d0b69cc","glsl-optimizer/src/compiler/glsl/loop_unroll.cpp":"bd4292ea2809f5a669bcb76ceaa1ac365772dcd638c579c3ed10275214901a54","glsl-optimizer/src/compiler/glsl/lower_blend_equation_advanced.cpp":"8cfbef140d9c4b4d2f57bfa05c9c374d31a121d0f87afce94333f049023b654a","glsl-optimizer/src/compiler/glsl/lower_buffer_access.cpp":"1ae221c3c7a95aeb867207e7a742be635f91b406c157747bfd6ddf10274d97fb","glsl-optimizer/src/compiler/glsl/lower_buffer_access.h":"807886953a576a323591798cbca5e2df24295ea893b28affd8ffb5926cebaa04","glsl-optimizer/src/compiler/glsl/lower_builtins.cpp":"4d81afc32cf58e1481fcb5e42888ab93dbe6820310a20ff7a9982b77b2152d9b","glsl-optimizer/src/compiler/glsl/lower_const_arrays_to_uniforms.cpp":"608403f0eeeedf21cfcd3014116e0f44e28cbdf6c4c32aac7e613e64e30205e1","glsl-optimizer/src/compiler/glsl/lower_cs_derived.cpp":"179905cd47a294122adeb5b0abfed6f2f67782dcde21b544d1ee2c1985154e66","glsl-optimizer/src/compiler/glsl/lower_discard.cpp":"3b361b2db0004d544d64611cb50d5a6e364cf6c5f2e60c449085d7d753dd7fb0","glsl-optimizer/src/compiler/glsl/lower_discard_flow.cpp":"f5c29b6a27690bb5c91f196d1a1cf9f6be4f1025292311fe2dac561ce6774dee","glsl-optimizer/src/compiler/glsl/lower_distance.cpp":"a118c85493d5d22b2c059a930c51a5854896d4b1dade76598eaa985e5a3dff8c","glsl-optimizer/src/compiler/glsl/lower_if_to_cond_assign.cpp":"469e617757fd1728709cce021aac5c8da05ee503bf5366977bdc4ef7a6d83950","glsl-optimizer/src/compiler/glsl/lower_instructions.cpp":"6ff5c396abe40d8a2145d571e99e2bbe9143393e15aafc28adc2803a01d821b6","glsl-optimizer/src/compiler/glsl/lower_int64.cpp":"d1ed41196880dd53c7b13e2782f9423f8442bf1d46186e8be92b1b66218a83ee","glsl-optimizer/src/compiler/glsl/lower_jumps.cpp":"34de7b493f281589fb0c2c0f6e885d0a0fabbe7a4e97a73de374dd714777a58c","glsl-optimizer/src/compiler/glsl/lower_mat_op_to_vec.cpp":"dff7a308edc4846c348ed4225c6699a9c75abac68d88f41f85954276552779f4","glsl-optimizer/src/compiler/glsl/lower_named_interface_blocks.cpp":"16063ac127bff75a68272070ab11c21c25101edbff62b4c68f4983b4cd941af0","glsl-optimizer/src/compiler/glsl/lower_offset_array.cpp":"3b00773399135aea85746a5a68b96ef000bc6841be1a2c8e6f25c516628b0949","glsl-optimizer/src/compiler/glsl/lower_output_reads.cpp":"a0fc9975d5aa1617e21fc6c353659a9802da9e83779a3eef4ec584f74b4dadc5","glsl-optimizer/src/compiler/glsl/lower_packed_varyings.cpp":"7550099d4ae123d71541c2fc88bc04fbfe9271ec75d7e210987d1c8cac3cf3ea","glsl-optimizer/src/compiler/glsl/lower_packing_builtins.cpp":"79a13d161fe505a410ab948d92769395708693ec888153630fa240e5b97e356f","glsl-optimizer/src/compiler/glsl/lower_precision.cpp":"f82a185b879872b977a1787d8061b9a80bc4cf8db1b970db6efba2ad9cc20fa2","glsl-optimizer/src/compiler/glsl/lower_shared_reference.cpp":"ea2dccf50a83bc19391bf6b7ab6aa53c0005f427af4066d25140340af9a4beef","glsl-optimizer/src/compiler/glsl/lower_subroutine.cpp":"f69fa53650eeb6f2944fce4d36a6e0a423e6705f3a3bd3389c7fadb83cfc8802","glsl-optimizer/src/compiler/glsl/lower_tess_level.cpp":"b196c9d424c0569f3e85d75c2d125af21566cb113d69036db87c0990703e0fa7","glsl-optimizer/src/compiler/glsl/lower_texture_projection.cpp":"4d247f244272adc8250fd888d8d932a140dd5de4d1efc7a58492c3c2b8291527","glsl-optimizer/src/compiler/glsl/lower_ubo_reference.cpp":"89bdbc6c1669230c644c0857db1ce2781ec61d349ecd08c7914146e1f4750a4a","glsl-optimizer/src/compiler/glsl/lower_variable_index_to_cond_assign.cpp":"fce930f29ac9405b297d1f749d68f59506b89c70b4ee1b1ab8cf49a34cc71ecf","glsl-optimizer/src/compiler/glsl/lower_vec_index_to_cond_assign.cpp":"3c67d851a11a55fad1c49a550f3a0cfe50892d33a3f238ce266cd829eba510a8","glsl-optimizer/src/compiler/glsl/lower_vec_index_to_swizzle.cpp":"f5ec666b73e1415cbab32519a53605ed385f3b03e889560373dbce69dda5000e","glsl-optimizer/src/compiler/glsl/lower_vector.cpp":"f7c13f5572ebe09b6a71553133b2cf003cd4b77b9657600672ee3b21bf890725","glsl-optimizer/src/compiler/glsl/lower_vector_derefs.cpp":"b05793da6dd620a531b43df5af8b2ecbc37b9db0c88910f5724ea10bcd057e19","glsl-optimizer/src/compiler/glsl/lower_vector_insert.cpp":"fee772ec17eea5e86a529bf9c5fa2ee0d29a5982bb75ebc6d68ed36cd19aa299","glsl-optimizer/src/compiler/glsl/lower_vertex_id.cpp":"690e8715182e03fead5cc5a35251fb4f41b357e4c71a1dfbc4bd7be19862b56d","glsl-optimizer/src/compiler/glsl/lower_xfb_varying.cpp":"58c0e8b270e4bbde54250be03cdb2f36966bcafb785372ad2e2b786835df7f9f","glsl-optimizer/src/compiler/glsl/main.cpp":"ae5e88abbbc8a12f769e1296bad938b9d7398cc6da0d3d0caeceeeb876536850","glsl-optimizer/src/compiler/glsl/opt_add_neg_to_sub.h":"f5054944bfd068810629080d0ea11df78b3f57a8f86df75e13ca50157ad1964d","glsl-optimizer/src/compiler/glsl/opt_algebraic.cpp":"25f45b20e1972ee8c789177a1aeda6e4286c25db2eae3a43ff83029ae64969c0","glsl-optimizer/src/compiler/glsl/opt_array_splitting.cpp":"19d3ce0e815438f4df9ab2890e767b03a4f3f191b53bb30c0217cf2ae6a95430","glsl-optimizer/src/compiler/glsl/opt_conditional_discard.cpp":"0e44e0e126711a3725c1f3a2aa65ff03c381fed08680ffc30101aae60f716c4e","glsl-optimizer/src/compiler/glsl/opt_constant_folding.cpp":"a088d04d9b45f9e55e235835648f614c89b7803c03a6d4f6a6d1a6bc1f0228bd","glsl-optimizer/src/compiler/glsl/opt_constant_propagation.cpp":"8a9440d77ecd6dcf13e683cbb99943aab6311c8fd4b5f6a9189a8d4f270746f4","glsl-optimizer/src/compiler/glsl/opt_constant_variable.cpp":"63d3ccd4dd09f19c9cf1a2f51592111bed41284504f29f3c0de4cadebc439a37","glsl-optimizer/src/compiler/glsl/opt_copy_propagation_elements.cpp":"ffa0f50863995e0d2e31f55a52e82319edc71e520987bebd7f7e561ea331c64b","glsl-optimizer/src/compiler/glsl/opt_dead_builtin_variables.cpp":"84e8747b948232f01dd56b428b9315f96f9511f605f240119fc446fae28981a9","glsl-optimizer/src/compiler/glsl/opt_dead_builtin_varyings.cpp":"761523e88f5b3ba785170f4d7205e94fa99acb7e74d29efbe40e1c010e1dbdb3","glsl-optimizer/src/compiler/glsl/opt_dead_code.cpp":"fd1ba2da7337d4e5dad17f5c2d73d9cc8880305f423e85d64cf94553588fa401","glsl-optimizer/src/compiler/glsl/opt_dead_code_local.cpp":"969a598b4df322baf222258a66cd64a326ea20e5b3125be9d8d1771f522c69e0","glsl-optimizer/src/compiler/glsl/opt_dead_functions.cpp":"774cae6536d02edf26e996a2a895e1f62d5098f16dc96b44798b4fc731a9a95f","glsl-optimizer/src/compiler/glsl/opt_flatten_nested_if_blocks.cpp":"3696a5c55f02e20056e085bc2714f73ac992f221b6f3387d655068e86b512046","glsl-optimizer/src/compiler/glsl/opt_flip_matrices.cpp":"44f0fe05b49329667671f88c96dc86ab3fe1459ff7b87f2b2d88de2d49829f9f","glsl-optimizer/src/compiler/glsl/opt_function_inlining.cpp":"fb56a33c90419a01676b57cbd91d0674a54cca40e6defaacc88dd33facebc131","glsl-optimizer/src/compiler/glsl/opt_if_simplification.cpp":"ac406eb35e379c357641d6c5749f50c65961455924d3dc884e2b90046fa92c5c","glsl-optimizer/src/compiler/glsl/opt_minmax.cpp":"8abd59d3b14ef60ff14a9c69660e6945f5cf10b97edb4afebe56be3f81d96316","glsl-optimizer/src/compiler/glsl/opt_rebalance_tree.cpp":"8bb6329dc0f299042368fc81934c2df019b45ab9f7aa0415d4e57b8d1ff98c9f","glsl-optimizer/src/compiler/glsl/opt_redundant_jumps.cpp":"222c73e2ac7a938ebb6428cc6c780c908ff6156d8ff935b04fed93a48fc10496","glsl-optimizer/src/compiler/glsl/opt_structure_splitting.cpp":"2edc79cc13f3177934e0443ad62f5976a1991f01f86ea303a803434849b13a47","glsl-optimizer/src/compiler/glsl/opt_swizzle.cpp":"015d0abddfe507f67c4b96c82988d861d018ededf7bf055e2bcbe9ea92da694e","glsl-optimizer/src/compiler/glsl/opt_tree_grafting.cpp":"46d28ac983ea244a4315bdc0e8892979ec4d1f9b9a96ac8a8a08006d9bc5e878","glsl-optimizer/src/compiler/glsl/opt_vectorize.cpp":"d80ee43bb97d9f016fb9c5e1e06f5b2afa569811f368ba067be794ec11d085fb","glsl-optimizer/src/compiler/glsl/program.h":"2982447e2abd35371e273ad87951722782a8b21c08294f67c39d987da1e1c55f","glsl-optimizer/src/compiler/glsl/propagate_invariance.cpp":"080943e21baa32494723a2eefb185915d2daae1f46d6df420145c5ad6857e119","glsl-optimizer/src/compiler/glsl/s_expression.cpp":"1ced972bc6ecc8eab4116ea71fb0212ab9ae5bcc0be3b47aa5d9d903566b3af1","glsl-optimizer/src/compiler/glsl/s_expression.h":"65b847e30e22a809b57d0bc70243049c99d9c6318803c5b8d0826aba55dc217e","glsl-optimizer/src/compiler/glsl/serialize.cpp":"be0eb4251348a9d921acb839a5c48c6023a2e9d116d602bb0432787ab623655d","glsl-optimizer/src/compiler/glsl/serialize.h":"57425732eba1233d928e5f07f88b623ce65af46b3bb034bf147f0a4b7f94f9a1","glsl-optimizer/src/compiler/glsl/shader_cache.cpp":"e0c5c433f2df3fccdf1d61281bfcb0ee5633433339b97c697d64db99611cbaaf","glsl-optimizer/src/compiler/glsl/shader_cache.h":"9217164d8d7f54aca0fe5922c7187095a6ae0cb703b196b79805aeef07a7e697","glsl-optimizer/src/compiler/glsl/standalone.cpp":"8e6c416a14d631261917a5fe4cc91880c287b22b2dfd70eb22028289a8fa5364","glsl-optimizer/src/compiler/glsl/standalone.h":"a7c397d1dfdd1e7fb2cfe99db35cd9df93251e642059208533202b7f20497f83","glsl-optimizer/src/compiler/glsl/standalone_scaffolding.cpp":"970d14b7a9d58e5270321f97bf5d57795558b1c570a56678e04a65b26c60bf4f","glsl-optimizer/src/compiler/glsl/standalone_scaffolding.h":"d921a617ea82b9e49413314492a645c44356de503581b1be3f1b57de236e480d","glsl-optimizer/src/compiler/glsl/string_to_uint_map.cpp":"d824bf5b839bd39498dc9e457103cdbe3e5289ddf7564107c27b1505948dd31f","glsl-optimizer/src/compiler/glsl/string_to_uint_map.h":"e2f18e66359c9d620e085de7f4a334a47df9c66e65a5bfe8b734c627bec04104","glsl-optimizer/src/compiler/glsl/test_optpass.h":"b27b8f35f5387e7ce4982bb51c7b63ccf14f91757f3108a5d02ed006925bb8a0","glsl-optimizer/src/compiler/glsl/xxd.py":"376484142f27f45090ea8203ae2621abf73f06175cb0ee8d96f44a3b9327f4bd","glsl-optimizer/src/compiler/glsl_types.cpp":"044bb6754f45419a3151e7a25c39202a82009ae3c6bc54ff7f0bb4258a5deefe","glsl-optimizer/src/compiler/glsl_types.h":"fd899a42f34ddeb8601bc3cd6c5e3aed82fc8aef4042dde1b39b3c01e1dcc219","glsl-optimizer/src/compiler/shader_enums.c":"436bff5216b11b0980bdfada5885fc6ac9afa2037a3027fcd6eea2a8635597ac","glsl-optimizer/src/compiler/shader_enums.h":"13220442a5c02e83540cf2c0ad4f8417b2fbda5f2586dec4e92082544c937cdd","glsl-optimizer/src/compiler/shader_info.h":"4c5453e81197ca83593ee4f365074b23530f2ab21c78e1733b63dec6f344c12a","glsl-optimizer/src/gallium/auxiliary/util/u_half.h":"3c2b37bda3ccb64387e44b723d29cf9046decab1a893bf42d842e9603398bdee","glsl-optimizer/src/gallium/include/pipe/p_compiler.h":"c75620096ce8523dae90599e50aa2ef6468d3b0e368a77795edeb20dd1abfc0c","glsl-optimizer/src/gallium/include/pipe/p_config.h":"a27692fc35f9e55df3224b7529e66b3001e911e94e6bc5f8f569e493e1ee3fb7","glsl-optimizer/src/gallium/include/pipe/p_defines.h":"be26d68c0acc67c5e44788c6299716a9eee415fd81d7d747e3738a829e3b6b38","glsl-optimizer/src/gallium/include/pipe/p_format.h":"5674215fc41d27496f037cf837717daefbf23ebb38d40ace7c0c414bc08182b0","glsl-optimizer/src/gallium/include/pipe/p_state.h":"d600593aba5f5a17072a6c38f6baa81e01c7994b0174250f7e433bb41684b702","glsl-optimizer/src/mapi/glapi/glapi.h":"73632a625c0ddabc401205e8b5a81eb8af8506868efe4b170d7979ec3619e9c5","glsl-optimizer/src/mesa/main/config.h":"5800259373099e5405de2eb52619f9de242552a479902a3a642a333c8cb3c1e7","glsl-optimizer/src/mesa/main/context.c":"2f3208473d99c94f734b1137ba91889d4a1babb9e7534bf1dc85d851ee98274e","glsl-optimizer/src/mesa/main/context.h":"cc7e4194797db9d007f01884e23d786c453b3860821f7f2ddcdf0f1bf3f8ffb1","glsl-optimizer/src/mesa/main/dd.h":"6a964acd06b6c2d88700e69fb75fe3c6b3b3d45bbc41db24f3f897a29695fe0c","glsl-optimizer/src/mesa/main/debug_output.h":"7312422e90b8c0e34028ac27280e438139b5cba525c99deb3ac883cd3d87e452","glsl-optimizer/src/mesa/main/draw.h":"7eaef3a9e27a60ea6f7937109bf3a6190b831162fde0479abb12077ce27c353d","glsl-optimizer/src/mesa/main/enums.h":"87d562a6764f51c014a2274fa7c3aca17c04441537ddd56b2554f13c6fffea92","glsl-optimizer/src/mesa/main/errors.h":"c79444b5df289c90fbb22a33b2d0c23917d9fc4510960088f0b79e53bb56b1b2","glsl-optimizer/src/mesa/main/extensions.h":"a38b2f87cc93c513994281350d69e06c84ff8eded5313ec0a1be33f375e0ebbd","glsl-optimizer/src/mesa/main/extensions_table.c":"17642d1a8c9a0bf2bd61060052d33ff14a005d2b962e6cf91465797a50851e85","glsl-optimizer/src/mesa/main/extensions_table.h":"2c879571c238d2e14461031ac740372fd0f9ac3a34c0d5541bb9b7ed4c0376c8","glsl-optimizer/src/mesa/main/formats.h":"02e2f7ec3e39286cf9f27e2641043e6df8ecb1dfde9e643313210e214af2a929","glsl-optimizer/src/mesa/main/glheader.h":"58217b33eead6aa6b23cd4a291cefeaa6cb84e465f4960daffca97c44d6d1c35","glsl-optimizer/src/mesa/main/glthread.h":"51fb2711f77e7eafcfc52d29d5b844978832b24c930d88accd48d143a6eb9c6f","glsl-optimizer/src/mesa/main/hash.h":"7e7f782034c16a8e693de48e00c31d4a90b0129f4029fd074033d7d16ccbe718","glsl-optimizer/src/mesa/main/macros.h":"73d15ddfd64f2b57b9b2ffeeb993b9c2c0899a80563e9d6ff337b11ccbe6eee5","glsl-optimizer/src/mesa/main/menums.h":"5dfac0e2279d60b0cd0c7b9fc2a5021620d0f6282ed2e738c420214e3af152d3","glsl-optimizer/src/mesa/main/mesa_private.h":"edda678b93438944279a551f663b8858ad84814a9fc88ba9672ef195599c24ae","glsl-optimizer/src/mesa/main/mtypes.h":"6efddefa099e4d2e3fdd97f0055644f47aba21711385edfeabc2d9b0676f2eec","glsl-optimizer/src/mesa/main/shaderobj.h":"9f0dfe96d0c2154201adef942bd36053533ac7b2492fb3786acda5bea514c75e","glsl-optimizer/src/mesa/main/uniforms.h":"4e331e6ad6e9cbded978b4082dbe0a57c1f8f01327446bb6892bfc179976c38b","glsl-optimizer/src/mesa/main/version.h":"9d0a13a758099302dc55cf7d045791834a89b0f9d4cf17b2692259b369a8a9a1","glsl-optimizer/src/mesa/math/m_matrix.h":"a37b19f182e070db3df93b0ede43c22fb8be8c2906504133ee6dbd7db1185d8b","glsl-optimizer/src/mesa/program/dummy_errors.c":"1820e305515b4c5e041f5e1623266a48ec8f076a155310be7d60637101f593e4","glsl-optimizer/src/mesa/program/ir_to_mesa.h":"b47f58d22e3ca2ae42d52501ea769d15c4476834944fa97eeccd3a3439211d00","glsl-optimizer/src/mesa/program/prog_instruction.h":"ab3832152a7e144b59e5a2264b2c29db56d93be31e76bbd958527a56771b40eb","glsl-optimizer/src/mesa/program/prog_parameter.h":"ba18c743284eadbc837c2c364c73e5d372321a7637a76e589d8d39fe8b5de225","glsl-optimizer/src/mesa/program/prog_statevars.h":"fc413698f84bc52d45fdeae0471934ee9904bfb7eac1a2b5f70446e54bcbbdca","glsl-optimizer/src/mesa/program/program.h":"1f01026a4eff440a3f122fd9b519d03546fe7f7d8be60dca834e95a2f8fbbfd2","glsl-optimizer/src/mesa/program/symbol_table.c":"6611cb9f078035bf5ff8c9112093a6c7d99f8af99a3931d0c07f227cc72283ea","glsl-optimizer/src/mesa/program/symbol_table.h":"631dc35ac48d5e87962d45507461920f6575610960ffcc42a08cefeb43300cda","glsl-optimizer/src/mesa/vbo/vbo.h":"6eb1dcd9a08c92f276c5fe08da184ff9d455d1be421913b8ad732a7b65e858fb","glsl-optimizer/src/util/bitscan.h":"9e49e694e6b34fe035bc685f32588827eb8cbe7d82878963c7ab52843e1c16aa","glsl-optimizer/src/util/bitset.h":"c40f78515c6230fed18345c6751ce33833a49da7a27901c7e6d7340cbdcbc5e7","glsl-optimizer/src/util/blob.c":"8f729846f66efc9c15485cc5fc24c6ec861fc1fecb2f652573f2a237d481b791","glsl-optimizer/src/util/blob.h":"93e1eaac866b9a7cd6fc03b533c18fb2edf0e97f03395eff4f3a605c4fc14d0c","glsl-optimizer/src/util/compiler.h":"79e3bf40a5bab704e6c949f23a1352759607bb57d80e5d8df2ef159755f10b68","glsl-optimizer/src/util/crc32.c":"2f3467a046b3a76784ecb9aa55d527698c8607fd0b12c622f6691aaa77b58505","glsl-optimizer/src/util/crc32.h":"59bd81865e51042b73a86f8fb117c312418df095fed2d828c5c1d1c8b6fc6cd4","glsl-optimizer/src/util/debug.c":"c3d68e9752ccc19e66c669562cd113cf1d0ac83cbb30174789e7fb8d1df58f9c","glsl-optimizer/src/util/debug.h":"50068d745c4199ccbd33d68dd4c8a36d2b5179c7869a21e75906ddd0718ca456","glsl-optimizer/src/util/detect_os.h":"343a8790d17a3710c6dd015ee367f84e3902ff3f2e36faca2bf93f9d725d3574","glsl-optimizer/src/util/disk_cache.c":"f533937e5a4fffe76e2739ef4b6b1e1da097d96d63eb808e68ebbc7027641c23","glsl-optimizer/src/util/disk_cache.h":"e83314fb14134a8e079b15e470a6376ba5a8253701f048c890a62b7e55d64bc8","glsl-optimizer/src/util/fast_urem_by_const.h":"e108fce804616c47d071dfe4a04163eec1126e448ed1aa89abb6b3a6d772bd5b","glsl-optimizer/src/util/fnv1a.h":"ab2596f19c6adf431ae27618f62c5743e24ad23ef83bb359a4c4c218245ab459","glsl-optimizer/src/util/format/u_format.h":"4cdfc0c59cbc99a092e5ec5a396910f2d93b9643e5d8141050b011e66f11e45b","glsl-optimizer/src/util/futex.h":"26f7c9d86e9ffef4c0fa2761f1aaa1918337302e20bd6ca10e61dc3c47356deb","glsl-optimizer/src/util/half_float.c":"11bc2584493d5d9d46e8c8a619a0307cf150bf5ab5d0f96bb764b061dc37a00e","glsl-optimizer/src/util/half_float.h":"7f7c380f126da1400a91758cc0392f24bf967bce1672890b62be26fe9fbd922b","glsl-optimizer/src/util/hash_table.c":"0ca40352e35dedab0a84c64c903f1b16d47e950bb5f43b4d22bb57d499bfea6e","glsl-optimizer/src/util/hash_table.h":"217191bb360592e2232f187473c10287d2cda8ae6fa5c53d0ef74c8c206118b4","glsl-optimizer/src/util/list.h":"9fab03c6a78186bb5f173269f825f6ce976b409d931852e3d93bac632e07989a","glsl-optimizer/src/util/macros.h":"63faf65b51058c483b17f1f77da51d1c53c8beab52678cb6bd01f1228a63b6b0","glsl-optimizer/src/util/mesa-sha1.c":"00c692ec353ebc02c06c57c5a71de0ab7a119f86a4146f452e65ec87e4944417","glsl-optimizer/src/util/mesa-sha1.h":"bff4c29f4bf7cdbcefb30fa0c996a7604a380eba8976467c2a60e7cd328f7e26","glsl-optimizer/src/util/mesa-sha1_test.c":"25da89a59d51469f77b4c468ca23ffdce0a7a1166a70b6cc23026a6800b0143c","glsl-optimizer/src/util/os_memory.h":"64555faf1760ae6954f42c83727c38dfc4c278e9152115779ffaad58b42adacf","glsl-optimizer/src/util/os_memory_aligned.h":"12d86fa94be38c13f7eeebdf313795e1267dd5a7187d2f0072e0e896f41702f6","glsl-optimizer/src/util/os_memory_stdc.h":"07360363b88c927065e10df71bebf6c8a0cc3b9167c9dfce55f2d65f11e6f787","glsl-optimizer/src/util/os_misc.c":"a9936e613ec84803abd59ad47c192c8e3939993c950ac91973fdc4cec1801bb8","glsl-optimizer/src/util/os_misc.h":"cc68eb12e05b5e749c54298cb4a6f4cd20cc5af7db3403e70b3c27b56090c740","glsl-optimizer/src/util/os_time.h":"73e775f7335244ff5964c678c27eedf1aea6abea44c4169d327ea8c7ce4a3a88","glsl-optimizer/src/util/ralloc.c":"4b51189595ef67bcef52c40cbf654d969041dbd15e15d4a893ad494ac060aeca","glsl-optimizer/src/util/ralloc.h":"e573c45875ff1530f0dbee9a93ae55535fdac8d5cc88a79ebc327c688824bde5","glsl-optimizer/src/util/rounding.h":"0450722353caf83de07e67f335949dbe95fe53b534052d4ee9d28d2781387614","glsl-optimizer/src/util/set.c":"86f8c9a830bead5a5a79bc970b0ff97809312af07b3beb39ef9d90af04d40a1b","glsl-optimizer/src/util/set.h":"3e39ca161e7ed4ec7c436cc9c7919ed9a55ed1b71edbf2caf6f9bcfd9bc578ed","glsl-optimizer/src/util/sha1/README":"00af7419af05247081858acb2902efd99fcda2ce16e331079f701645bb3729c0","glsl-optimizer/src/util/sha1/sha1.c":"1403bbe0aad42ba3e6be7e09f7cad87a6a8c4ad5b63962f7b92b9f37d8133b04","glsl-optimizer/src/util/sha1/sha1.h":"68d9f240eab2918026ecdf22be36811abbd4f1389f6c36e31258041aeaedd247","glsl-optimizer/src/util/simple_mtx.h":"12c6c3c4b7db9168bc656d5b3c65912075084d2b388c415d5c3d3f5953a9d6c7","glsl-optimizer/src/util/softfloat.c":"a97e51a96fe5e6a052c02aa6bbec683fe73fb88a8c087d9c930503e2120d8a2e","glsl-optimizer/src/util/softfloat.h":"66664b0250e83bf5dd4cc743acd119d076efcea624a0eab3d6b60718e6ee8811","glsl-optimizer/src/util/string_buffer.c":"63a1d1b1e34926c88ea00159cafbcd56568b805c4f64d1e8c97169fe313921fc","glsl-optimizer/src/util/string_buffer.h":"7b88d1b1d9c6cfb8e93331813535c127289437c75f822029e9a3bca8ea6b52ee","glsl-optimizer/src/util/strndup.h":"0273c4fdb7482cd7746881a63d3998648c6d63415ba85af1d1860f0e0dc504c6","glsl-optimizer/src/util/strtod.c":"5cf610d8a37373cf37cfb7aae903525d943b2674b1f32594c70b0eb19a8c9697","glsl-optimizer/src/util/strtod.h":"237396def4e264d35ed4bedea00ef9a4ceab6d7a11a18c770d9747d22c69ed2d","glsl-optimizer/src/util/u_atomic.h":"c02e809526c6c09ba8fe51f50b2490d1b6c8e5c7f3c4031ae958250d098fc3bb","glsl-optimizer/src/util/u_debug.c":"8c060e379b816618f3dd22c9ea523c68b9425c76c36a7dfe5d6d375b337f5f4a","glsl-optimizer/src/util/u_debug.h":"e11e26edd9b9e4e6f8e6a435e69f4d9edda27e9a379f68f4c82ea2525aaaea68","glsl-optimizer/src/util/u_dynarray.h":"853d0fa6ff2261614488be624deb8a2b01e57c2c8eabc28578cbeed4ccc95694","glsl-optimizer/src/util/u_endian.h":"3ccea7e529740318d8a4b05c00db3adc9d1e292a52bdc56a05c9fae99209720f","glsl-optimizer/src/util/u_math.c":"c868a8c0886dc78f1b06b13404ba8b253090449045774dd56893ac9d75795184","glsl-optimizer/src/util/u_math.h":"a04e32e126db016413f9de0a2028a3e71737137463b1289eae576f884b06fcf1","glsl-optimizer/src/util/u_memory.h":"c5db17c724c70283ddbe04165722f6988d4e0eb9aa3602ae472feff016649af9","glsl-optimizer/src/util/u_queue.h":"92930ce236c0528a98b695f5cea8c5c6aa9683beaf71a2227bdc5d33d1b21506","glsl-optimizer/src/util/u_string.h":"c5a2f4ef576d1547bda12c4ea219179fefa54414977743ac094abcaf696ef6ca","glsl-optimizer/src/util/u_thread.h":"00b708459b27f9910d18db92c18cc65cfc618ac2b3cd144e45f8640057b10d58","glsl-optimizer/src/util/xxhash.h":"2f2aff2fc6c0c929f52cf6ae7314122124c5be026d41ad1c357608383c4a37ad","src/bindings.rs":"79993db2058bde39f99ef483d02560d33b1cb882f6a552319e8b86eb6f9021e1","src/lib.rs":"04be1554cd829eb40864b06d80b491dd48117a4e3a601c7d482117f7a0391e67","wrapper.hpp":"f3ea34cc496f7d90b9bfcada3250b37b314c3524dac693b2ece9517bc7d274ac"},"package":"8ba4741358604ca0848c27ecc069d68e62e11cde81e38aac1da3c54b79ab5adf"} +\ No newline at end of file diff --git a/build-cacheFlush-missing.patch b/build-cacheFlush-missing.patch deleted file mode 100644 index 51c368c..0000000 --- a/build-cacheFlush-missing.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -up firefox-55.0.3/js/src/jit/ExecutableAllocator.h.wasm firefox-55.0.3/js/src/jit/ExecutableAllocator.h ---- firefox-55.0.3/js/src/jit/ExecutableAllocator.h.wasm 2017-09-05 11:32:12.235909468 +0200 -+++ firefox-55.0.3/js/src/jit/ExecutableAllocator.h 2017-09-05 11:32:46.157916575 +0200 -@@ -219,7 +219,7 @@ class ExecutableAllocator - - static void poisonCode(JSRuntime* rt, JitPoisonRangeVector& ranges); - --#if defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64) || defined(JS_SIMULATOR_ARM64) -+#if defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64) || defined(JS_SIMULATOR_ARM64) || defined(JS_CODEGEN_NONE) - static void cacheFlush(void*, size_t) - { - } -diff -up firefox-55.0.3/js/src/jit-test/tests/wasm/bench/wasm_box2d.wasm firefox-55.0.3/js/src/jit-test/tests/wasm/bench/wasm_box2d diff --git a/build-cubeb-pulse-arm.patch b/build-cubeb-pulse-arm.patch deleted file mode 100644 index 008208c..0000000 --- a/build-cubeb-pulse-arm.patch +++ /dev/null @@ -1,4946 +0,0 @@ -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/Cargo.toml.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/Cargo.toml ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/Cargo.toml.cubeb-pulse-arm 2017-07-31 18:20:49.000000000 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/Cargo.toml 2017-08-04 13:37:46.383821740 +0200 -@@ -7,7 +7,11 @@ description = "Cubeb backed for PulseAud - [features] - pulse-dlopen = ["pulse-ffi/dlopen"] - -+[lib] -+crate-type = ["staticlib", "rlib"] -+ - [dependencies] - cubeb-ffi = { path = "cubeb-ffi" } - pulse-ffi = { path = "pulse-ffi" } -+pulse = { path = "pulse-rs" } - semver = "^0.6" -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/cubeb-ffi/src/ffi.rs.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/cubeb-ffi/src/ffi.rs ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/cubeb-ffi/src/ffi.rs.cubeb-pulse-arm 2017-07-31 18:20:49.000000000 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/cubeb-ffi/src/ffi.rs 2017-08-04 13:37:46.384821737 +0200 -@@ -11,45 +11,45 @@ pub enum Context {} - pub enum Stream {} - - // These need to match cubeb_sample_format --pub const SAMPLE_S16LE: c_int = 0; --pub const SAMPLE_S16BE: c_int = 1; --pub const SAMPLE_FLOAT32LE: c_int = 2; --pub const SAMPLE_FLOAT32BE: c_int = 3; - pub type SampleFormat = c_int; -+pub const SAMPLE_S16LE: SampleFormat = 0; -+pub const SAMPLE_S16BE: SampleFormat = 1; -+pub const SAMPLE_FLOAT32LE: SampleFormat = 2; -+pub const SAMPLE_FLOAT32BE: SampleFormat = 3; - - #[cfg(target_endian = "little")] --pub const SAMPLE_S16NE: c_int = SAMPLE_S16LE; -+pub const SAMPLE_S16NE: SampleFormat = SAMPLE_S16LE; - #[cfg(target_endian = "little")] --pub const SAMPLE_FLOAT32NE: c_int = SAMPLE_FLOAT32LE; -+pub const SAMPLE_FLOAT32NE: SampleFormat = SAMPLE_FLOAT32LE; - #[cfg(target_endian = "big")] --pub const SAMPLE_S16NE: c_int = SAMPLE_S16BE; -+pub const SAMPLE_S16NE: SampleFormat = SAMPLE_S16BE; - #[cfg(target_endian = "big")] --pub const SAMPLE_FLOAT32NE: c_int = SAMPLE_FLOAT32BE; -+pub const SAMPLE_FLOAT32NE: SampleFormat = SAMPLE_FLOAT32BE; - - pub type DeviceId = *const c_void; - - // These need to match cubeb_channel_layout --pub const LAYOUT_UNDEFINED: c_int = 0; --pub const LAYOUT_DUAL_MONO: c_int = 1; --pub const LAYOUT_DUAL_MONO_LFE: c_int = 2; --pub const LAYOUT_MONO: c_int = 3; --pub const LAYOUT_MONO_LFE: c_int = 4; --pub const LAYOUT_STEREO: c_int = 5; --pub const LAYOUT_STEREO_LFE: c_int = 6; --pub const LAYOUT_3F: c_int = 7; --pub const LAYOUT_3F_LFE: c_int = 8; --pub const LAYOUT_2F1: c_int = 9; --pub const LAYOUT_2F1_LFE: c_int = 10; --pub const LAYOUT_3F1: c_int = 11; --pub const LAYOUT_3F1_LFE: c_int = 12; --pub const LAYOUT_2F2: c_int = 13; --pub const LAYOUT_2F2_LFE: c_int = 14; --pub const LAYOUT_3F2: c_int = 15; --pub const LAYOUT_3F2_LFE: c_int = 16; --pub const LAYOUT_3F3R_LFE: c_int = 17; --pub const LAYOUT_3F4_LFE: c_int = 18; --pub const LAYOUT_MAX: c_int = 19; - pub type ChannelLayout = c_int; -+pub const LAYOUT_UNDEFINED: ChannelLayout = 0; -+pub const LAYOUT_DUAL_MONO: ChannelLayout = 1; -+pub const LAYOUT_DUAL_MONO_LFE: ChannelLayout = 2; -+pub const LAYOUT_MONO: ChannelLayout = 3; -+pub const LAYOUT_MONO_LFE: ChannelLayout = 4; -+pub const LAYOUT_STEREO: ChannelLayout = 5; -+pub const LAYOUT_STEREO_LFE: ChannelLayout = 6; -+pub const LAYOUT_3F: ChannelLayout = 7; -+pub const LAYOUT_3F_LFE: ChannelLayout = 8; -+pub const LAYOUT_2F1: ChannelLayout = 9; -+pub const LAYOUT_2F1_LFE: ChannelLayout = 10; -+pub const LAYOUT_3F1: ChannelLayout = 11; -+pub const LAYOUT_3F1_LFE: ChannelLayout = 12; -+pub const LAYOUT_2F2: ChannelLayout = 13; -+pub const LAYOUT_2F2_LFE: ChannelLayout = 14; -+pub const LAYOUT_3F2: ChannelLayout = 15; -+pub const LAYOUT_3F2_LFE: ChannelLayout = 16; -+pub const LAYOUT_3F3R_LFE: ChannelLayout = 17; -+pub const LAYOUT_3F4_LFE: ChannelLayout = 18; -+pub const LAYOUT_MAX: ChannelLayout = 256; - - #[repr(C)] - #[derive(Clone, Copy, Debug)] -@@ -77,11 +77,11 @@ impl Default for Device { - } - - // These need to match cubeb_state --pub const STATE_STARTED: c_int = 0; --pub const STATE_STOPPED: c_int = 1; --pub const STATE_DRAINED: c_int = 2; --pub const STATE_ERROR: c_int = 3; - pub type State = c_int; -+pub const STATE_STARTED: State = 0; -+pub const STATE_STOPPED: State = 1; -+pub const STATE_DRAINED: State = 2; -+pub const STATE_ERROR: State = 3; - - pub const OK: i32 = 0; - pub const ERROR: i32 = -1; -@@ -249,32 +249,42 @@ pub struct LayoutMap { - } - - // cubeb_mixer.h -+pub type Channel = c_int; - - // These need to match cubeb_channel --pub const CHANNEL_INVALID: c_int = -1; --pub const CHANNEL_MONO: c_int = 0; --pub const CHANNEL_LEFT: c_int = 1; --pub const CHANNEL_RIGHT: c_int = 2; --pub const CHANNEL_CENTER: c_int = 3; --pub const CHANNEL_LS: c_int = 4; --pub const CHANNEL_RS: c_int = 5; --pub const CHANNEL_RLS: c_int = 6; --pub const CHANNEL_RCENTER: c_int = 7; --pub const CHANNEL_RRS: c_int = 8; --pub const CHANNEL_LFE: c_int = 9; --pub const CHANNEL_MAX: c_int = 256; --pub type Channel = c_int; -+pub const CHANNEL_INVALID: Channel = -1; -+pub const CHANNEL_MONO: Channel = 0; -+pub const CHANNEL_LEFT: Channel = 1; -+pub const CHANNEL_RIGHT: Channel = 2; -+pub const CHANNEL_CENTER: Channel = 3; -+pub const CHANNEL_LS: Channel = 4; -+pub const CHANNEL_RS: Channel = 5; -+pub const CHANNEL_RLS: Channel = 6; -+pub const CHANNEL_RCENTER: Channel = 7; -+pub const CHANNEL_RRS: Channel = 8; -+pub const CHANNEL_LFE: Channel = 9; -+pub const CHANNEL_MAX: Channel = 10; - - #[repr(C)] -+#[derive(Clone, Copy, Debug)] - pub struct ChannelMap { - pub channels: c_uint, -- pub map: [Channel; 256], -+ pub map: [Channel; CHANNEL_MAX as usize], - } - impl ::std::default::Default for ChannelMap { - fn default() -> Self { - ChannelMap { - channels: 0, -- map: unsafe { ::std::mem::zeroed() }, -+ map: [CHANNEL_INVALID, -+ CHANNEL_INVALID, -+ CHANNEL_INVALID, -+ CHANNEL_INVALID, -+ CHANNEL_INVALID, -+ CHANNEL_INVALID, -+ CHANNEL_INVALID, -+ CHANNEL_INVALID, -+ CHANNEL_INVALID, -+ CHANNEL_INVALID], - } - } - } -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-ffi/src/ffi_funcs.rs.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-ffi/src/ffi_funcs.rs ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-ffi/src/ffi_funcs.rs.cubeb-pulse-arm 2017-07-31 18:20:49.000000000 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-ffi/src/ffi_funcs.rs 2017-08-04 13:37:46.384821737 +0200 -@@ -8,8 +8,8 @@ macro_rules! cstr { - - #[cfg(not(feature = "dlopen"))] - mod static_fns { -- use std::os::raw::{c_char, c_double, c_int, c_float, c_uint, c_void}; - use super::*; -+ use std::os::raw::{c_char, c_double, c_float, c_int, c_uint, c_void}; - - #[link(name = "pulse")] - extern "C" { -@@ -62,6 +62,7 @@ mod static_fns { - userdata: *mut c_void) - -> *mut pa_operation; - pub fn pa_context_set_state_callback(c: *mut pa_context, cb: pa_context_notify_cb_t, userdata: *mut c_void); -+ pub fn pa_context_errno(c: *mut pa_context) -> c_int; - pub fn pa_context_set_subscribe_callback(c: *mut pa_context, - cb: pa_context_subscribe_cb_t, - userdata: *mut c_void); -@@ -70,6 +71,7 @@ mod static_fns { - cb: pa_context_success_cb_t, - userdata: *mut c_void) - -> *mut pa_operation; -+ pub fn pa_context_ref(c: *mut pa_context) -> *mut pa_context; - pub fn pa_context_unref(c: *mut pa_context); - pub fn pa_cvolume_set(a: *mut pa_cvolume, channels: c_uint, v: pa_volume_t) -> *mut pa_cvolume; - pub fn pa_cvolume_set_balance(v: *mut pa_cvolume, -@@ -80,12 +82,20 @@ mod static_fns { - pub fn pa_mainloop_api_once(m: *mut pa_mainloop_api, - callback: pa_mainloop_api_once_cb_t, - userdata: *mut c_void); -- pub fn pa_operation_get_state(o: *const pa_operation) -> pa_operation_state_t; -+ pub fn pa_strerror(error: pa_error_code_t) -> *const c_char; -+ pub fn pa_operation_ref(o: *mut pa_operation) -> *mut pa_operation; - pub fn pa_operation_unref(o: *mut pa_operation); -+ pub fn pa_operation_cancel(o: *mut pa_operation); -+ pub fn pa_operation_get_state(o: *const pa_operation) -> pa_operation_state_t; -+ pub fn pa_operation_set_state_callback(o: *mut pa_operation, -+ cb: pa_operation_notify_cb_t, -+ userdata: *mut c_void); - pub fn pa_proplist_gets(p: *mut pa_proplist, key: *const c_char) -> *const c_char; - pub fn pa_rtclock_now() -> pa_usec_t; - pub fn pa_stream_begin_write(p: *mut pa_stream, data: *mut *mut c_void, nbytes: *mut usize) -> c_int; - pub fn pa_stream_cancel_write(p: *mut pa_stream) -> c_int; -+ pub fn pa_stream_is_suspended(s: *const pa_stream) -> c_int; -+ pub fn pa_stream_is_corked(s: *const pa_stream) -> c_int; - pub fn pa_stream_connect_playback(s: *mut pa_stream, - dev: *const c_char, - attr: *const pa_buffer_attr, -@@ -112,6 +122,7 @@ mod static_fns { - pub fn pa_stream_get_latency(s: *const pa_stream, r_usec: *mut pa_usec_t, negative: *mut c_int) -> c_int; - pub fn pa_stream_get_sample_spec(s: *const pa_stream) -> *const pa_sample_spec; - pub fn pa_stream_get_state(p: *const pa_stream) -> pa_stream_state_t; -+ pub fn pa_stream_get_context(s: *const pa_stream) -> *mut pa_context; - pub fn pa_stream_get_time(s: *const pa_stream, r_usec: *mut pa_usec_t) -> c_int; - pub fn pa_stream_new(c: *mut pa_context, - name: *const c_char, -@@ -123,6 +134,7 @@ mod static_fns { - pub fn pa_stream_set_state_callback(s: *mut pa_stream, cb: pa_stream_notify_cb_t, userdata: *mut c_void); - pub fn pa_stream_set_write_callback(p: *mut pa_stream, cb: pa_stream_request_cb_t, userdata: *mut c_void); - pub fn pa_stream_set_read_callback(p: *mut pa_stream, cb: pa_stream_request_cb_t, userdata: *mut c_void); -+ pub fn pa_stream_ref(s: *mut pa_stream) -> *mut pa_stream; - pub fn pa_stream_unref(s: *mut pa_stream); - pub fn pa_stream_update_timing_info(p: *mut pa_stream, - cb: pa_stream_success_cb_t, -@@ -148,8 +160,6 @@ mod static_fns { - pub fn pa_threaded_mainloop_unlock(m: *mut pa_threaded_mainloop); - pub fn pa_threaded_mainloop_wait(m: *mut pa_threaded_mainloop); - pub fn pa_usec_to_bytes(t: pa_usec_t, spec: *const pa_sample_spec) -> usize; -- pub fn pa_xfree(ptr: *mut c_void); -- pub fn pa_xstrdup(str: *const c_char) -> *mut c_char; - pub fn pa_xrealloc(ptr: *mut c_void, size: usize) -> *mut c_void; - } - } -@@ -159,9 +169,9 @@ pub use self::static_fns::*; - - #[cfg(feature = "dlopen")] - mod dynamic_fns { -- use std::os::raw::{c_char, c_double, c_int, c_float, c_uint, c_void}; -- use libc::{dlclose, dlopen, dlsym, RTLD_LAZY}; - use super::*; -+ use libc::{RTLD_LAZY, dlclose, dlopen, dlsym}; -+ use std::os::raw::{c_char, c_double, c_float, c_int, c_uint, c_void}; - - #[derive(Debug)] - pub struct LibLoader { -@@ -287,6 +297,13 @@ mod dynamic_fns { - } - fp - }; -+ PA_CONTEXT_ERRNO = { -+ let fp = dlsym(h, cstr!("pa_context_errno")); -+ if fp.is_null() { -+ return None; -+ } -+ fp -+ }; - PA_CONTEXT_SET_SUBSCRIBE_CALLBACK = { - let fp = dlsym(h, cstr!("pa_context_set_subscribe_callback")); - if fp.is_null() { -@@ -301,6 +318,13 @@ mod dynamic_fns { - } - fp - }; -+ PA_CONTEXT_REF = { -+ let fp = dlsym(h, cstr!("pa_context_ref")); -+ if fp.is_null() { -+ return None; -+ } -+ fp -+ }; - PA_CONTEXT_UNREF = { - let fp = dlsym(h, cstr!("pa_context_unref")); - if fp.is_null() { -@@ -336,8 +360,15 @@ mod dynamic_fns { - } - fp - }; -- PA_OPERATION_GET_STATE = { -- let fp = dlsym(h, cstr!("pa_operation_get_state")); -+ PA_STRERROR = { -+ let fp = dlsym(h, cstr!("pa_strerror")); -+ if fp.is_null() { -+ return None; -+ } -+ fp -+ }; -+ PA_OPERATION_REF = { -+ let fp = dlsym(h, cstr!("pa_operation_ref")); - if fp.is_null() { - return None; - } -@@ -350,6 +381,27 @@ mod dynamic_fns { - } - fp - }; -+ PA_OPERATION_CANCEL = { -+ let fp = dlsym(h, cstr!("pa_operation_cancel")); -+ if fp.is_null() { -+ return None; -+ } -+ fp -+ }; -+ PA_OPERATION_GET_STATE = { -+ let fp = dlsym(h, cstr!("pa_operation_get_state")); -+ if fp.is_null() { -+ return None; -+ } -+ fp -+ }; -+ PA_OPERATION_SET_STATE_CALLBACK = { -+ let fp = dlsym(h, cstr!("pa_operation_set_state_callback")); -+ if fp.is_null() { -+ return None; -+ } -+ fp -+ }; - PA_PROPLIST_GETS = { - let fp = dlsym(h, cstr!("pa_proplist_gets")); - if fp.is_null() { -@@ -378,6 +430,20 @@ mod dynamic_fns { - } - fp - }; -+ PA_STREAM_IS_SUSPENDED = { -+ let fp = dlsym(h, cstr!("pa_stream_is_suspended")); -+ if fp.is_null() { -+ return None; -+ } -+ fp -+ }; -+ PA_STREAM_IS_CORKED = { -+ let fp = dlsym(h, cstr!("pa_stream_is_corked")); -+ if fp.is_null() { -+ return None; -+ } -+ fp -+ }; - PA_STREAM_CONNECT_PLAYBACK = { - let fp = dlsym(h, cstr!("pa_stream_connect_playback")); - if fp.is_null() { -@@ -462,6 +528,13 @@ mod dynamic_fns { - } - fp - }; -+ PA_STREAM_GET_CONTEXT = { -+ let fp = dlsym(h, cstr!("pa_stream_get_context")); -+ if fp.is_null() { -+ return None; -+ } -+ fp -+ }; - PA_STREAM_GET_TIME = { - let fp = dlsym(h, cstr!("pa_stream_get_time")); - if fp.is_null() { -@@ -511,6 +584,13 @@ mod dynamic_fns { - } - fp - }; -+ PA_STREAM_REF = { -+ let fp = dlsym(h, cstr!("pa_stream_ref")); -+ if fp.is_null() { -+ return None; -+ } -+ fp -+ }; - PA_STREAM_UNREF = { - let fp = dlsym(h, cstr!("pa_stream_unref")); - if fp.is_null() { -@@ -623,20 +703,6 @@ mod dynamic_fns { - } - fp - }; -- PA_XFREE = { -- let fp = dlsym(h, cstr!("pa_xfree")); -- if fp.is_null() { -- return None; -- } -- fp -- }; -- PA_XSTRDUP = { -- let fp = dlsym(h, cstr!("pa_xstrdup")); -- if fp.is_null() { -- return None; -- } -- fp -- }; - PA_XREALLOC = { - let fp = dlsym(h, cstr!("pa_xrealloc")); - if fp.is_null() { -@@ -837,6 +903,12 @@ mod dynamic_fns { - *mut c_void)>(PA_CONTEXT_SET_STATE_CALLBACK))(c, cb, userdata) - } - -+ static mut PA_CONTEXT_ERRNO: *mut ::libc::c_void = 0 as *mut _; -+ #[inline] -+ pub unsafe fn pa_context_errno(c: *mut pa_context) -> c_int { -+ (::std::mem::transmute::<_, extern "C" fn(*mut pa_context) -> c_int>(PA_CONTEXT_ERRNO))(c) -+ } -+ - static mut PA_CONTEXT_SET_SUBSCRIBE_CALLBACK: *mut ::libc::c_void = 0 as *mut _; - #[inline] - pub unsafe fn pa_context_set_subscribe_callback(c: *mut pa_context, -@@ -863,6 +935,12 @@ mod dynamic_fns { - -> *mut pa_operation>(PA_CONTEXT_SUBSCRIBE))(c, m, cb, userdata) - } - -+ static mut PA_CONTEXT_REF: *mut ::libc::c_void = 0 as *mut _; -+ #[inline] -+ pub unsafe fn pa_context_ref(c: *mut pa_context) -> *mut pa_context { -+ (::std::mem::transmute::<_, extern "C" fn(*mut pa_context) -> *mut pa_context>(PA_CONTEXT_REF))(c) -+ } -+ - static mut PA_CONTEXT_UNREF: *mut ::libc::c_void = 0 as *mut _; - #[inline] - pub unsafe fn pa_context_unref(c: *mut pa_context) { -@@ -907,6 +985,30 @@ mod dynamic_fns { - *mut c_void)>(PA_MAINLOOP_API_ONCE))(m, callback, userdata) - } - -+ static mut PA_STRERROR: *mut ::libc::c_void = 0 as *mut _; -+ #[inline] -+ pub unsafe fn pa_strerror(error: pa_error_code_t) -> *const c_char { -+ (::std::mem::transmute::<_, extern "C" fn(pa_error_code_t) -> *const c_char>(PA_STRERROR))(error) -+ } -+ -+ static mut PA_OPERATION_REF: *mut ::libc::c_void = 0 as *mut _; -+ #[inline] -+ pub unsafe fn pa_operation_ref(o: *mut pa_operation) -> *mut pa_operation { -+ (::std::mem::transmute::<_, extern "C" fn(*mut pa_operation) -> *mut pa_operation>(PA_OPERATION_REF))(o) -+ } -+ -+ static mut PA_OPERATION_UNREF: *mut ::libc::c_void = 0 as *mut _; -+ #[inline] -+ pub unsafe fn pa_operation_unref(o: *mut pa_operation) { -+ (::std::mem::transmute::<_, extern "C" fn(*mut pa_operation)>(PA_OPERATION_UNREF))(o) -+ } -+ -+ static mut PA_OPERATION_CANCEL: *mut ::libc::c_void = 0 as *mut _; -+ #[inline] -+ pub unsafe fn pa_operation_cancel(o: *mut pa_operation) { -+ (::std::mem::transmute::<_, extern "C" fn(*mut pa_operation)>(PA_OPERATION_CANCEL))(o) -+ } -+ - static mut PA_OPERATION_GET_STATE: *mut ::libc::c_void = 0 as *mut _; - #[inline] - pub unsafe fn pa_operation_get_state(o: *const pa_operation) -> pa_operation_state_t { -@@ -915,10 +1017,15 @@ mod dynamic_fns { - -> pa_operation_state_t>(PA_OPERATION_GET_STATE))(o) - } - -- static mut PA_OPERATION_UNREF: *mut ::libc::c_void = 0 as *mut _; -+ static mut PA_OPERATION_SET_STATE_CALLBACK: *mut ::libc::c_void = 0 as *mut _; - #[inline] -- pub unsafe fn pa_operation_unref(o: *mut pa_operation) { -- (::std::mem::transmute::<_, extern "C" fn(*mut pa_operation)>(PA_OPERATION_UNREF))(o) -+ pub unsafe fn pa_operation_set_state_callback(o: *mut pa_operation, -+ cb: pa_operation_notify_cb_t, -+ userdata: *mut c_void) { -+ (::std::mem::transmute::<_, -+ extern "C" fn(*mut pa_operation, -+ pa_operation_notify_cb_t, -+ *mut c_void)>(PA_OPERATION_SET_STATE_CALLBACK))(o, cb, userdata) - } - - static mut PA_PROPLIST_GETS: *mut ::libc::c_void = 0 as *mut _; -@@ -951,6 +1058,18 @@ mod dynamic_fns { - (::std::mem::transmute::<_, extern "C" fn(*mut pa_stream) -> c_int>(PA_STREAM_CANCEL_WRITE))(p) - } - -+ static mut PA_STREAM_IS_SUSPENDED: *mut ::libc::c_void = 0 as *mut _; -+ #[inline] -+ pub unsafe fn pa_stream_is_suspended(s: *const pa_stream) -> c_int { -+ (::std::mem::transmute::<_, extern "C" fn(*const pa_stream) -> c_int>(PA_STREAM_IS_SUSPENDED))(s) -+ } -+ -+ static mut PA_STREAM_IS_CORKED: *mut ::libc::c_void = 0 as *mut _; -+ #[inline] -+ pub unsafe fn pa_stream_is_corked(s: *const pa_stream) -> c_int { -+ (::std::mem::transmute::<_, extern "C" fn(*const pa_stream) -> c_int>(PA_STREAM_IS_CORKED))(s) -+ } -+ - static mut PA_STREAM_CONNECT_PLAYBACK: *mut ::libc::c_void = 0 as *mut _; - #[inline] - pub unsafe fn pa_stream_connect_playback(s: *mut pa_stream, -@@ -1066,6 +1185,12 @@ mod dynamic_fns { - (::std::mem::transmute::<_, extern "C" fn(*const pa_stream) -> pa_stream_state_t>(PA_STREAM_GET_STATE))(p) - } - -+ static mut PA_STREAM_GET_CONTEXT: *mut ::libc::c_void = 0 as *mut _; -+ #[inline] -+ pub unsafe fn pa_stream_get_context(s: *const pa_stream) -> *mut pa_context { -+ (::std::mem::transmute::<_, extern "C" fn(*const pa_stream) -> *mut pa_context>(PA_STREAM_GET_CONTEXT))(s) -+ } -+ - static mut PA_STREAM_GET_TIME: *mut ::libc::c_void = 0 as *mut _; - #[inline] - pub unsafe fn pa_stream_get_time(s: *const pa_stream, r_usec: *mut pa_usec_t) -> c_int { -@@ -1132,6 +1257,12 @@ mod dynamic_fns { - *mut c_void)>(PA_STREAM_SET_READ_CALLBACK))(p, cb, userdata) - } - -+ static mut PA_STREAM_REF: *mut ::libc::c_void = 0 as *mut _; -+ #[inline] -+ pub unsafe fn pa_stream_ref(s: *mut pa_stream) -> *mut pa_stream { -+ (::std::mem::transmute::<_, extern "C" fn(*mut pa_stream) -> *mut pa_stream>(PA_STREAM_REF))(s) -+ } -+ - static mut PA_STREAM_UNREF: *mut ::libc::c_void = 0 as *mut _; - #[inline] - pub unsafe fn pa_stream_unref(s: *mut pa_stream) { -@@ -1253,18 +1384,6 @@ mod dynamic_fns { - spec) - } - -- static mut PA_XFREE: *mut ::libc::c_void = 0 as *mut _; -- #[inline] -- pub unsafe fn pa_xfree(ptr: *mut c_void) { -- (::std::mem::transmute::<_, extern "C" fn(*mut c_void)>(PA_XFREE))(ptr) -- } -- -- static mut PA_XSTRDUP: *mut ::libc::c_void = 0 as *mut _; -- #[inline] -- pub unsafe fn pa_xstrdup(str: *const c_char) -> *mut c_char { -- (::std::mem::transmute::<_, extern "C" fn(*const c_char) -> *mut c_char>(PA_XSTRDUP))(str) -- } -- - static mut PA_XREALLOC: *mut ::libc::c_void = 0 as *mut _; - #[inline] - pub unsafe fn pa_xrealloc(ptr: *mut c_void, size: usize) -> *mut c_void { -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-ffi/src/ffi_types.rs.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-ffi/src/ffi_types.rs ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-ffi/src/ffi_types.rs.cubeb-pulse-arm 2017-07-31 18:20:49.000000000 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-ffi/src/ffi_types.rs 2017-08-04 13:37:46.384821737 +0200 -@@ -1,6 +1,6 @@ - #![allow(non_camel_case_types)] - --use std::os::raw::{c_char, c_int, c_long, c_ulong, c_void}; -+use std::os::raw::{c_char, c_int, c_long, c_uint, c_ulong, c_void}; - - /* automatically generated by rust-bindgen */ - pub const PA_RATE_MAX: u32 = 48000 * 8; -@@ -74,10 +74,10 @@ pub const PA_OPERATION_DONE: c_int = 1; - pub const PA_OPERATION_CANCELLED: c_int = 2; - pub type pa_operation_state_t = c_int; - --pub const PA_CONTEXT_NOFLAGS: c_int = 0; --pub const PA_CONTEXT_NOAUTOSPAWN: c_int = 1; --pub const PA_CONTEXT_NOFAIL: c_int = 2; --pub type pa_context_flags_t = c_int; -+pub const PA_CONTEXT_NOFLAGS: c_uint = 0; -+pub const PA_CONTEXT_NOAUTOSPAWN: c_uint = 1; -+pub const PA_CONTEXT_NOFAIL: c_uint = 2; -+pub type pa_context_flags_t = c_uint; - - pub const PA_DIRECTION_OUTPUT: c_int = 1; - pub const PA_DIRECTION_INPUT: c_int = 2; -@@ -93,28 +93,28 @@ pub const PA_STREAM_RECORD: c_int = 2; - pub const PA_STREAM_UPLOAD: c_int = 3; - pub type pa_stream_direction_t = c_int; - --pub const PA_STREAM_NOFLAGS: c_int = 0x0_0000; --pub const PA_STREAM_START_CORKED: c_int = 0x0_0001; --pub const PA_STREAM_INTERPOLATE_TIMING: c_int = 0x0_0002; --pub const PA_STREAM_NOT_MONOTONIC: c_int = 0x0_0004; --pub const PA_STREAM_AUTO_TIMING_UPDATE: c_int = 0x0_0008; --pub const PA_STREAM_NO_REMAP_CHANNELS: c_int = 0x0_0010; --pub const PA_STREAM_NO_REMIX_CHANNELS: c_int = 0x0_0020; --pub const PA_STREAM_FIX_FORMAT: c_int = 0x0_0040; --pub const PA_STREAM_FIX_RATE: c_int = 0x0_0080; --pub const PA_STREAM_FIX_CHANNELS: c_int = 0x0_0100; --pub const PA_STREAM_DONT_MOVE: c_int = 0x0_0200; --pub const PA_STREAM_VARIABLE_RATE: c_int = 0x0_0400; --pub const PA_STREAM_PEAK_DETECT: c_int = 0x0_0800; --pub const PA_STREAM_START_MUTED: c_int = 0x0_1000; --pub const PA_STREAM_ADJUST_LATENCY: c_int = 0x0_2000; --pub const PA_STREAM_EARLY_REQUESTS: c_int = 0x0_4000; --pub const PA_STREAM_DONT_INHIBIT_AUTO_SUSPEND: c_int = 0x0_8000; --pub const PA_STREAM_START_UNMUTED: c_int = 0x1_0000; --pub const PA_STREAM_FAIL_ON_SUSPEND: c_int = 0x2_0000; --pub const PA_STREAM_RELATIVE_VOLUME: c_int = 0x4_0000; --pub const PA_STREAM_PASSTHROUGH: c_int = 0x8_0000; --pub type pa_stream_flags_t = c_int; -+pub const PA_STREAM_NOFLAGS: c_uint = 0x0_0000; -+pub const PA_STREAM_START_CORKED: c_uint = 0x0_0001; -+pub const PA_STREAM_INTERPOLATE_TIMING: c_uint = 0x0_0002; -+pub const PA_STREAM_NOT_MONOTONIC: c_uint = 0x0_0004; -+pub const PA_STREAM_AUTO_TIMING_UPDATE: c_uint = 0x0_0008; -+pub const PA_STREAM_NO_REMAP_CHANNELS: c_uint = 0x0_0010; -+pub const PA_STREAM_NO_REMIX_CHANNELS: c_uint = 0x0_0020; -+pub const PA_STREAM_FIX_FORMAT: c_uint = 0x0_0040; -+pub const PA_STREAM_FIX_RATE: c_uint = 0x0_0080; -+pub const PA_STREAM_FIX_CHANNELS: c_uint = 0x0_0100; -+pub const PA_STREAM_DONT_MOVE: c_uint = 0x0_0200; -+pub const PA_STREAM_VARIABLE_RATE: c_uint = 0x0_0400; -+pub const PA_STREAM_PEAK_DETECT: c_uint = 0x0_0800; -+pub const PA_STREAM_START_MUTED: c_uint = 0x0_1000; -+pub const PA_STREAM_ADJUST_LATENCY: c_uint = 0x0_2000; -+pub const PA_STREAM_EARLY_REQUESTS: c_uint = 0x0_4000; -+pub const PA_STREAM_DONT_INHIBIT_AUTO_SUSPEND: c_uint = 0x0_8000; -+pub const PA_STREAM_START_UNMUTED: c_uint = 0x1_0000; -+pub const PA_STREAM_FAIL_ON_SUSPEND: c_uint = 0x2_0000; -+pub const PA_STREAM_RELATIVE_VOLUME: c_uint = 0x4_0000; -+pub const PA_STREAM_PASSTHROUGH: c_uint = 0x8_0000; -+pub type pa_stream_flags_t = c_uint; - - #[repr(C)] - #[derive(Clone, Copy, Debug)] -@@ -162,19 +162,19 @@ pub const PA_ERR_BUSY: c_int = 26; - pub const PA_ERR_MAX: c_int = 27; - pub type pa_error_code_t = c_int; - --pub const PA_SUBSCRIPTION_MASK_NULL: c_int = 0; --pub const PA_SUBSCRIPTION_MASK_SINK: c_int = 1; --pub const PA_SUBSCRIPTION_MASK_SOURCE: c_int = 2; --pub const PA_SUBSCRIPTION_MASK_SINK_INPUT: c_int = 4; --pub const PA_SUBSCRIPTION_MASK_SOURCE_OUTPUT: c_int = 8; --pub const PA_SUBSCRIPTION_MASK_MODULE: c_int = 16; --pub const PA_SUBSCRIPTION_MASK_CLIENT: c_int = 32; --pub const PA_SUBSCRIPTION_MASK_SAMPLE_CACHE: c_int = 64; --pub const PA_SUBSCRIPTION_MASK_SERVER: c_int = 128; --pub const PA_SUBSCRIPTION_MASK_AUTOLOAD: c_int = 256; --pub const PA_SUBSCRIPTION_MASK_CARD: c_int = 512; --pub const PA_SUBSCRIPTION_MASK_ALL: c_int = 767; --pub type pa_subscription_mask_t = c_int; -+pub const PA_SUBSCRIPTION_MASK_NULL: c_uint = 0x0; -+pub const PA_SUBSCRIPTION_MASK_SINK: c_uint = 0x1; -+pub const PA_SUBSCRIPTION_MASK_SOURCE: c_uint = 0x2; -+pub const PA_SUBSCRIPTION_MASK_SINK_INPUT: c_uint = 0x4; -+pub const PA_SUBSCRIPTION_MASK_SOURCE_OUTPUT: c_uint = 0x8; -+pub const PA_SUBSCRIPTION_MASK_MODULE: c_uint = 0x10; -+pub const PA_SUBSCRIPTION_MASK_CLIENT: c_uint = 0x20; -+pub const PA_SUBSCRIPTION_MASK_SAMPLE_CACHE: c_uint = 0x40; -+pub const PA_SUBSCRIPTION_MASK_SERVER: c_uint = 0x80; -+pub const PA_SUBSCRIPTION_MASK_AUTOLOAD: c_uint = 0x100; -+pub const PA_SUBSCRIPTION_MASK_CARD: c_uint = 0x200; -+pub const PA_SUBSCRIPTION_MASK_ALL: c_uint = 0x3FF; -+pub type pa_subscription_mask_t = c_uint; - - pub const PA_SUBSCRIPTION_EVENT_SINK: c_int = 0; - pub const PA_SUBSCRIPTION_EVENT_SOURCE: c_int = 1; -@@ -244,17 +244,17 @@ pub const PA_SEEK_RELATIVE_ON_READ: c_in - pub const PA_SEEK_RELATIVE_END: c_int = 3; - pub type pa_seek_mode_t = c_int; - --pub const PA_SINK_NOFLAGS: c_int = 0; --pub const PA_SINK_HW_VOLUME_CTRL: c_int = 1; --pub const PA_SINK_LATENCY: c_int = 2; --pub const PA_SINK_HARDWARE: c_int = 4; --pub const PA_SINK_NETWORK: c_int = 8; --pub const PA_SINK_HW_MUTE_CTRL: c_int = 16; --pub const PA_SINK_DECIBEL_VOLUME: c_int = 32; --pub const PA_SINK_FLAT_VOLUME: c_int = 64; --pub const PA_SINK_DYNAMIC_LATENCY: c_int = 128; --pub const PA_SINK_SET_FORMATS: c_int = 256; --pub type pa_sink_flags_t = c_int; -+pub const PA_SINK_NOFLAGS: c_uint = 0x000; -+pub const PA_SINK_HW_VOLUME_CTRL: c_uint = 0x001; -+pub const PA_SINK_LATENCY: c_uint = 0x002; -+pub const PA_SINK_HARDWARE: c_uint = 0x004; -+pub const PA_SINK_NETWORK: c_uint = 0x008; -+pub const PA_SINK_HW_MUTE_CTRL: c_uint = 0x010; -+pub const PA_SINK_DECIBEL_VOLUME: c_uint = 0x020; -+pub const PA_SINK_FLAT_VOLUME: c_uint = 0x040; -+pub const PA_SINK_DYNAMIC_LATENCY: c_uint = 0x080; -+pub const PA_SINK_SET_FORMATS: c_uint = 0x100; -+pub type pa_sink_flags_t = c_uint; - - pub const PA_SINK_INVALID_STATE: c_int = -1; - pub const PA_SINK_RUNNING: c_int = 0; -@@ -264,16 +264,16 @@ pub const PA_SINK_INIT: c_int = -2; - pub const PA_SINK_UNLINKED: c_int = -3; - pub type pa_sink_state_t = c_int; - --pub const PA_SOURCE_NOFLAGS: c_int = 0x00; --pub const PA_SOURCE_HW_VOLUME_CTRL: c_int = 0x01; --pub const PA_SOURCE_LATENCY: c_int = 0x02; --pub const PA_SOURCE_HARDWARE: c_int = 0x04; --pub const PA_SOURCE_NETWORK: c_int = 0x08; --pub const PA_SOURCE_HW_MUTE_CTRL: c_int = 0x10; --pub const PA_SOURCE_DECIBEL_VOLUME: c_int = 0x20; --pub const PA_SOURCE_DYNAMIC_LATENCY: c_int = 0x40; --pub const PA_SOURCE_FLAT_VOLUME: c_int = 0x80; --pub type pa_source_flags_t = c_int; -+pub const PA_SOURCE_NOFLAGS: c_uint = 0x00; -+pub const PA_SOURCE_HW_VOLUME_CTRL: c_uint = 0x01; -+pub const PA_SOURCE_LATENCY: c_uint = 0x02; -+pub const PA_SOURCE_HARDWARE: c_uint = 0x04; -+pub const PA_SOURCE_NETWORK: c_uint = 0x08; -+pub const PA_SOURCE_HW_MUTE_CTRL: c_uint = 0x10; -+pub const PA_SOURCE_DECIBEL_VOLUME: c_uint = 0x20; -+pub const PA_SOURCE_DYNAMIC_LATENCY: c_uint = 0x40; -+pub const PA_SOURCE_FLAT_VOLUME: c_uint = 0x80; -+pub type pa_source_flags_t = c_uint; - - pub const PA_SOURCE_INVALID_STATE: c_int = -1; - pub const PA_SOURCE_RUNNING: c_int = 0; -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/Cargo.toml.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/Cargo.toml ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/Cargo.toml.cubeb-pulse-arm 2017-08-04 13:37:46.384821737 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/Cargo.toml 2017-08-04 13:37:46.384821737 +0200 -@@ -0,0 +1,8 @@ -+[package] -+name = "pulse" -+version = "0.1.0" -+authors = ["Dan Glastonbury "] -+ -+[dependencies] -+bitflags = "^0.7.0" -+pulse-ffi = { path = "../pulse-ffi" } -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/context.rs.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/context.rs ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/context.rs.cubeb-pulse-arm 2017-08-04 13:37:46.385821734 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/context.rs 2017-08-04 13:37:46.385821734 +0200 -@@ -0,0 +1,394 @@ -+// Copyright © 2017 Mozilla Foundation -+// -+// This program is made available under an ISC-style license. See the -+// accompanying file LICENSE for details. -+ -+use ::*; -+use ffi; -+use std::ffi::CStr; -+use std::os::raw::{c_int, c_void}; -+use std::ptr; -+use util::UnwrapCStr; -+ -+// A note about `wrapped` functions -+// -+// C FFI demands `unsafe extern fn(*mut pa_context, ...) -> i32`, etc, -+// but we want to allow such callbacks to be safe. This means no -+// `unsafe` or `extern`, and callbacks should be called with a safe -+// wrapper of `*mut pa_context`. Since the callback doesn't take -+// ownership, this is `&Context`. `fn wrapped(...)` defines a -+// function that converts from our safe signature to the unsafe -+// signature. -+// -+// Currently, we use a property of Rust, namely that each function -+// gets its own unique type. These unique types can't be written -+// directly, so we use generic and a type parameter, and let the Rust -+// compiler fill in the name for us: -+// -+// fn get_sink_input_info(&self, ..., _: CB, ...) -> ... -+// where CB: Fn(&Context, *const SinkInputInfo, i32, *mut c_void) -+// -+// Because we aren't storing or passing any state, we assert, at run-time :-(, -+// that our functions are zero-sized: -+// -+// assert!(mem::size_of::() == 0); -+// -+// We need to obtain a value of type F in order to call it. Since we -+// can't name the function, we have to unsafely construct that value -+// somehow - we do this using mem::uninitialized. Then, we call that -+// function with a reference to the Context, and save the result: -+// -+// | generate value || call it | -+// let result = ::std::mem::uninitialized::()(&mut object); -+// -+// Lastly, since our Object is an owned type, we need to avoid -+// dropping it, then return the result we just generated. -+// -+// mem::forget(object); -+// result -+ -+// Aid in returning Operation from callbacks -+macro_rules! op_or_err { -+ ($self_:ident, $e:expr) => {{ -+ let o = unsafe { $e }; -+ if o.is_null() { -+ Err(ErrorCode::from_error_code($self_.errno())) -+ } else { -+ Ok(unsafe { operation::from_raw_ptr(o) }) -+ } -+ }} -+} -+ -+#[repr(C)] -+#[derive(Debug)] -+pub struct Context(*mut ffi::pa_context); -+ -+impl Context { -+ pub fn new<'a, OPT>(api: &MainloopApi, name: OPT) -> Option -+ where OPT: Into> -+ { -+ let ptr = unsafe { ffi::pa_context_new(api.raw_mut(), name.unwrap_cstr()) }; -+ if ptr.is_null() { -+ None -+ } else { -+ Some(Context(ptr)) -+ } -+ } -+ -+ #[doc(hidden)] -+ pub fn raw_mut(&self) -> &mut ffi::pa_context { -+ unsafe { &mut *self.0 } -+ } -+ -+ pub fn unref(self) { -+ unsafe { -+ ffi::pa_context_unref(self.raw_mut()); -+ } -+ } -+ -+ pub fn clear_state_callback(&self) { -+ unsafe { -+ ffi::pa_context_set_state_callback(self.raw_mut(), None, ptr::null_mut()); -+ } -+ } -+ -+ pub fn set_state_callback(&self, _: CB, userdata: *mut c_void) -+ where CB: Fn(&Context, *mut c_void) -+ { -+ debug_assert_eq!(::std::mem::size_of::(), 0); -+ -+ // See: A note about `wrapped` functions -+ unsafe extern "C" fn wrapped(c: *mut ffi::pa_context, userdata: *mut c_void) -+ where F: Fn(&Context, *mut c_void) -+ { -+ use std::mem::{forget, uninitialized}; -+ let ctx = context::from_raw_ptr(c); -+ let result = uninitialized::()(&ctx, userdata); -+ forget(ctx); -+ -+ result -+ } -+ -+ unsafe { -+ ffi::pa_context_set_state_callback(self.raw_mut(), Some(wrapped::), userdata); -+ } -+ } -+ -+ pub fn errno(&self) -> ffi::pa_error_code_t { -+ unsafe { ffi::pa_context_errno(self.raw_mut()) } -+ } -+ -+ pub fn get_state(&self) -> ContextState { -+ ContextState::try_from(unsafe { -+ ffi::pa_context_get_state(self.raw_mut()) -+ }).expect("pa_context_get_state returned invalid ContextState") -+ } -+ -+ pub fn connect<'a, OPT>(&self, server: OPT, flags: ContextFlags, api: *const ffi::pa_spawn_api) -> Result<()> -+ where OPT: Into> -+ { -+ let r = unsafe { -+ ffi::pa_context_connect(self.raw_mut(), -+ server.into().unwrap_cstr(), -+ flags.into(), -+ api) -+ }; -+ error_result!((), r) -+ } -+ -+ pub fn disconnect(&self) { -+ unsafe { -+ ffi::pa_context_disconnect(self.raw_mut()); -+ } -+ } -+ -+ -+ pub fn drain(&self, _: CB, userdata: *mut c_void) -> Result -+ where CB: Fn(&Context, *mut c_void) -+ { -+ debug_assert_eq!(::std::mem::size_of::(), 0); -+ -+ // See: A note about `wrapped` functions -+ unsafe extern "C" fn wrapped(c: *mut ffi::pa_context, userdata: *mut c_void) -+ where F: Fn(&Context, *mut c_void) -+ { -+ use std::mem::{forget, uninitialized}; -+ let ctx = context::from_raw_ptr(c); -+ let result = uninitialized::()(&ctx, userdata); -+ forget(ctx); -+ -+ result -+ } -+ -+ op_or_err!(self, -+ ffi::pa_context_drain(self.raw_mut(), Some(wrapped::), userdata)) -+ } -+ -+ pub fn rttime_new(&self, usec: USec, _: CB, userdata: *mut c_void) -> *mut ffi::pa_time_event -+ where CB: Fn(&MainloopApi, *mut ffi::pa_time_event, &TimeVal, *mut c_void) -+ { -+ debug_assert_eq!(::std::mem::size_of::(), 0); -+ -+ // See: A note about `wrapped` functions -+ unsafe extern "C" fn wrapped(a: *mut ffi::pa_mainloop_api, -+ e: *mut ffi::pa_time_event, -+ tv: *const TimeVal, -+ userdata: *mut c_void) -+ where F: Fn(&MainloopApi, *mut ffi::pa_time_event, &TimeVal, *mut c_void) -+ { -+ use std::mem::{forget, uninitialized}; -+ let api = mainloop_api::from_raw_ptr(a); -+ let timeval = &*tv; -+ let result = uninitialized::()(&api, e, timeval, userdata); -+ forget(api); -+ -+ result -+ } -+ -+ unsafe { ffi::pa_context_rttime_new(self.raw_mut(), usec, Some(wrapped::), userdata) } -+ } -+ -+ pub fn get_server_info(&self, _: CB, userdata: *mut c_void) -> Result -+ where CB: Fn(&Context, &ServerInfo, *mut c_void) -+ { -+ debug_assert_eq!(::std::mem::size_of::(), 0); -+ -+ // See: A note about `wrapped` functions -+ unsafe extern "C" fn wrapped(c: *mut ffi::pa_context, i: *const ffi::pa_server_info, userdata: *mut c_void) -+ where F: Fn(&Context, &ServerInfo, *mut c_void) -+ { -+ use std::mem::{forget, uninitialized}; -+ debug_assert_ne!(i, ptr::null_mut()); -+ let info = &*i; -+ let ctx = context::from_raw_ptr(c); -+ let result = uninitialized::()(&ctx, info, userdata); -+ forget(ctx); -+ -+ result -+ } -+ -+ op_or_err!(self, -+ ffi::pa_context_get_server_info(self.raw_mut(), Some(wrapped::), userdata)) -+ } -+ -+ pub fn get_sink_info_by_name(&self, name: &CStr, _: CB, userdata: *mut c_void) -> Result -+ where CB: Fn(&Context, *const SinkInfo, i32, *mut c_void) -+ { -+ debug_assert_eq!(::std::mem::size_of::(), 0); -+ -+ // See: A note about `wrapped` functions -+ unsafe extern "C" fn wrapped(c: *mut ffi::pa_context, -+ info: *const ffi::pa_sink_info, -+ eol: c_int, -+ userdata: *mut c_void) -+ where F: Fn(&Context, *const SinkInfo, i32, *mut c_void) -+ { -+ use std::mem::{forget, uninitialized}; -+ let ctx = context::from_raw_ptr(c); -+ let result = uninitialized::()(&ctx, info, eol, userdata); -+ forget(ctx); -+ -+ result -+ } -+ -+ op_or_err!(self, -+ ffi::pa_context_get_sink_info_by_name(self.raw_mut(), name.as_ptr(), Some(wrapped::), userdata)) -+ } -+ -+ pub fn get_sink_info_list(&self, _: CB, userdata: *mut c_void) -> Result -+ where CB: Fn(&Context, *const SinkInfo, i32, *mut c_void) -+ { -+ debug_assert_eq!(::std::mem::size_of::(), 0); -+ -+ // See: A note about `wrapped` functions -+ unsafe extern "C" fn wrapped(c: *mut ffi::pa_context, -+ info: *const ffi::pa_sink_info, -+ eol: c_int, -+ userdata: *mut c_void) -+ where F: Fn(&Context, *const SinkInfo, i32, *mut c_void) -+ { -+ use std::mem::{forget, uninitialized}; -+ let ctx = context::from_raw_ptr(c); -+ let result = uninitialized::()(&ctx, info, eol, userdata); -+ forget(ctx); -+ -+ result -+ } -+ -+ op_or_err!(self, -+ ffi::pa_context_get_sink_info_list(self.raw_mut(), Some(wrapped::), userdata)) -+ } -+ -+ pub fn get_sink_input_info(&self, idx: u32, _: CB, userdata: *mut c_void) -> Result -+ where CB: Fn(&Context, *const SinkInputInfo, i32, *mut c_void) -+ { -+ debug_assert_eq!(::std::mem::size_of::(), 0); -+ -+ // See: A note about `wrapped` functions -+ unsafe extern "C" fn wrapped(c: *mut ffi::pa_context, -+ info: *const ffi::pa_sink_input_info, -+ eol: c_int, -+ userdata: *mut c_void) -+ where F: Fn(&Context, *const SinkInputInfo, i32, *mut c_void) -+ { -+ use std::mem::{forget, uninitialized}; -+ let ctx = context::from_raw_ptr(c); -+ let result = uninitialized::()(&ctx, info, eol, userdata); -+ forget(ctx); -+ -+ result -+ } -+ -+ op_or_err!(self, -+ ffi::pa_context_get_sink_input_info(self.raw_mut(), idx, Some(wrapped::), userdata)) -+ } -+ -+ pub fn get_source_info_list(&self, _: CB, userdata: *mut c_void) -> Result -+ where CB: Fn(&Context, *const SourceInfo, i32, *mut c_void) -+ { -+ debug_assert_eq!(::std::mem::size_of::(), 0); -+ -+ // See: A note about `wrapped` functions -+ unsafe extern "C" fn wrapped(c: *mut ffi::pa_context, -+ info: *const ffi::pa_source_info, -+ eol: c_int, -+ userdata: *mut c_void) -+ where F: Fn(&Context, *const SourceInfo, i32, *mut c_void) -+ { -+ use std::mem::{forget, uninitialized}; -+ let ctx = context::from_raw_ptr(c); -+ let result = uninitialized::()(&ctx, info, eol, userdata); -+ forget(ctx); -+ -+ result -+ } -+ -+ op_or_err!(self, -+ ffi::pa_context_get_source_info_list(self.raw_mut(), Some(wrapped::), userdata)) -+ } -+ -+ pub fn set_sink_input_volume(&self, -+ idx: u32, -+ volume: &CVolume, -+ _: CB, -+ userdata: *mut c_void) -+ -> Result -+ where CB: Fn(&Context, i32, *mut c_void) -+ { -+ debug_assert_eq!(::std::mem::size_of::(), 0); -+ -+ // See: A note about `wrapped` functions -+ unsafe extern "C" fn wrapped(c: *mut ffi::pa_context, success: c_int, userdata: *mut c_void) -+ where F: Fn(&Context, i32, *mut c_void) -+ { -+ use std::mem::{forget, uninitialized}; -+ let ctx = context::from_raw_ptr(c); -+ let result = uninitialized::()(&ctx, success, userdata); -+ forget(ctx); -+ -+ result -+ } -+ -+ op_or_err!(self, -+ ffi::pa_context_set_sink_input_volume(self.raw_mut(), idx, volume, Some(wrapped::), userdata)) -+ } -+ -+ pub fn subscribe(&self, m: SubscriptionMask, _: CB, userdata: *mut c_void) -> Result -+ where CB: Fn(&Context, i32, *mut c_void) -+ { -+ debug_assert_eq!(::std::mem::size_of::(), 0); -+ -+ // See: A note about `wrapped` functions -+ unsafe extern "C" fn wrapped(c: *mut ffi::pa_context, success: c_int, userdata: *mut c_void) -+ where F: Fn(&Context, i32, *mut c_void) -+ { -+ use std::mem::{forget, uninitialized}; -+ let ctx = context::from_raw_ptr(c); -+ let result = uninitialized::()(&ctx, success, userdata); -+ forget(ctx); -+ -+ result -+ } -+ -+ op_or_err!(self, -+ ffi::pa_context_subscribe(self.raw_mut(), m.into(), Some(wrapped::), userdata)) -+ } -+ -+ pub fn clear_subscribe_callback(&self) { -+ unsafe { -+ ffi::pa_context_set_subscribe_callback(self.raw_mut(), None, ptr::null_mut()); -+ } -+ } -+ -+ pub fn set_subscribe_callback(&self, _: CB, userdata: *mut c_void) -+ where CB: Fn(&Context, SubscriptionEvent, u32, *mut c_void) -+ { -+ debug_assert_eq!(::std::mem::size_of::(), 0); -+ -+ // See: A note about `wrapped` functions -+ unsafe extern "C" fn wrapped(c: *mut ffi::pa_context, -+ t: ffi::pa_subscription_event_type_t, -+ idx: u32, -+ userdata: *mut c_void) -+ where F: Fn(&Context, SubscriptionEvent, u32, *mut c_void) -+ { -+ use std::mem::{forget, uninitialized}; -+ let ctx = context::from_raw_ptr(c); -+ let event = SubscriptionEvent::try_from(t) -+ .expect("pa_context_subscribe_cb_t passed invalid pa_subscription_event_type_t"); -+ let result = uninitialized::()(&ctx, event, idx, userdata); -+ forget(ctx); -+ -+ result -+ } -+ -+ unsafe { -+ ffi::pa_context_set_subscribe_callback(self.raw_mut(), Some(wrapped::), userdata); -+ } -+ } -+} -+ -+#[doc(hidden)] -+pub unsafe fn from_raw_ptr(ptr: *mut ffi::pa_context) -> Context { -+ Context(ptr) -+} -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/error.rs.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/error.rs ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/error.rs.cubeb-pulse-arm 2017-08-04 13:37:46.385821734 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/error.rs 2017-08-04 13:37:46.385821734 +0200 -@@ -0,0 +1,56 @@ -+// Copyright © 2017 Mozilla Foundation -+// -+// This program is made available under an ISC-style license. See the -+// accompanying file LICENSE for details. -+ -+use ffi; -+use std::ffi::CStr; -+ -+#[macro_export] -+macro_rules! error_result { -+ ($t:expr, $err:expr) => { -+ if $err >= 0 { -+ Ok($t) -+ } else { -+ Err(ErrorCode::from_error_result($err)) -+ } -+ } -+} -+ -+#[derive(Debug, PartialEq)] -+pub struct ErrorCode { -+ err: ffi::pa_error_code_t, -+} -+ -+impl ErrorCode { -+ pub fn from_error_result(err: i32) -> Self { -+ debug_assert!(err < 0); -+ ErrorCode { -+ err: (-err) as ffi::pa_error_code_t, -+ } -+ } -+ -+ pub fn from_error_code(err: ffi::pa_error_code_t) -> Self { -+ debug_assert!(err > 0); -+ ErrorCode { -+ err: err, -+ } -+ } -+ -+ fn desc(&self) -> &'static str { -+ let cstr = unsafe { CStr::from_ptr(ffi::pa_strerror(self.err)) }; -+ cstr.to_str().unwrap() -+ } -+} -+ -+impl ::std::error::Error for ErrorCode { -+ fn description(&self) -> &str { -+ self.desc() -+ } -+} -+ -+impl ::std::fmt::Display for ErrorCode { -+ fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { -+ write!(f, "{:?}: {}", self, self.desc()) -+ } -+} -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/lib.rs.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/lib.rs ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/lib.rs.cubeb-pulse-arm 2017-08-04 13:37:46.385821734 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/lib.rs 2017-08-04 13:37:46.385821734 +0200 -@@ -0,0 +1,653 @@ -+// Copyright © 2017 Mozilla Foundation -+// -+// This program is made available under an ISC-style license. See the -+// accompanying file LICENSE for details. -+ -+#[macro_use] -+extern crate bitflags; -+extern crate pulse_ffi as ffi; -+ -+#[macro_use] -+mod error; -+mod context; -+mod mainloop_api; -+mod operation; -+mod proplist; -+mod stream; -+mod threaded_mainloop; -+mod util; -+ -+pub use context::Context; -+pub use error::ErrorCode; -+pub use ffi::pa_buffer_attr as BufferAttr; -+pub use ffi::pa_channel_map as ChannelMap; -+pub use ffi::pa_cvolume as CVolume; -+pub use ffi::pa_sample_spec as SampleSpec; -+pub use ffi::pa_server_info as ServerInfo; -+pub use ffi::pa_sink_info as SinkInfo; -+pub use ffi::pa_sink_input_info as SinkInputInfo; -+pub use ffi::pa_source_info as SourceInfo; -+pub use ffi::pa_usec_t as USec; -+pub use ffi::pa_volume_t as Volume; -+pub use ffi::timeval as TimeVal; -+pub use mainloop_api::MainloopApi; -+pub use operation::Operation; -+pub use proplist::Proplist; -+use std::os::raw::{c_char, c_uint}; -+pub use stream::Stream; -+pub use threaded_mainloop::ThreadedMainloop; -+ -+#[allow(non_camel_case_types)] -+#[repr(i32)] -+#[derive(Clone, Copy, Debug, PartialEq, Eq)] -+pub enum SampleFormat { -+ Invalid = ffi::PA_SAMPLE_INVALID, -+ U8 = ffi::PA_SAMPLE_U8, -+ Alaw = ffi::PA_SAMPLE_ALAW, -+ Ulaw = ffi::PA_SAMPLE_ULAW, -+ Signed16LE = ffi::PA_SAMPLE_S16LE, -+ Signed16BE = ffi::PA_SAMPLE_S16BE, -+ Float32LE = ffi::PA_SAMPLE_FLOAT32LE, -+ Float32BE = ffi::PA_SAMPLE_FLOAT32BE, -+ Signed32LE = ffi::PA_SAMPLE_S32LE, -+ Signed32BE = ffi::PA_SAMPLE_S32BE, -+ Signed24LE = ffi::PA_SAMPLE_S24LE, -+ Signed24BE = ffi::PA_SAMPLE_S24BE, -+ Signed24_32LE = ffi::PA_SAMPLE_S24_32LE, -+ Signed23_32BE = ffi::PA_SAMPLE_S24_32BE, -+} -+ -+impl Default for SampleFormat { -+ fn default() -> Self { -+ SampleFormat::Invalid -+ } -+} -+ -+impl Into for SampleFormat { -+ fn into(self) -> ffi::pa_sample_format_t { -+ self as ffi::pa_sample_format_t -+ } -+} -+ -+#[repr(i32)] -+#[derive(Clone, Copy, Debug, PartialEq, Eq)] -+pub enum ContextState { -+ Unconnected = ffi::PA_CONTEXT_UNCONNECTED, -+ Connecting = ffi::PA_CONTEXT_CONNECTING, -+ Authorizing = ffi::PA_CONTEXT_AUTHORIZING, -+ SettingName = ffi::PA_CONTEXT_SETTING_NAME, -+ Ready = ffi::PA_CONTEXT_READY, -+ Failed = ffi::PA_CONTEXT_FAILED, -+ Terminated = ffi::PA_CONTEXT_TERMINATED, -+} -+ -+impl ContextState { -+ // This function implements the PA_CONTENT_IS_GOOD macro from pulse/def.h -+ // It must match the version from PA headers. -+ pub fn is_good(self) -> bool { -+ match self { -+ ContextState::Connecting | -+ ContextState::Authorizing | -+ ContextState::SettingName | -+ ContextState::Ready => true, -+ _ => false, -+ } -+ } -+ -+ pub fn try_from(x: ffi::pa_context_state_t) -> Option { -+ if x >= ffi::PA_CONTEXT_UNCONNECTED && x <= ffi::PA_CONTEXT_TERMINATED { -+ Some(unsafe { ::std::mem::transmute(x) }) -+ } else { -+ None -+ } -+ } -+} -+ -+impl Default for ContextState { -+ fn default() -> Self { -+ ContextState::Unconnected -+ } -+} -+ -+impl Into for ContextState { -+ fn into(self) -> ffi::pa_context_state_t { -+ self as ffi::pa_context_state_t -+ } -+} -+ -+#[repr(i32)] -+#[derive(Clone, Copy, Debug, PartialEq, Eq)] -+pub enum StreamState { -+ Unconnected = ffi::PA_STREAM_UNCONNECTED, -+ Creating = ffi::PA_STREAM_CREATING, -+ Ready = ffi::PA_STREAM_READY, -+ Failed = ffi::PA_STREAM_FAILED, -+ Terminated = ffi::PA_STREAM_TERMINATED, -+} -+ -+impl StreamState { -+ // This function implements the PA_STREAM_IS_GOOD macro from pulse/def.h -+ // It must match the version from PA headers. -+ pub fn is_good(self) -> bool { -+ match self { -+ StreamState::Creating | StreamState::Ready => true, -+ _ => false, -+ } -+ } -+ -+ pub fn try_from(x: ffi::pa_stream_state_t) -> Option { -+ if x >= ffi::PA_STREAM_UNCONNECTED && x <= ffi::PA_STREAM_TERMINATED { -+ Some(unsafe { ::std::mem::transmute(x) }) -+ } else { -+ None -+ } -+ } -+} -+ -+impl Default for StreamState { -+ fn default() -> Self { -+ StreamState::Unconnected -+ } -+} -+ -+impl Into for StreamState { -+ fn into(self) -> ffi::pa_stream_state_t { -+ self as ffi::pa_stream_state_t -+ } -+} -+ -+#[repr(i32)] -+#[derive(Clone, Copy, Debug, PartialEq, Eq)] -+pub enum OperationState { -+ Running = ffi::PA_OPERATION_RUNNING, -+ Done = ffi::PA_OPERATION_DONE, -+ Cancelled = ffi::PA_OPERATION_CANCELLED, -+} -+ -+impl OperationState { -+ pub fn try_from(x: ffi::pa_operation_state_t) -> Option { -+ if x >= ffi::PA_OPERATION_RUNNING && x <= ffi::PA_OPERATION_CANCELLED { -+ Some(unsafe { ::std::mem::transmute(x) }) -+ } else { -+ None -+ } -+ } -+} -+ -+impl Into for OperationState { -+ fn into(self) -> ffi::pa_operation_state_t { -+ self as ffi::pa_operation_state_t -+ } -+} -+ -+bitflags! { -+ pub flags ContextFlags: u32 { -+ const CONTEXT_FLAGS_NOAUTOSPAWN = ffi::PA_CONTEXT_NOAUTOSPAWN, -+ const CONTEXT_FLAGS_NOFAIL = ffi::PA_CONTEXT_NOFAIL, -+ } -+} -+ -+impl Into for ContextFlags { -+ fn into(self) -> ffi::pa_context_flags_t { -+ self.bits() as ffi::pa_context_flags_t -+ } -+} -+ -+#[repr(i32)] -+#[derive(Clone, Copy, Debug, PartialEq, Eq)] -+pub enum DeviceType { -+ Sink = ffi::PA_DEVICE_TYPE_SINK, -+ Source = ffi::PA_DEVICE_TYPE_SOURCE, -+} -+ -+impl DeviceType { -+ pub fn try_from(x: ffi::pa_device_type_t) -> Option { -+ if x >= ffi::PA_DEVICE_TYPE_SINK && x <= ffi::PA_DEVICE_TYPE_SOURCE { -+ Some(unsafe { ::std::mem::transmute(x) }) -+ } else { -+ None -+ } -+ } -+} -+ -+impl Into for DeviceType { -+ fn into(self) -> ffi::pa_device_type_t { -+ self as ffi::pa_device_type_t -+ } -+} -+ -+ -+#[repr(i32)] -+#[derive(Clone, Copy, Debug, PartialEq, Eq)] -+pub enum StreamDirection { -+ NoDirection = ffi::PA_STREAM_NODIRECTION, -+ Playback = ffi::PA_STREAM_PLAYBACK, -+ Record = ffi::PA_STREAM_RECORD, -+ StreamUpload = ffi::PA_STREAM_UPLOAD, -+} -+ -+impl StreamDirection { -+ pub fn try_from(x: ffi::pa_stream_direction_t) -> Option { -+ if x >= ffi::PA_STREAM_NODIRECTION && x <= ffi::PA_STREAM_UPLOAD { -+ Some(unsafe { ::std::mem::transmute(x) }) -+ } else { -+ None -+ } -+ } -+} -+ -+impl Into for StreamDirection { -+ fn into(self) -> ffi::pa_stream_direction_t { -+ self as ffi::pa_stream_direction_t -+ } -+} -+ -+bitflags! { -+ pub flags StreamFlags : u32 { -+ const STREAM_START_CORKED = ffi::PA_STREAM_START_CORKED, -+ const STREAM_INTERPOLATE_TIMING = ffi::PA_STREAM_INTERPOLATE_TIMING, -+ const STREAM_NOT_MONOTONIC = ffi::PA_STREAM_NOT_MONOTONIC, -+ const STREAM_AUTO_TIMING_UPDATE = ffi::PA_STREAM_AUTO_TIMING_UPDATE, -+ const STREAM_NO_REMAP_CHANNELS = ffi::PA_STREAM_NO_REMAP_CHANNELS, -+ const STREAM_NO_REMIX_CHANNELS = ffi::PA_STREAM_NO_REMIX_CHANNELS, -+ const STREAM_FIX_FORMAT = ffi::PA_STREAM_FIX_FORMAT, -+ const STREAM_FIX_RATE = ffi::PA_STREAM_FIX_RATE, -+ const STREAM_FIX_CHANNELS = ffi::PA_STREAM_FIX_CHANNELS, -+ const STREAM_DONT_MOVE = ffi::PA_STREAM_DONT_MOVE, -+ const STREAM_VARIABLE_RATE = ffi::PA_STREAM_VARIABLE_RATE, -+ const STREAM_PEAK_DETECT = ffi::PA_STREAM_PEAK_DETECT, -+ const STREAM_START_MUTED = ffi::PA_STREAM_START_MUTED, -+ const STREAM_ADJUST_LATENCY = ffi::PA_STREAM_ADJUST_LATENCY, -+ const STREAM_EARLY_REQUESTS = ffi::PA_STREAM_EARLY_REQUESTS, -+ const STREAM_DONT_INHIBIT_AUTO_SUSPEND = ffi::PA_STREAM_DONT_INHIBIT_AUTO_SUSPEND, -+ const STREAM_START_UNMUTED = ffi::PA_STREAM_START_UNMUTED, -+ const STREAM_FAIL_ON_SUSPEND = ffi::PA_STREAM_FAIL_ON_SUSPEND, -+ const STREAM_RELATIVE_VOLUME = ffi::PA_STREAM_RELATIVE_VOLUME, -+ const STREAM_PASSTHROUGH = ffi::PA_STREAM_PASSTHROUGH, -+ } -+} -+ -+impl StreamFlags { -+ pub fn try_from(x: ffi::pa_stream_flags_t) -> Option { -+ if (x & -+ !(ffi::PA_STREAM_NOFLAGS | ffi::PA_STREAM_START_CORKED | ffi::PA_STREAM_INTERPOLATE_TIMING | -+ ffi::PA_STREAM_NOT_MONOTONIC | ffi::PA_STREAM_AUTO_TIMING_UPDATE | -+ ffi::PA_STREAM_NO_REMAP_CHANNELS | -+ ffi::PA_STREAM_NO_REMIX_CHANNELS | ffi::PA_STREAM_FIX_FORMAT | ffi::PA_STREAM_FIX_RATE | -+ ffi::PA_STREAM_FIX_CHANNELS | -+ ffi::PA_STREAM_DONT_MOVE | ffi::PA_STREAM_VARIABLE_RATE | ffi::PA_STREAM_PEAK_DETECT | -+ ffi::PA_STREAM_START_MUTED | ffi::PA_STREAM_ADJUST_LATENCY | -+ ffi::PA_STREAM_EARLY_REQUESTS | -+ ffi::PA_STREAM_DONT_INHIBIT_AUTO_SUSPEND | -+ ffi::PA_STREAM_START_UNMUTED | ffi::PA_STREAM_FAIL_ON_SUSPEND | -+ ffi::PA_STREAM_RELATIVE_VOLUME | ffi::PA_STREAM_PASSTHROUGH)) == 0 { -+ Some(unsafe { ::std::mem::transmute(x) }) -+ } else { -+ None -+ } -+ } -+} -+ -+impl Into for StreamFlags { -+ fn into(self) -> ffi::pa_stream_flags_t { -+ self.bits() as ffi::pa_stream_flags_t -+ } -+} -+ -+bitflags!{ -+ pub flags SubscriptionMask : u32 { -+ const SUBSCRIPTION_MASK_SINK = ffi::PA_SUBSCRIPTION_MASK_SINK, -+ const SUBSCRIPTION_MASK_SOURCE = ffi::PA_SUBSCRIPTION_MASK_SOURCE, -+ const SUBSCRIPTION_MASK_SINK_INPUT = ffi::PA_SUBSCRIPTION_MASK_SINK_INPUT, -+ const SUBSCRIPTION_MASK_SOURCE_OUTPUT = ffi::PA_SUBSCRIPTION_MASK_SOURCE_OUTPUT, -+ const SUBSCRIPTION_MASK_MODULE = ffi::PA_SUBSCRIPTION_MASK_MODULE, -+ const SUBSCRIPTION_MASK_CLIENT = ffi::PA_SUBSCRIPTION_MASK_CLIENT, -+ const SUBSCRIPTION_MASK_SAMPLE_CACHE = ffi::PA_SUBSCRIPTION_MASK_SAMPLE_CACHE, -+ const SUBSCRIPTION_MASK_SERVER = ffi::PA_SUBSCRIPTION_MASK_SERVER, -+ const SUBSCRIPTION_MASK_AUTOLOAD = ffi::PA_SUBSCRIPTION_MASK_AUTOLOAD, -+ const SUBSCRIPTION_MASK_CARD = ffi::PA_SUBSCRIPTION_MASK_CARD, -+ } -+} -+ -+impl SubscriptionMask { -+ pub fn try_from(x: ffi::pa_subscription_mask_t) -> Option { -+ if (x & !ffi::PA_SUBSCRIPTION_MASK_ALL) == 0 { -+ Some(unsafe { ::std::mem::transmute(x) }) -+ } else { -+ None -+ } -+ } -+} -+ -+impl Into for SubscriptionMask { -+ fn into(self) -> ffi::pa_subscription_mask_t { -+ self.bits() as ffi::pa_subscription_mask_t -+ } -+} -+ -+#[repr(i32)] -+#[derive(Clone, Copy, Debug, PartialEq, Eq)] -+pub enum SubscriptionEventFacility { -+ Sink = ffi::PA_SUBSCRIPTION_EVENT_SINK, -+ Source = ffi::PA_SUBSCRIPTION_EVENT_SOURCE, -+ SinkInput = ffi::PA_SUBSCRIPTION_EVENT_SINK_INPUT, -+ SourceOutput = ffi::PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT, -+ Module = ffi::PA_SUBSCRIPTION_EVENT_MODULE, -+ Client = ffi::PA_SUBSCRIPTION_EVENT_CLIENT, -+ SampleCache = ffi::PA_SUBSCRIPTION_EVENT_SAMPLE_CACHE, -+ Server = ffi::PA_SUBSCRIPTION_EVENT_SERVER, -+ Autoload = ffi::PA_SUBSCRIPTION_EVENT_AUTOLOAD, -+ Card = ffi::PA_SUBSCRIPTION_EVENT_CARD, -+} -+ -+#[repr(C)] -+#[derive(Clone, Copy, Debug, PartialEq, Eq)] -+pub enum SubscriptionEventType { -+ New, -+ Change, -+ Remove, -+} -+ -+#[repr(C)] -+#[derive(Clone, Copy, Debug, PartialEq, Eq)] -+pub struct SubscriptionEvent(ffi::pa_subscription_event_type_t); -+impl SubscriptionEvent { -+ pub fn try_from(x: ffi::pa_subscription_event_type_t) -> Option { -+ if (x & !(ffi::PA_SUBSCRIPTION_EVENT_TYPE_MASK | ffi::PA_SUBSCRIPTION_EVENT_FACILITY_MASK)) == 0 { -+ Some(SubscriptionEvent(x)) -+ } else { -+ None -+ } -+ } -+ -+ pub fn event_facility(self) -> SubscriptionEventFacility { -+ unsafe { ::std::mem::transmute(self.0 & ffi::PA_SUBSCRIPTION_EVENT_FACILITY_MASK) } -+ } -+ -+ pub fn event_type(self) -> SubscriptionEventType { -+ unsafe { ::std::mem::transmute(((self.0 & ffi::PA_SUBSCRIPTION_EVENT_TYPE_MASK) >> 4)) } -+ } -+} -+ -+#[repr(i32)] -+#[derive(Clone, Copy, Debug, PartialEq, Eq)] -+pub enum SeekMode { -+ Relative = ffi::PA_SEEK_RELATIVE, -+ Absolute = ffi::PA_SEEK_ABSOLUTE, -+ RelativeOnRead = ffi::PA_SEEK_RELATIVE_ON_READ, -+ RelativeEnd = ffi::PA_SEEK_RELATIVE_END, -+} -+ -+impl SeekMode { -+ pub fn try_from(x: ffi::pa_seek_mode_t) -> Option { -+ if x >= ffi::PA_SEEK_RELATIVE && x <= ffi::PA_SEEK_RELATIVE_END { -+ Some(unsafe { ::std::mem::transmute(x) }) -+ } else { -+ None -+ } -+ } -+} -+ -+impl Into for SeekMode { -+ fn into(self) -> ffi::pa_seek_mode_t { -+ self as ffi::pa_seek_mode_t -+ } -+} -+ -+bitflags! { -+ pub flags SinkFlags: u32 { -+ const SINK_HW_VOLUME_CTRL = ffi::PA_SINK_HW_VOLUME_CTRL, -+ const SINK_LATENCY = ffi::PA_SINK_LATENCY, -+ const SINK_HARDWARE = ffi::PA_SINK_HARDWARE, -+ const SINK_NETWORK = ffi::PA_SINK_NETWORK, -+ const SINK_HW_MUTE_CTRL = ffi::PA_SINK_HW_MUTE_CTRL, -+ const SINK_DECIBEL_VOLUME = ffi::PA_SINK_DECIBEL_VOLUME, -+ const SINK_FLAT_VOLUME = ffi::PA_SINK_FLAT_VOLUME, -+ const SINK_DYNAMIC_LATENCY = ffi::PA_SINK_DYNAMIC_LATENCY, -+ const SINK_SET_FORMATS = ffi::PA_SINK_SET_FORMATS, -+ } -+} -+ -+impl SinkFlags { -+ pub fn try_from(x: ffi::pa_sink_flags_t) -> Option { -+ if (x & -+ !(ffi::PA_SOURCE_NOFLAGS | ffi::PA_SOURCE_HW_VOLUME_CTRL | ffi::PA_SOURCE_LATENCY | -+ ffi::PA_SOURCE_HARDWARE | ffi::PA_SOURCE_NETWORK | ffi::PA_SOURCE_HW_MUTE_CTRL | -+ ffi::PA_SOURCE_DECIBEL_VOLUME | -+ ffi::PA_SOURCE_DYNAMIC_LATENCY | ffi::PA_SOURCE_FLAT_VOLUME)) == 0 { -+ Some(unsafe { ::std::mem::transmute(x) }) -+ } else { -+ None -+ } -+ } -+} -+ -+#[repr(i32)] -+#[derive(Clone, Copy, Debug, PartialEq, Eq)] -+pub enum SinkState { -+ InvalidState = ffi::PA_SINK_INVALID_STATE, -+ Running = ffi::PA_SINK_RUNNING, -+ Idle = ffi::PA_SINK_IDLE, -+ Suspended = ffi::PA_SINK_SUSPENDED, -+ Init = ffi::PA_SINK_INIT, -+ Unlinked = ffi::PA_SINK_UNLINKED, -+} -+ -+bitflags!{ -+ pub flags SourceFlags: u32 { -+ const SOURCE_FLAGS_HW_VOLUME_CTRL = ffi::PA_SOURCE_HW_VOLUME_CTRL, -+ const SOURCE_FLAGS_LATENCY = ffi::PA_SOURCE_LATENCY, -+ const SOURCE_FLAGS_HARDWARE = ffi::PA_SOURCE_HARDWARE, -+ const SOURCE_FLAGS_NETWORK = ffi::PA_SOURCE_NETWORK, -+ const SOURCE_FLAGS_HW_MUTE_CTRL = ffi::PA_SOURCE_HW_MUTE_CTRL, -+ const SOURCE_FLAGS_DECIBEL_VOLUME = ffi::PA_SOURCE_DECIBEL_VOLUME, -+ const SOURCE_FLAGS_DYNAMIC_LATENCY = ffi::PA_SOURCE_DYNAMIC_LATENCY, -+ const SOURCE_FLAGS_FLAT_VOLUME = ffi::PA_SOURCE_FLAT_VOLUME, -+ } -+} -+ -+impl Into for SourceFlags { -+ fn into(self) -> ffi::pa_source_flags_t { -+ self.bits() as ffi::pa_source_flags_t -+ } -+} -+ -+#[repr(i32)] -+#[derive(Clone, Copy, Debug, PartialEq, Eq)] -+pub enum SourceState { -+ InvalidState = ffi::PA_SOURCE_INVALID_STATE, -+ Running = ffi::PA_SOURCE_RUNNING, -+ Idle = ffi::PA_SOURCE_IDLE, -+ Suspended = ffi::PA_SOURCE_SUSPENDED, -+ Init = ffi::PA_SOURCE_INIT, -+ Unlinked = ffi::PA_SOURCE_UNLINKED, -+} -+ -+#[repr(i32)] -+#[derive(Clone, Copy, Debug, PartialEq, Eq)] -+pub enum PortAvailable { -+ Unknown = ffi::PA_PORT_AVAILABLE_UNKNOWN, -+ No = ffi::PA_PORT_AVAILABLE_NO, -+ Yes = ffi::PA_PORT_AVAILABLE_YES, -+} -+ -+impl PortAvailable { -+ pub fn try_from(x: ffi::pa_port_available_t) -> Option { -+ if x >= ffi::PA_PORT_AVAILABLE_UNKNOWN && x <= ffi::PA_PORT_AVAILABLE_YES { -+ Some(unsafe { ::std::mem::transmute(x) }) -+ } else { -+ None -+ } -+ } -+} -+ -+impl Into for PortAvailable { -+ fn into(self) -> ffi::pa_port_available_t { -+ self as ffi::pa_port_available_t -+ } -+} -+ -+#[repr(i32)] -+#[derive(Clone, Copy, Debug, PartialEq, Eq)] -+pub enum ChannelPosition { -+ Invalid = ffi::PA_CHANNEL_POSITION_INVALID, -+ Mono = ffi::PA_CHANNEL_POSITION_MONO, -+ FrontLeft = ffi::PA_CHANNEL_POSITION_FRONT_LEFT, -+ FrontRight = ffi::PA_CHANNEL_POSITION_FRONT_RIGHT, -+ FrontCenter = ffi::PA_CHANNEL_POSITION_FRONT_CENTER, -+ RearCenter = ffi::PA_CHANNEL_POSITION_REAR_CENTER, -+ RearLeft = ffi::PA_CHANNEL_POSITION_REAR_LEFT, -+ RearRight = ffi::PA_CHANNEL_POSITION_REAR_RIGHT, -+ LowFreqEffects = ffi::PA_CHANNEL_POSITION_LFE, -+ FrontLeftOfCenter = ffi::PA_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER, -+ FrontRightOfCenter = ffi::PA_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER, -+ SideLeft = ffi::PA_CHANNEL_POSITION_SIDE_LEFT, -+ SideRight = ffi::PA_CHANNEL_POSITION_SIDE_RIGHT, -+ Aux0 = ffi::PA_CHANNEL_POSITION_AUX0, -+ Aux1 = ffi::PA_CHANNEL_POSITION_AUX1, -+ Aux2 = ffi::PA_CHANNEL_POSITION_AUX2, -+ Aux3 = ffi::PA_CHANNEL_POSITION_AUX3, -+ Aux4 = ffi::PA_CHANNEL_POSITION_AUX4, -+ Aux5 = ffi::PA_CHANNEL_POSITION_AUX5, -+ Aux6 = ffi::PA_CHANNEL_POSITION_AUX6, -+ Aux7 = ffi::PA_CHANNEL_POSITION_AUX7, -+ Aux8 = ffi::PA_CHANNEL_POSITION_AUX8, -+ Aux9 = ffi::PA_CHANNEL_POSITION_AUX9, -+ Aux10 = ffi::PA_CHANNEL_POSITION_AUX10, -+ Aux11 = ffi::PA_CHANNEL_POSITION_AUX11, -+ Aux12 = ffi::PA_CHANNEL_POSITION_AUX12, -+ Aux13 = ffi::PA_CHANNEL_POSITION_AUX13, -+ Aux14 = ffi::PA_CHANNEL_POSITION_AUX14, -+ Aux15 = ffi::PA_CHANNEL_POSITION_AUX15, -+ Aux16 = ffi::PA_CHANNEL_POSITION_AUX16, -+ Aux17 = ffi::PA_CHANNEL_POSITION_AUX17, -+ Aux18 = ffi::PA_CHANNEL_POSITION_AUX18, -+ Aux19 = ffi::PA_CHANNEL_POSITION_AUX19, -+ Aux20 = ffi::PA_CHANNEL_POSITION_AUX20, -+ Aux21 = ffi::PA_CHANNEL_POSITION_AUX21, -+ Aux22 = ffi::PA_CHANNEL_POSITION_AUX22, -+ Aux23 = ffi::PA_CHANNEL_POSITION_AUX23, -+ Aux24 = ffi::PA_CHANNEL_POSITION_AUX24, -+ Aux25 = ffi::PA_CHANNEL_POSITION_AUX25, -+ Aux26 = ffi::PA_CHANNEL_POSITION_AUX26, -+ Aux27 = ffi::PA_CHANNEL_POSITION_AUX27, -+ Aux28 = ffi::PA_CHANNEL_POSITION_AUX28, -+ Aux29 = ffi::PA_CHANNEL_POSITION_AUX29, -+ Aux30 = ffi::PA_CHANNEL_POSITION_AUX30, -+ Aux31 = ffi::PA_CHANNEL_POSITION_AUX31, -+ TopCenter = ffi::PA_CHANNEL_POSITION_TOP_CENTER, -+ TopFrontLeft = ffi::PA_CHANNEL_POSITION_TOP_FRONT_LEFT, -+ TopFrontRight = ffi::PA_CHANNEL_POSITION_TOP_FRONT_RIGHT, -+ TopFrontCenter = ffi::PA_CHANNEL_POSITION_TOP_FRONT_CENTER, -+ TopRearLeft = ffi::PA_CHANNEL_POSITION_TOP_REAR_LEFT, -+ TopRearRight = ffi::PA_CHANNEL_POSITION_TOP_REAR_RIGHT, -+ TopRearCenter = ffi::PA_CHANNEL_POSITION_TOP_REAR_CENTER, -+} -+ -+impl ChannelPosition { -+ pub fn try_from(x: ffi::pa_channel_position_t) -> Option { -+ if x >= ffi::PA_CHANNEL_POSITION_INVALID && x < ffi::PA_CHANNEL_POSITION_MAX { -+ Some(unsafe { ::std::mem::transmute(x) }) -+ } else { -+ None -+ } -+ } -+} -+ -+impl Default for ChannelPosition { -+ fn default() -> Self { -+ ChannelPosition::Invalid -+ } -+} -+ -+impl Into for ChannelPosition { -+ fn into(self) -> ffi::pa_channel_position_t { -+ self as ffi::pa_channel_position_t -+ } -+} -+pub type Result = ::std::result::Result; -+ -+pub trait CVolumeExt { -+ fn set(&mut self, channels: c_uint, v: Volume); -+ fn set_balance(&mut self, map: &ChannelMap, new_balance: f32); -+} -+ -+impl CVolumeExt for CVolume { -+ fn set(&mut self, channels: c_uint, v: Volume) { -+ unsafe { -+ ffi::pa_cvolume_set(self, channels, v); -+ } -+ } -+ -+ fn set_balance(&mut self, map: &ChannelMap, new_balance: f32) { -+ unsafe { -+ ffi::pa_cvolume_set_balance(self, map, new_balance); -+ } -+ } -+} -+ -+pub trait ChannelMapExt { -+ fn init() -> ChannelMap; -+ fn can_balance(&self) -> bool; -+} -+ -+impl ChannelMapExt for ChannelMap { -+ fn init() -> ChannelMap { -+ let mut cm = ChannelMap::default(); -+ unsafe { -+ ffi::pa_channel_map_init(&mut cm); -+ } -+ cm -+ } -+ fn can_balance(&self) -> bool { -+ unsafe { ffi::pa_channel_map_can_balance(self) > 0 } -+ } -+} -+ -+pub trait ProplistExt { -+ fn proplist(&self) -> Proplist; -+} -+ -+impl ProplistExt for SinkInfo { -+ fn proplist(&self) -> Proplist { -+ unsafe { proplist::from_raw_ptr(self.proplist) } -+ } -+} -+ -+impl ProplistExt for SourceInfo { -+ fn proplist(&self) -> Proplist { -+ unsafe { proplist::from_raw_ptr(self.proplist) } -+ } -+} -+ -+pub trait SampleSpecExt { -+ fn frame_size(&self) -> usize; -+} -+ -+impl SampleSpecExt for SampleSpec { -+ fn frame_size(&self) -> usize { -+ unsafe { ffi::pa_frame_size(self) } -+ } -+} -+ -+pub trait USecExt { -+ fn to_bytes(self, spec: &SampleSpec) -> usize; -+} -+ -+impl USecExt for USec { -+ fn to_bytes(self, spec: &SampleSpec) -> usize { -+ unsafe { ffi::pa_usec_to_bytes(self, spec) } -+ } -+} -+ -+pub fn library_version() -> *const c_char { -+ unsafe { ffi::pa_get_library_version() } -+} -+ -+pub fn sw_volume_from_linear(vol: f64) -> Volume { -+ unsafe { ffi::pa_sw_volume_from_linear(vol) } -+} -+ -+pub fn rtclock_now() -> USec { -+ unsafe { ffi::pa_rtclock_now() } -+} -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/mainloop_api.rs.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/mainloop_api.rs ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/mainloop_api.rs.cubeb-pulse-arm 2017-08-04 13:37:46.385821734 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/mainloop_api.rs 2017-08-04 13:37:46.385821734 +0200 -@@ -0,0 +1,58 @@ -+// Copyright © 2017 Mozilla Foundation -+// -+// This program is made available under an ISC-style license. See the -+// accompanying file LICENSE for details. -+ -+use ffi; -+use std::mem; -+use std::os::raw::c_void; -+ -+ -+#[allow(non_camel_case_types)] -+type pa_once_cb_t = Option; -+fn wrap_once_cb(_: F) -> pa_once_cb_t -+ where F: Fn(&MainloopApi, *mut c_void) -+{ -+ assert!(mem::size_of::() == 0); -+ -+ unsafe extern "C" fn wrapped(m: *mut ffi::pa_mainloop_api, userdata: *mut c_void) -+ where F: Fn(&MainloopApi, *mut c_void) -+ { -+ let api = from_raw_ptr(m); -+ let result = mem::transmute::<_, &F>(&())(&api, userdata); -+ mem::forget(api); -+ result -+ } -+ -+ Some(wrapped::) -+} -+ -+pub struct MainloopApi(*mut ffi::pa_mainloop_api); -+ -+impl MainloopApi { -+ pub fn raw_mut(&self) -> &mut ffi::pa_mainloop_api { -+ unsafe { &mut *self.0 } -+ } -+ -+ pub fn once(&self, cb: CB, userdata: *mut c_void) -+ where CB: Fn(&MainloopApi, *mut c_void) -+ { -+ let wrapped = wrap_once_cb(cb); -+ unsafe { -+ ffi::pa_mainloop_api_once(self.raw_mut(), wrapped, userdata); -+ } -+ } -+ -+ pub fn time_free(&self, e: *mut ffi::pa_time_event) { -+ unsafe { -+ if let Some(f) = self.raw_mut().time_free { -+ f(e); -+ } -+ } -+ } -+} -+ -+pub unsafe fn from_raw_ptr(raw: *mut ffi::pa_mainloop_api) -> MainloopApi { -+ MainloopApi(raw) -+} -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/operation.rs.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/operation.rs ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/operation.rs.cubeb-pulse-arm 2017-08-04 13:37:46.385821734 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/operation.rs 2017-08-04 13:37:46.385821734 +0200 -@@ -0,0 +1,43 @@ -+// Copyright © 2017 Mozilla Foundation -+// -+// This program is made available under an ISC-style license. See the -+// accompanying file LICENSE for details. -+ -+use ffi; -+ -+#[derive(Debug)] -+pub struct Operation(*mut ffi::pa_operation); -+ -+impl Operation { -+ pub unsafe fn from_raw_ptr(raw: *mut ffi::pa_operation) -> Operation { -+ Operation(raw) -+ } -+ -+ pub fn cancel(&mut self) { -+ unsafe { -+ ffi::pa_operation_cancel(self.0); -+ } -+ } -+ -+ pub fn get_state(&self) -> ffi::pa_operation_state_t { -+ unsafe { ffi::pa_operation_get_state(self.0) } -+ } -+} -+ -+impl Clone for Operation { -+ fn clone(&self) -> Self { -+ Operation(unsafe { ffi::pa_operation_ref(self.0) }) -+ } -+} -+ -+impl Drop for Operation { -+ fn drop(&mut self) { -+ unsafe { -+ ffi::pa_operation_unref(self.0); -+ } -+ } -+} -+ -+pub unsafe fn from_raw_ptr(raw: *mut ffi::pa_operation) -> Operation { -+ Operation::from_raw_ptr(raw) -+} -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/proplist.rs.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/proplist.rs ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/proplist.rs.cubeb-pulse-arm 2017-08-04 13:37:46.385821734 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/proplist.rs 2017-08-04 13:37:46.385821734 +0200 -@@ -0,0 +1,31 @@ -+// Copyright © 2017 Mozilla Foundation -+// -+// This program is made available under an ISC-style license. See the -+// accompanying file LICENSE for details. -+ -+use ffi; -+use std::ffi::{CStr, CString}; -+ -+#[derive(Debug)] -+pub struct Proplist(*mut ffi::pa_proplist); -+ -+impl Proplist { -+ pub fn gets(&self, key: T) -> Option<&CStr> -+ where T: Into> -+ { -+ let key = match CString::new(key) { -+ Ok(k) => k, -+ _ => return None, -+ }; -+ let r = unsafe { ffi::pa_proplist_gets(self.0, key.as_ptr()) }; -+ if r.is_null() { -+ None -+ } else { -+ Some(unsafe { CStr::from_ptr(r) }) -+ } -+ } -+} -+ -+pub unsafe fn from_raw_ptr(raw: *mut ffi::pa_proplist) -> Proplist { -+ return Proplist(raw); -+} -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/stream.rs.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/stream.rs ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/stream.rs.cubeb-pulse-arm 2017-08-04 13:37:46.386821731 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/stream.rs 2017-08-04 13:37:46.386821731 +0200 -@@ -0,0 +1,367 @@ -+// Copyright © 2017 Mozilla Foundation -+// -+// This program is made available under an ISC-style license. See the -+// accompanying file LICENSE for details. -+ -+use ::*; -+use context; -+use ffi; -+use operation; -+use std::ffi::CStr; -+use std::mem; -+use std::os::raw::{c_int, c_void}; -+use std::ptr; -+use util::*; -+ -+#[derive(Debug)] -+pub struct Stream(*mut ffi::pa_stream); -+ -+impl Stream { -+ pub fn new<'a, CM>(c: &Context, name: &::std::ffi::CStr, ss: &SampleSpec, map: CM) -> Option -+ where CM: Into> -+ { -+ let ptr = unsafe { -+ ffi::pa_stream_new(c.raw_mut(), -+ name.as_ptr(), -+ ss as *const _, -+ to_ptr(map.into())) -+ }; -+ if ptr.is_null() { -+ None -+ } else { -+ Some(Stream(ptr)) -+ } -+ } -+ -+ #[doc(hidden)] -+ pub fn raw_mut(&self) -> &mut ffi::pa_stream { -+ unsafe { &mut *self.0 } -+ } -+ -+ pub fn unref(self) { -+ unsafe { -+ ffi::pa_stream_unref(self.raw_mut()); -+ } -+ } -+ -+ pub fn get_state(&self) -> StreamState { -+ StreamState::try_from(unsafe { -+ ffi::pa_stream_get_state(self.raw_mut()) -+ }).expect("pa_stream_get_state returned invalid StreamState") -+ } -+ -+ pub fn get_context(&self) -> Option { -+ let ptr = unsafe { ffi::pa_stream_get_context(self.raw_mut()) }; -+ if ptr.is_null() { -+ return None; -+ } -+ -+ let ctx = unsafe { context::from_raw_ptr(ptr) }; -+ Some(ctx) -+ } -+ -+ pub fn get_index(&self) -> u32 { -+ unsafe { ffi::pa_stream_get_index(self.raw_mut()) } -+ } -+ -+ pub fn get_device_name<'a>(&'a self) -> Result<&'a CStr> { -+ let r = unsafe { ffi::pa_stream_get_device_name(self.raw_mut()) }; -+ if r.is_null() { -+ let err = if let Some(c) = self.get_context() { -+ c.errno() -+ } else { -+ ffi::PA_ERR_UNKNOWN -+ }; -+ return Err(ErrorCode::from_error_code(err)); -+ } -+ Ok(unsafe { CStr::from_ptr(r) }) -+ } -+ -+ pub fn is_suspended(&self) -> Result { -+ let r = unsafe { ffi::pa_stream_is_suspended(self.raw_mut()) }; -+ error_result!(r != 0, r) -+ } -+ -+ pub fn is_corked(&self) -> Result { -+ let r = unsafe { ffi::pa_stream_is_corked(self.raw_mut()) }; -+ error_result!(r != 0, r) -+ } -+ -+ pub fn connect_playback<'a, D, A, V, S>(&self, -+ dev: D, -+ attr: A, -+ flags: StreamFlags, -+ volume: V, -+ sync_stream: S) -+ -> Result<()> -+ where D: Into>, -+ A: Into>, -+ V: Into>, -+ S: Into> -+ { -+ let r = unsafe { -+ ffi::pa_stream_connect_playback(self.raw_mut(), -+ str_to_ptr(dev.into()), -+ to_ptr(attr.into()), -+ flags.into(), -+ to_ptr(volume.into()), -+ map_to_mut_ptr(sync_stream.into(), |p| p.0)) -+ }; -+ error_result!((), r) -+ } -+ -+ pub fn connect_record<'a, D, A>(&self, dev: D, attr: A, flags: StreamFlags) -> Result<()> -+ where D: Into>, -+ A: Into> -+ { -+ let r = unsafe { -+ ffi::pa_stream_connect_record(self.raw_mut(), -+ str_to_ptr(dev.into()), -+ to_ptr(attr.into()), -+ flags.into()) -+ }; -+ error_result!((), r) -+ } -+ -+ pub fn disconnect(&self) -> Result<()> { -+ let r = unsafe { ffi::pa_stream_disconnect(self.raw_mut()) }; -+ error_result!((), r) -+ } -+ -+ pub fn begin_write(&self, req_bytes: usize) -> Result<(*mut c_void, usize)> { -+ let mut data: *mut c_void = ptr::null_mut(); -+ let mut nbytes = req_bytes; -+ let r = unsafe { ffi::pa_stream_begin_write(self.raw_mut(), &mut data, &mut nbytes) }; -+ error_result!((data, nbytes), r) -+ } -+ -+ pub fn cancel_write(&self) -> Result<()> { -+ let r = unsafe { ffi::pa_stream_cancel_write(self.raw_mut()) }; -+ error_result!((), r) -+ } -+ -+ pub fn write(&self, data: *const c_void, nbytes: usize, offset: i64, seek: SeekMode) -> Result<()> { -+ let r = unsafe { ffi::pa_stream_write(self.raw_mut(), data, nbytes, None, offset, seek.into()) }; -+ error_result!((), r) -+ } -+ -+ pub unsafe fn peek(&self, data: *mut *const c_void, length: *mut usize) -> Result<()> { -+ let r = ffi::pa_stream_peek(self.raw_mut(), data, length); -+ error_result!((), r) -+ } -+ -+ pub fn drop(&self) -> Result<()> { -+ let r = unsafe { ffi::pa_stream_drop(self.raw_mut()) }; -+ error_result!((), r) -+ } -+ -+ pub fn writable_size(&self) -> Result { -+ let r = unsafe { ffi::pa_stream_writable_size(self.raw_mut()) }; -+ if r == ::std::usize::MAX { -+ let err = if let Some(c) = self.get_context() { -+ c.errno() -+ } else { -+ ffi::PA_ERR_UNKNOWN -+ }; -+ return Err(ErrorCode::from_error_code(err)); -+ } -+ Ok(r) -+ } -+ -+ pub fn readable_size(&self) -> Result { -+ let r = unsafe { ffi::pa_stream_readable_size(self.raw_mut()) }; -+ if r == ::std::usize::MAX { -+ let err = if let Some(c) = self.get_context() { -+ c.errno() -+ } else { -+ ffi::PA_ERR_UNKNOWN -+ }; -+ return Err(ErrorCode::from_error_code(err)); -+ } -+ Ok(r) -+ } -+ -+ pub fn update_timing_info(&self, _: CB, userdata: *mut c_void) -> Result -+ where CB: Fn(&Stream, i32, *mut c_void) -+ { -+ debug_assert_eq!(mem::size_of::(), 0); -+ -+ // See: A note about `wrapped` functions -+ unsafe extern "C" fn wrapped(s: *mut ffi::pa_stream, success: c_int, userdata: *mut c_void) -+ where F: Fn(&Stream, i32, *mut c_void) -+ { -+ use std::mem::{forget, uninitialized}; -+ let mut stm = stream::from_raw_ptr(s); -+ let result = uninitialized::()(&mut stm, success, userdata); -+ forget(stm); -+ -+ result -+ } -+ -+ let r = unsafe { ffi::pa_stream_update_timing_info(self.raw_mut(), Some(wrapped::), userdata) }; -+ if r.is_null() { -+ let err = if let Some(c) = self.get_context() { -+ c.errno() -+ } else { -+ ffi::PA_ERR_UNKNOWN -+ }; -+ return Err(ErrorCode::from_error_code(err)); -+ } -+ Ok(unsafe { operation::from_raw_ptr(r) }) -+ } -+ -+ pub fn clear_state_callback(&self) { -+ unsafe { -+ ffi::pa_stream_set_state_callback(self.raw_mut(), None, ptr::null_mut()); -+ } -+ } -+ -+ pub fn set_state_callback(&self, _: CB, userdata: *mut c_void) -+ where CB: Fn(&Stream, *mut c_void) -+ { -+ debug_assert_eq!(mem::size_of::(), 0); -+ -+ // See: A note about `wrapped` functions -+ unsafe extern "C" fn wrapped(s: *mut ffi::pa_stream, userdata: *mut c_void) -+ where F: Fn(&Stream, *mut c_void) -+ { -+ use std::mem::{forget, uninitialized}; -+ let mut stm = stream::from_raw_ptr(s); -+ let result = uninitialized::()(&mut stm, userdata); -+ forget(stm); -+ -+ result -+ } -+ -+ unsafe { -+ ffi::pa_stream_set_state_callback(self.raw_mut(), Some(wrapped::), userdata); -+ } -+ } -+ -+ pub fn clear_write_callback(&self) { -+ unsafe { -+ ffi::pa_stream_set_write_callback(self.raw_mut(), None, ptr::null_mut()); -+ } -+ } -+ -+ pub fn set_write_callback(&self, _: CB, userdata: *mut c_void) -+ where CB: Fn(&Stream, usize, *mut c_void) -+ { -+ debug_assert_eq!(mem::size_of::(), 0); -+ -+ // See: A note about `wrapped` functions -+ unsafe extern "C" fn wrapped(s: *mut ffi::pa_stream, nbytes: usize, userdata: *mut c_void) -+ where F: Fn(&Stream, usize, *mut c_void) -+ { -+ use std::mem::{forget, uninitialized}; -+ let mut stm = stream::from_raw_ptr(s); -+ let result = uninitialized::()(&mut stm, nbytes, userdata); -+ forget(stm); -+ -+ result -+ } -+ -+ unsafe { -+ ffi::pa_stream_set_write_callback(self.raw_mut(), Some(wrapped::), userdata); -+ } -+ } -+ -+ pub fn clear_read_callback(&self) { -+ unsafe { -+ ffi::pa_stream_set_read_callback(self.raw_mut(), None, ptr::null_mut()); -+ } -+ } -+ -+ pub fn set_read_callback(&self, _: CB, userdata: *mut c_void) -+ where CB: Fn(&Stream, usize, *mut c_void) -+ { -+ debug_assert_eq!(mem::size_of::(), 0); -+ -+ // See: A note about `wrapped` functions -+ unsafe extern "C" fn wrapped(s: *mut ffi::pa_stream, nbytes: usize, userdata: *mut c_void) -+ where F: Fn(&Stream, usize, *mut c_void) -+ { -+ use std::mem::{forget, uninitialized}; -+ let mut stm = stream::from_raw_ptr(s); -+ let result = uninitialized::()(&mut stm, nbytes, userdata); -+ forget(stm); -+ -+ result -+ } -+ -+ unsafe { -+ ffi::pa_stream_set_read_callback(self.raw_mut(), Some(wrapped::), userdata); -+ } -+ } -+ -+ pub fn cork(&self, b: i32, _: CB, userdata: *mut c_void) -> Result -+ where CB: Fn(&Stream, i32, *mut c_void) -+ { -+ debug_assert_eq!(mem::size_of::(), 0); -+ -+ // See: A note about `wrapped` functions -+ unsafe extern "C" fn wrapped(s: *mut ffi::pa_stream, success: c_int, userdata: *mut c_void) -+ where F: Fn(&Stream, i32, *mut c_void) -+ { -+ use std::mem::{forget, uninitialized}; -+ let mut stm = stream::from_raw_ptr(s); -+ let result = uninitialized::()(&mut stm, success, userdata); -+ forget(stm); -+ -+ result -+ } -+ -+ let r = unsafe { ffi::pa_stream_cork(self.raw_mut(), b, Some(wrapped::), userdata) }; -+ if r.is_null() { -+ let err = if let Some(c) = self.get_context() { -+ c.errno() -+ } else { -+ ffi::PA_ERR_UNKNOWN -+ }; -+ return Err(ErrorCode::from_error_code(err)); -+ } -+ Ok(unsafe { operation::from_raw_ptr(r) }) -+ } -+ -+ pub fn get_time(&self) -> Result<(u64)> { -+ let mut usec: u64 = 0; -+ let r = unsafe { ffi::pa_stream_get_time(self.raw_mut(), &mut usec) }; -+ error_result!(usec, r) -+ } -+ -+ pub fn get_latency(&self) -> Result<(u64, bool)> { -+ let mut usec: u64 = 0; -+ let mut negative: i32 = 0; -+ let r = unsafe { ffi::pa_stream_get_latency(self.raw_mut(), &mut usec, &mut negative) }; -+ error_result!((usec, negative != 0), r) -+ } -+ -+ pub fn get_sample_spec(&self) -> &SampleSpec { -+ unsafe { -+ let ptr = ffi::pa_stream_get_sample_spec(self.raw_mut()); -+ debug_assert!(!ptr.is_null()); -+ &*ptr -+ } -+ } -+ -+ pub fn get_channel_map(&self) -> &ChannelMap { -+ unsafe { -+ let ptr = ffi::pa_stream_get_channel_map(self.raw_mut()); -+ debug_assert!(!ptr.is_null()); -+ &*ptr -+ } -+ } -+ -+ pub fn get_buffer_attr(&self) -> &BufferAttr { -+ unsafe { -+ let ptr = ffi::pa_stream_get_buffer_attr(self.raw_mut()); -+ debug_assert!(!ptr.is_null()); -+ &*ptr -+ } -+ } -+} -+ -+#[doc(hidden)] -+pub unsafe fn from_raw_ptr(ptr: *mut ffi::pa_stream) -> Stream { -+ Stream(ptr) -+} -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/threaded_mainloop.rs.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/threaded_mainloop.rs ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/threaded_mainloop.rs.cubeb-pulse-arm 2017-08-04 13:37:46.386821731 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/threaded_mainloop.rs 2017-08-04 13:37:46.386821731 +0200 -@@ -0,0 +1,92 @@ -+// Copyright © 2017 Mozilla Foundation -+// -+// This program is made available under an ISC-style license. See the -+// accompanying file LICENSE for details. -+ -+use ErrorCode; -+use Result; -+use ffi; -+use mainloop_api; -+use mainloop_api::MainloopApi; -+ -+#[derive(Debug)] -+pub struct ThreadedMainloop(*mut ffi::pa_threaded_mainloop); -+ -+impl ThreadedMainloop { -+ pub unsafe fn from_raw_ptr(raw: *mut ffi::pa_threaded_mainloop) -> Self { -+ ThreadedMainloop(raw) -+ } -+ -+ pub fn new() -> Self { -+ unsafe { ThreadedMainloop::from_raw_ptr(ffi::pa_threaded_mainloop_new()) } -+ } -+ -+ pub fn raw_mut(&self) -> &mut ffi::pa_threaded_mainloop { -+ unsafe { &mut *self.0 } -+ } -+ -+ pub fn is_null(&self) -> bool { -+ self.0.is_null() -+ } -+ -+ pub fn start(&self) -> Result<()> { -+ match unsafe { ffi::pa_threaded_mainloop_start(self.raw_mut()) } { -+ 0 => Ok(()), -+ _ => Err(ErrorCode::from_error_code(ffi::PA_ERR_UNKNOWN)), -+ } -+ } -+ -+ pub fn stop(&self) { -+ unsafe { -+ ffi::pa_threaded_mainloop_stop(self.raw_mut()); -+ } -+ } -+ -+ pub fn lock(&self) { -+ unsafe { -+ ffi::pa_threaded_mainloop_lock(self.raw_mut()); -+ } -+ } -+ -+ pub fn unlock(&self) { -+ unsafe { -+ ffi::pa_threaded_mainloop_unlock(self.raw_mut()); -+ } -+ } -+ -+ pub fn wait(&self) { -+ unsafe { -+ ffi::pa_threaded_mainloop_wait(self.raw_mut()); -+ } -+ } -+ -+ pub fn signal(&self) { -+ unsafe { -+ ffi::pa_threaded_mainloop_signal(self.raw_mut(), 0); -+ } -+ } -+ -+ pub fn get_api(&self) -> MainloopApi { -+ unsafe { mainloop_api::from_raw_ptr(ffi::pa_threaded_mainloop_get_api(self.raw_mut())) } -+ } -+ -+ pub fn in_thread(&self) -> bool { -+ unsafe { ffi::pa_threaded_mainloop_in_thread(self.raw_mut()) != 0 } -+ } -+} -+ -+impl ::std::default::Default for ThreadedMainloop { -+ fn default() -> Self { -+ ThreadedMainloop(::std::ptr::null_mut()) -+ } -+} -+ -+impl ::std::ops::Drop for ThreadedMainloop { -+ fn drop(&mut self) { -+ if !self.is_null() { -+ unsafe { -+ ffi::pa_threaded_mainloop_free(self.raw_mut()); -+ } -+ } -+ } -+} -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/util.rs.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/util.rs ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/util.rs.cubeb-pulse-arm 2017-08-04 13:37:46.386821731 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/pulse-rs/src/util.rs 2017-08-04 13:37:46.386821731 +0200 -@@ -0,0 +1,41 @@ -+// Copyright © 2017 Mozilla Foundation -+// -+// This program is made available under an ISC-style license. See the -+// accompanying file LICENSE for details. -+ -+use std::ffi::CStr; -+use std::os::raw::c_char; -+use std::ptr; -+ -+pub trait UnwrapCStr { -+ fn unwrap_cstr(self) -> *const c_char; -+} -+ -+impl<'a, U> UnwrapCStr for U -+ where U: Into> -+{ -+ fn unwrap_cstr(self) -> *const c_char { -+ self.into().map(|o| o.as_ptr()).unwrap_or(0 as *const _) -+ } -+} -+ -+pub fn map_to_mut_ptr *mut U>(t: Option<&mut T>, f: F) -> *mut U { -+ match t { -+ Some(x) => f(x), -+ None => ptr::null_mut(), -+ } -+} -+ -+pub fn str_to_ptr(s: Option<&CStr>) -> *const c_char { -+ match s { -+ Some(x) => x.as_ptr(), -+ None => ptr::null(), -+ } -+} -+ -+pub fn to_ptr(t: Option<&T>) -> *const T { -+ match t { -+ Some(x) => x as *const T, -+ None => ptr::null(), -+ } -+} -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/README.md.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/README.md ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/README.md.cubeb-pulse-arm 2017-07-31 18:20:49.000000000 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/README.md 2017-08-04 13:37:46.383821740 +0200 -@@ -3,3 +3,4 @@ - Implementation of PulseAudio backend for Cubeb written in Rust. - - [![Travis Build Status](https://travis-ci.org/djg/cubeb-pulse-rs.svg?branch=master)](https://travis-ci.org/djg/cubeb-pulse-rs) -+[![Travis Build Status](https://travis-ci.org/djg/cubeb-pulse-rs.svg?branch=dev)](https://travis-ci.org/djg/cubeb-pulse-rs) -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/README_MOZILLA.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/README_MOZILLA ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/README_MOZILLA.cubeb-pulse-arm 2017-07-31 18:20:49.000000000 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/README_MOZILLA 2017-08-04 13:37:46.383821740 +0200 -@@ -5,4 +5,4 @@ Makefile.in build files for the Mozilla - - The cubeb-pulse-rs git repository is: https://github.com/djg/cubeb-pulse-rs.git - --The git commit ID used was dbcd7f96aea8d249a4b78f9a7597768c9dff22eb (2017-04-25 11:42:10 +1000) -+The git commit ID used was 64515819cdf54a16626df5dce5f5c7cb1220d53b (2017-06-19 17:41:30 +1000) -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/src/backend/context.rs.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/src/backend/context.rs ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/src/backend/context.rs.cubeb-pulse-arm 2017-07-31 18:20:49.000000000 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/src/backend/context.rs 2017-08-04 13:50:38.145480458 +0200 -@@ -4,67 +4,60 @@ - // accompanying file LICENSE for details. - - use backend::*; --use backend::cork_state::CorkState; - use capi::PULSE_OPS; - use cubeb; -+use pulse::{self, ProplistExt}; - use pulse_ffi::*; - use semver; - use std::default::Default; --use std::ffi::CStr; -+use std::ffi::{CStr, CString}; - use std::mem; --use std::os::raw::{c_char, c_int, c_void}; -+use std::os::raw::{c_char, c_void}; - use std::ptr; - --macro_rules! dup_str { -- ($Dst: expr, $Src: expr) => { -- if !$Dst.is_null() { -- pa_xfree($Dst as *mut _); -- } -- -- $Dst = pa_xstrdup($Src); -- } --} -- --fn pa_channel_to_cubeb_channel(channel: pa_channel_position_t) -> cubeb::Channel { -- assert_ne!(channel, PA_CHANNEL_POSITION_INVALID); -+fn pa_channel_to_cubeb_channel(channel: pulse::ChannelPosition) -> cubeb::Channel { -+ use pulse::ChannelPosition; -+ assert_ne!(channel, ChannelPosition::Invalid); - match channel { -- PA_CHANNEL_POSITION_MONO => cubeb::CHANNEL_MONO, -- PA_CHANNEL_POSITION_FRONT_LEFT => cubeb::CHANNEL_LEFT, -- PA_CHANNEL_POSITION_FRONT_RIGHT => cubeb::CHANNEL_RIGHT, -- PA_CHANNEL_POSITION_FRONT_CENTER => cubeb::CHANNEL_CENTER, -- PA_CHANNEL_POSITION_SIDE_LEFT => cubeb::CHANNEL_LS, -- PA_CHANNEL_POSITION_SIDE_RIGHT => cubeb::CHANNEL_RS, -- PA_CHANNEL_POSITION_REAR_LEFT => cubeb::CHANNEL_RLS, -- PA_CHANNEL_POSITION_REAR_CENTER => cubeb::CHANNEL_RCENTER, -- PA_CHANNEL_POSITION_REAR_RIGHT => cubeb::CHANNEL_RRS, -- PA_CHANNEL_POSITION_LFE => cubeb::CHANNEL_LFE, -+ ChannelPosition::Mono => cubeb::CHANNEL_MONO, -+ ChannelPosition::FrontLeft => cubeb::CHANNEL_LEFT, -+ ChannelPosition::FrontRight => cubeb::CHANNEL_RIGHT, -+ ChannelPosition::FrontCenter => cubeb::CHANNEL_CENTER, -+ ChannelPosition::SideLeft => cubeb::CHANNEL_LS, -+ ChannelPosition::SideRight => cubeb::CHANNEL_RS, -+ ChannelPosition::RearLeft => cubeb::CHANNEL_RLS, -+ ChannelPosition::RearCenter => cubeb::CHANNEL_RCENTER, -+ ChannelPosition::RearRight => cubeb::CHANNEL_RRS, -+ ChannelPosition::LowFreqEffects => cubeb::CHANNEL_LFE, - _ => cubeb::CHANNEL_INVALID, - } - } - --fn channel_map_to_layout(cm: &pa_channel_map) -> cubeb::ChannelLayout { -+fn channel_map_to_layout(cm: &pulse::ChannelMap) -> cubeb::ChannelLayout { -+ use pulse::ChannelPosition; - let mut cubeb_map: cubeb::ChannelMap = Default::default(); - cubeb_map.channels = cm.channels as u32; - for i in 0usize..cm.channels as usize { -- cubeb_map.map[i] = pa_channel_to_cubeb_channel(cm.map[i]); -+ cubeb_map.map[i] = pa_channel_to_cubeb_channel(ChannelPosition::try_from(cm.map[i]) -+ .unwrap_or(ChannelPosition::Invalid)); - } - unsafe { cubeb::cubeb_channel_map_to_layout(&cubeb_map) } - } - - #[derive(Debug)] - pub struct DefaultInfo { -- pub sample_spec: pa_sample_spec, -- pub channel_map: pa_channel_map, -- pub flags: pa_sink_flags_t, -+ pub sample_spec: pulse::SampleSpec, -+ pub channel_map: pulse::ChannelMap, -+ pub flags: pulse::SinkFlags, - } - - #[derive(Debug)] - pub struct Context { - pub ops: *const cubeb::Ops, -- pub mainloop: *mut pa_threaded_mainloop, -- pub context: *mut pa_context, -+ pub mainloop: pulse::ThreadedMainloop, -+ pub context: Option, - pub default_sink_info: Option, -- pub context_name: *const c_char, -+ pub context_name: Option, - pub collection_changed_callback: cubeb::DeviceCollectionChangedCallback, - pub collection_changed_user_ptr: *mut c_void, - pub error: bool, -@@ -82,7 +75,7 @@ impl Drop for Context { - - impl Context { - #[cfg(feature = "pulse-dlopen")] -- fn _new(name: *const i8) -> Result> { -+ fn _new(name: Option) -> Result> { - let libpulse = unsafe { open() }; - if libpulse.is_none() { - return Err(cubeb::ERROR); -@@ -91,12 +84,12 @@ impl Context { - let ctx = Box::new(Context { - ops: &PULSE_OPS, - libpulse: libpulse.unwrap(), -- mainloop: unsafe { pa_threaded_mainloop_new() }, -- context: 0 as *mut _, -+ mainloop: pulse::ThreadedMainloop::new(), -+ context: None, - default_sink_info: None, - context_name: name, - collection_changed_callback: None, -- collection_changed_user_ptr: 0 as *mut _, -+ collection_changed_user_ptr: ptr::null_mut(), - error: true, - version_0_9_8: false, - version_2_0_0: false, -@@ -106,15 +99,15 @@ impl Context { - } - - #[cfg(not(feature = "pulse-dlopen"))] -- fn _new(name: *const i8) -> Result> { -+ fn _new(name: Option) -> Result> { - Ok(Box::new(Context { - ops: &PULSE_OPS, -- mainloop: unsafe { pa_threaded_mainloop_new() }, -- context: 0 as *mut _, -+ mainloop: pulse::ThreadedMainloop::new(), -+ context: None, - default_sink_info: None, - context_name: name, - collection_changed_callback: None, -- collection_changed_user_ptr: 0 as *mut _, -+ collection_changed_user_ptr: ptr::null_mut(), - error: true, - version_0_9_8: false, - version_2_0_0: false, -@@ -122,53 +115,66 @@ impl Context { - } - - pub fn new(name: *const c_char) -> Result> { -+ fn server_info_cb(context: &pulse::Context, info: &pulse::ServerInfo, u: *mut c_void) { -+ fn sink_info_cb(_: &pulse::Context, i: *const pulse::SinkInfo, eol: i32, u: *mut c_void) { -+ let mut ctx = unsafe { &mut *(u as *mut Context) }; -+ if eol == 0 { -+ let info = unsafe { &*i }; -+ let flags = pulse::SinkFlags::try_from(info.flags).expect("SinkInfo contains invalid flags"); -+ ctx.default_sink_info = Some(DefaultInfo { -+ sample_spec: info.sample_spec, -+ channel_map: info.channel_map, -+ flags: flags, -+ }); -+ } -+ ctx.mainloop.signal(); -+ } -+ -+ let _ = context.get_sink_info_by_name(unsafe { CStr::from_ptr(info.default_sink_name) }, -+ sink_info_cb, -+ u); -+ } -+ -+ let name = super::try_cstr_from(name).map(|s| s.to_owned()); - let mut ctx = try!(Context::_new(name)); - -- unsafe { pa_threaded_mainloop_start(ctx.mainloop) }; -+ if ctx.mainloop.start().is_err() { -+ ctx.destroy(); -+ return Err(cubeb::ERROR); -+ } - -- if ctx.pulse_context_init() != cubeb::OK { -+ if ctx.context_init() != cubeb::OK { - ctx.destroy(); - return Err(cubeb::ERROR); - } - -- unsafe { -- /* server_info_callback performs a second async query, -- * which is responsible for initializing default_sink_info -- * and signalling the mainloop to end the wait. */ -- pa_threaded_mainloop_lock(ctx.mainloop); -- let o = pa_context_get_server_info(ctx.context, -- Some(server_info_callback), -- ctx.as_mut() as *mut Context as *mut _); -- if !o.is_null() { -- ctx.operation_wait(ptr::null_mut(), o); -- pa_operation_unref(o); -+ ctx.mainloop.lock(); -+ /* server_info_callback performs a second async query, -+ * which is responsible for initializing default_sink_info -+ * and signalling the mainloop to end the wait. */ -+ let user_data: *mut c_void = ctx.as_mut() as *mut _ as *mut _; -+ if let Some(ref context) = ctx.context { -+ if let Ok(o) = context.get_server_info(server_info_cb, user_data) { -+ ctx.operation_wait(None, &o); - } -- pa_threaded_mainloop_unlock(ctx.mainloop); -- assert!(ctx.default_sink_info.is_some()); - } -+ assert!(ctx.default_sink_info.is_some()); -+ ctx.mainloop.unlock(); - - // Return the result. - Ok(ctx) - } - - pub fn destroy(&mut self) { -- if !self.context.is_null() { -- unsafe { self.pulse_context_destroy() }; -- } -- assert!(self.context.is_null()); -+ self.context_destroy(); - - if !self.mainloop.is_null() { -- unsafe { -- pa_threaded_mainloop_stop(self.mainloop); -- pa_threaded_mainloop_free(self.mainloop); -- self.mainloop = ptr::null_mut(); -- } -+ self.mainloop.stop(); - } -- assert!(self.mainloop.is_null()); - } - - pub fn new_stream(&mut self, -- stream_name: *const c_char, -+ stream_name: &CStr, - input_device: cubeb::DeviceId, - input_stream_params: Option, - output_device: cubeb::DeviceId, -@@ -178,7 +184,7 @@ impl Context { - state_callback: cubeb::StateCallback, - user_ptr: *mut c_void) - -> Result> { -- if self.error && self.pulse_context_init() != 0 { -+ if self.error && self.context_init() != 0 { - return Err(cubeb::ERROR); - } - -@@ -221,41 +227,151 @@ impl Context { - } - - pub fn enumerate_devices(&self, devtype: cubeb::DeviceType) -> Result { -- let mut user_data: PulseDevListData = Default::default(); -- user_data.context = self as *const _ as *mut _; -+ fn add_output_device(_: &pulse::Context, i: *const pulse::SinkInfo, eol: i32, user_data: *mut c_void) { -+ if eol != 0 { -+ return; -+ } - -- unsafe { -- pa_threaded_mainloop_lock(self.mainloop); -+ debug_assert!(!i.is_null()); -+ debug_assert!(!user_data.is_null()); -+ -+ let mut list_data = unsafe { &mut *(user_data as *mut PulseDevListData) }; -+ let info = unsafe { &*i }; -+ -+ let group_id = match info.proplist().gets("sysfs.path") { -+ Some(p) => p.to_owned().into_raw(), -+ _ => ptr::null_mut(), -+ }; -+ -+ let vendor_name = match info.proplist().gets("device.vendor.name") { -+ Some(p) => p.to_owned().into_raw(), -+ _ => ptr::null_mut(), -+ }; -+ -+ let info_name = unsafe { CStr::from_ptr(info.name) }.to_owned(); -+ let info_description = unsafe { CStr::from_ptr(info.description) }.to_owned(); -+ -+ let preferred = if info_name == list_data.default_sink_name { -+ cubeb::DEVICE_PREF_ALL -+ } else { -+ cubeb::DevicePref::empty() -+ }; -+ -+ let ctx = &(*list_data.context); -+ -+ let device_id = info_name.into_raw(); -+ let friendly_name = info_description.into_raw(); -+ let devinfo = cubeb::DeviceInfo { -+ device_id: device_id, -+ devid: device_id as cubeb::DeviceId, -+ friendly_name: friendly_name, -+ group_id: group_id, -+ vendor_name: vendor_name, -+ devtype: cubeb::DEVICE_TYPE_OUTPUT, -+ state: ctx.state_from_port(info.active_port), -+ preferred: preferred, -+ format: cubeb::DeviceFmt::all(), -+ default_format: pulse_format_to_cubeb_format(info.sample_spec.format), -+ max_channels: info.channel_map.channels as u32, -+ min_rate: 1, -+ max_rate: PA_RATE_MAX, -+ default_rate: info.sample_spec.rate, -+ latency_lo: 0, -+ latency_hi: 0, -+ }; -+ list_data.devinfo.push(devinfo); -+ -+ ctx.mainloop.signal(); -+ } -+ -+ fn add_input_device(_: &pulse::Context, i: *const pulse::SourceInfo, eol: i32, user_data: *mut c_void) { -+ if eol != 0 { -+ return; -+ } -+ -+ debug_assert!(!user_data.is_null()); -+ debug_assert!(!i.is_null()); -+ -+ let mut list_data = unsafe { &mut *(user_data as *mut PulseDevListData) }; -+ let info = unsafe { &*i }; -+ -+ let group_id = match info.proplist().gets("sysfs.path") { -+ Some(p) => p.to_owned().into_raw(), -+ _ => ptr::null_mut(), -+ }; -+ -+ let vendor_name = match info.proplist().gets("device.vendor.name") { -+ Some(p) => p.to_owned().into_raw(), -+ _ => ptr::null_mut(), -+ }; - -- let o = pa_context_get_server_info(self.context, -- Some(pulse_server_info_cb), -- &mut user_data as *mut _ as *mut _); -- if !o.is_null() { -- self.operation_wait(ptr::null_mut(), o); -- pa_operation_unref(o); -+ let info_name = unsafe { CStr::from_ptr(info.name) }.to_owned(); -+ let info_description = unsafe { CStr::from_ptr(info.description) }.to_owned(); -+ -+ let preferred = if info_name == list_data.default_source_name { -+ cubeb::DEVICE_PREF_ALL -+ } else { -+ cubeb::DevicePref::empty() -+ }; -+ -+ let ctx = &(*list_data.context); -+ let device_id = info_name.into_raw(); -+ let friendly_name = info_description.into_raw(); -+ let devinfo = cubeb::DeviceInfo { -+ device_id: device_id, -+ devid: device_id as cubeb::DeviceId, -+ friendly_name: friendly_name, -+ group_id: group_id, -+ vendor_name: vendor_name, -+ devtype: cubeb::DEVICE_TYPE_INPUT, -+ state: ctx.state_from_port(info.active_port), -+ preferred: preferred, -+ format: cubeb::DeviceFmt::all(), -+ default_format: pulse_format_to_cubeb_format(info.sample_spec.format), -+ max_channels: info.channel_map.channels as u32, -+ min_rate: 1, -+ max_rate: PA_RATE_MAX, -+ default_rate: info.sample_spec.rate, -+ latency_lo: 0, -+ latency_hi: 0, -+ }; -+ -+ list_data.devinfo.push(devinfo); -+ -+ ctx.mainloop.signal(); -+ } -+ -+ fn default_device_names(_: &pulse::Context, info: &pulse::ServerInfo, user_data: *mut c_void) { -+ let list_data = unsafe { &mut *(user_data as *mut PulseDevListData) }; -+ -+ list_data.default_sink_name = unsafe { CStr::from_ptr(info.default_sink_name) }.to_owned(); -+ list_data.default_source_name = unsafe { CStr::from_ptr(info.default_source_name) }.to_owned(); -+ -+ (*list_data.context).mainloop.signal(); -+ } -+ -+ let mut user_data = PulseDevListData::new(self); -+ -+ if let Some(ref context) = self.context { -+ self.mainloop.lock(); -+ -+ if let Ok(o) = context.get_server_info(default_device_names, &mut user_data as *mut _ as *mut _) { -+ self.operation_wait(None, &o); - } - - if devtype == cubeb::DEVICE_TYPE_OUTPUT { -- let o = pa_context_get_sink_info_list(self.context, -- Some(pulse_sink_info_cb), -- &mut user_data as *mut _ as *mut _); -- if !o.is_null() { -- self.operation_wait(ptr::null_mut(), o); -- pa_operation_unref(o); -+ if let Ok(o) = context.get_sink_info_list(add_output_device, &mut user_data as *mut _ as *mut _) { -+ self.operation_wait(None, &o); - } - } - - if devtype == cubeb::DEVICE_TYPE_INPUT { -- let o = pa_context_get_source_info_list(self.context, -- Some(pulse_source_info_cb), -- &mut user_data as *mut _ as *mut _); -- if !o.is_null() { -- self.operation_wait(ptr::null_mut(), o); -- pa_operation_unref(o); -+ if let Ok(o) = context.get_source_info_list(add_input_device, &mut user_data as *mut _ as *mut _) { -+ self.operation_wait(None, &o); - } - } - -- pa_threaded_mainloop_unlock(self.mainloop); -+ self.mainloop.unlock(); - } - - // Extract the array of cubeb_device_info from -@@ -282,16 +398,16 @@ impl Context { - coll.count); - for dev in devices.iter_mut() { - if !dev.device_id.is_null() { -- pa_xfree(dev.device_id as *mut _); -+ let _ = CString::from_raw(dev.device_id as *mut _); - } - if !dev.group_id.is_null() { -- pa_xfree(dev.group_id as *mut _); -+ let _ = CString::from_raw(dev.group_id as *mut _); - } - if !dev.vendor_name.is_null() { -- pa_xfree(dev.vendor_name as *mut _); -+ let _ = CString::from_raw(dev.vendor_name as *mut _); - } - if !dev.friendly_name.is_null() { -- pa_xfree(dev.friendly_name as *mut _); -+ let _ = CString::from_raw(dev.friendly_name as *mut _); - } - } - } -@@ -302,115 +418,125 @@ impl Context { - cb: cubeb::DeviceCollectionChangedCallback, - user_ptr: *mut c_void) - -> i32 { -- unsafe extern "C" fn subscribe_success(_: *mut pa_context, success: i32, user_data: *mut c_void) { -- let ctx = &*(user_data as *mut Context); -+ fn update_collection(_: &pulse::Context, event: pulse::SubscriptionEvent, index: u32, user_data: *mut c_void) { -+ let mut ctx = unsafe { &mut *(user_data as *mut Context) }; -+ -+ let (f, t) = (event.event_facility(), event.event_type()); -+ match f { -+ pulse::SubscriptionEventFacility::Source | -+ pulse::SubscriptionEventFacility::Sink => { -+ match t { -+ pulse::SubscriptionEventType::Remove | -+ pulse::SubscriptionEventType::New => { -+ if cubeb::log_enabled() { -+ let op = if t == pulse::SubscriptionEventType::New { -+ "Adding" -+ } else { -+ "Removing" -+ }; -+ let dev = if f == pulse::SubscriptionEventFacility::Sink { -+ "sink" -+ } else { -+ "source " -+ }; -+ log!("{} {} index {}", op, dev, index); -+ -+ unsafe { -+ ctx.collection_changed_callback.unwrap()(ctx as *mut _ as *mut _, -+ ctx.collection_changed_user_ptr); -+ } -+ } -+ }, -+ _ => {}, -+ } -+ }, -+ _ => {}, -+ } -+ } -+ -+ fn success(_: &pulse::Context, success: i32, user_data: *mut c_void) { -+ let ctx = unsafe { &*(user_data as *mut Context) }; - debug_assert_ne!(success, 0); -- pa_threaded_mainloop_signal(ctx.mainloop, 0); -+ ctx.mainloop.signal(); - } - - self.collection_changed_callback = cb; - self.collection_changed_user_ptr = user_ptr; - -- unsafe { -- pa_threaded_mainloop_lock(self.mainloop); -+ let user_data: *mut c_void = self as *mut _ as *mut _; -+ if let Some(ref context) = self.context { -+ self.mainloop.lock(); - -- let mut mask: pa_subscription_mask_t = PA_SUBSCRIPTION_MASK_NULL; -+ let mut mask = pulse::SubscriptionMask::empty(); - if self.collection_changed_callback.is_none() { - // Unregister subscription -- pa_context_set_subscribe_callback(self.context, None, ptr::null_mut()); -+ context.clear_subscribe_callback(); - } else { -- pa_context_set_subscribe_callback(self.context, -- Some(pulse_subscribe_callback), -- self as *mut _ as *mut _); -- if devtype == cubeb::DEVICE_TYPE_INPUT { -- mask |= PA_SUBSCRIPTION_MASK_SOURCE -+ context.set_subscribe_callback(update_collection, user_data); -+ if devtype.contains(cubeb::DEVICE_TYPE_INPUT) { -+ mask |= pulse::SUBSCRIPTION_MASK_SOURCE - }; -- if devtype == cubeb::DEVICE_TYPE_OUTPUT { -- mask |= PA_SUBSCRIPTION_MASK_SOURCE -+ if devtype.contains(cubeb::DEVICE_TYPE_OUTPUT) { -+ mask = pulse::SUBSCRIPTION_MASK_SINK - }; - } - -- let o = pa_context_subscribe(self.context, -- mask, -- Some(subscribe_success), -- self as *const _ as *mut _); -- if o.is_null() { -+ if let Ok(o) = context.subscribe(mask, success, self as *const _ as *mut _) { -+ self.operation_wait(None, &o); -+ } else { - log!("Context subscribe failed"); - return cubeb::ERROR; - } -- self.operation_wait(ptr::null_mut(), o); -- pa_operation_unref(o); - -- pa_threaded_mainloop_unlock(self.mainloop); -+ self.mainloop.unlock(); - } - - cubeb::OK - } - -- // -- -- pub fn pulse_stream_cork(&self, stream: *mut pa_stream, state: CorkState) { -- unsafe extern "C" fn cork_success(_: *mut pa_stream, _: i32, u: *mut c_void) { -- let mainloop = u as *mut pa_threaded_mainloop; -- pa_threaded_mainloop_signal(mainloop, 0); -+ pub fn context_init(&mut self) -> i32 { -+ fn error_state(c: &pulse::Context, u: *mut c_void) { -+ let mut ctx = unsafe { &mut *(u as *mut Context) }; -+ if !c.get_state().is_good() { -+ ctx.error = true; -+ } -+ ctx.mainloop.signal(); - } - -- if stream.is_null() { -- return; -+ if self.context.is_some() { -+ debug_assert!(self.error); -+ self.context_destroy(); - } - -- let o = unsafe { -- pa_stream_cork(stream, -- state.is_cork() as i32, -- Some(cork_success), -- self.mainloop as *mut _) -+ self.context = { -+ let name = match self.context_name.as_ref() { -+ Some(s) => Some(s.as_ref()), -+ None => None, -+ }; -+ pulse::Context::new(&self.mainloop.get_api(), name) - }; - -- if !o.is_null() { -- self.operation_wait(stream, o); -- unsafe { pa_operation_unref(o) }; -+ let context_ptr: *mut c_void = self as *mut _ as *mut _; -+ if self.context.is_none() { -+ return cubeb::ERROR; - } -- } - -- pub fn pulse_context_init(&mut self) -> i32 { -- unsafe extern "C" fn error_state(c: *mut pa_context, u: *mut c_void) { -- let mut ctx = &mut *(u as *mut Context); -- if !PA_CONTEXT_IS_GOOD(pa_context_get_state(c)) { -- ctx.error = true; -- } -- pa_threaded_mainloop_signal(ctx.mainloop, 0); -+ self.mainloop.lock(); -+ if let Some(ref context) = self.context { -+ context.set_state_callback(error_state, context_ptr); -+ let _ = context.connect(None, pulse::ContextFlags::empty(), ptr::null()); - } - -- if !self.context.is_null() { -- debug_assert!(self.error); -- unsafe { self.pulse_context_destroy() }; -+ if !self.wait_until_context_ready() { -+ self.mainloop.unlock(); -+ self.context_destroy(); -+ return cubeb::ERROR; - } - -- unsafe { -- self.context = pa_context_new(pa_threaded_mainloop_get_api(self.mainloop), -- self.context_name); -- -- if self.context.is_null() { -- return cubeb::ERROR; -- } -- -- pa_context_set_state_callback(self.context, Some(error_state), self as *mut _ as *mut _); -- -- pa_threaded_mainloop_lock(self.mainloop); -- pa_context_connect(self.context, ptr::null(), 0, ptr::null()); -- -- if !self.wait_until_context_ready() { -- pa_threaded_mainloop_unlock(self.mainloop); -- self.pulse_context_destroy(); -- assert!(self.context.is_null()); -- return cubeb::ERROR; -- } -+ self.mainloop.unlock(); - -- pa_threaded_mainloop_unlock(self.mainloop); -- } -- -- let version_str = unsafe { CStr::from_ptr(pa_get_library_version()) }; -- if let Ok(version) = semver::Version::parse(version_str.to_string_lossy().as_ref()) { -+ let version_str = unsafe { CStr::from_ptr(pulse::library_version()) }; -+ if let Ok(version) = semver::Version::parse(&version_str.to_string_lossy()) { - self.version_0_9_8 = version >= semver::Version::parse("0.9.8").expect("Failed to parse version"); - self.version_2_0_0 = version >= semver::Version::parse("2.0.0").expect("Failed to parse version"); - } -@@ -420,34 +546,42 @@ impl Context { - cubeb::OK - } - -- unsafe fn pulse_context_destroy(&mut self) { -- unsafe extern "C" fn drain_complete(_c: *mut pa_context, u: *mut c_void) { -- let mainloop = u as *mut pa_threaded_mainloop; -- pa_threaded_mainloop_signal(mainloop, 0); -- } -- -- pa_threaded_mainloop_lock(self.mainloop); -- let o = pa_context_drain(self.context, Some(drain_complete), self.mainloop as *mut _); -- if !o.is_null() { -- self.operation_wait(ptr::null_mut(), o); -- pa_operation_unref(o); -- } -- pa_context_set_state_callback(self.context, None, ptr::null_mut()); -- pa_context_disconnect(self.context); -- pa_context_unref(self.context); -- self.context = ptr::null_mut(); -- pa_threaded_mainloop_unlock(self.mainloop); -+ fn context_destroy(&mut self) { -+ fn drain_complete(_: &pulse::Context, u: *mut c_void) { -+ let ctx = unsafe { &*(u as *mut Context) }; -+ ctx.mainloop.signal(); -+ } -+ -+ let context_ptr: *mut c_void = self as *mut _ as *mut _; -+ match self.context.take() { -+ Some(ctx) => { -+ self.mainloop.lock(); -+ if let Ok(o) = ctx.drain(drain_complete, context_ptr) { -+ self.operation_wait(None, &o); -+ } -+ ctx.clear_state_callback(); -+ ctx.disconnect(); -+ ctx.unref(); -+ self.mainloop.unlock(); -+ }, -+ _ => {}, -+ } - } - -- pub fn operation_wait(&self, stream: *mut pa_stream, o: *mut pa_operation) -> bool { -- unsafe { -- while pa_operation_get_state(o) == PA_OPERATION_RUNNING { -- pa_threaded_mainloop_wait(self.mainloop); -- if !PA_CONTEXT_IS_GOOD(pa_context_get_state(self.context)) { -+ pub fn operation_wait<'a, S>(&self, s: S, o: &pulse::Operation) -> bool -+ where S: Into> -+ { -+ let stream = s.into(); -+ while o.get_state() == PA_OPERATION_RUNNING { -+ self.mainloop.wait(); -+ if let Some(ref context) = self.context { -+ if !context.get_state().is_good() { - return false; - } -+ } - -- if !stream.is_null() && !PA_STREAM_IS_GOOD(pa_stream_get_state(stream)) { -+ if let Some(stm) = stream { -+ if !stm.get_state().is_good() { - return false; - } - } -@@ -457,36 +591,23 @@ impl Context { - } - - pub fn wait_until_context_ready(&self) -> bool { -- loop { -- let state = unsafe { pa_context_get_state(self.context) }; -- if !PA_CONTEXT_IS_GOOD(state) { -- return false; -- } -- if state == PA_CONTEXT_READY { -- break; -- } -- unsafe { -- pa_threaded_mainloop_wait(self.mainloop); -+ if let Some(ref context) = self.context { -+ loop { -+ let state = context.get_state(); -+ if !state.is_good() { -+ return false; -+ } -+ if state == pulse::ContextState::Ready { -+ break; -+ } -+ self.mainloop.wait(); - } - } - - true - } - -- fn state_from_sink_port(&self, i: *const pa_port_info) -> cubeb::DeviceState { -- if !i.is_null() { -- let info = unsafe { *i }; -- if self.version_2_0_0 && info.available == PA_PORT_AVAILABLE_NO { -- cubeb::DeviceState::Unplugged -- } else { -- cubeb::DeviceState::Enabled -- } -- } else { -- cubeb::DeviceState::Enabled -- } -- } -- -- fn state_from_source_port(&self, i: *mut pa_port_info) -> cubeb::DeviceState { -+ fn state_from_port(&self, i: *const pa_port_info) -> cubeb::DeviceState { - if !i.is_null() { - let info = unsafe { *i }; - if self.version_2_0_0 && info.available == PA_PORT_AVAILABLE_NO { -@@ -500,62 +621,30 @@ impl Context { - } - } - --// Callbacks --unsafe extern "C" fn server_info_callback(context: *mut pa_context, info: *const pa_server_info, u: *mut c_void) { -- unsafe extern "C" fn sink_info_callback(_context: *mut pa_context, -- info: *const pa_sink_info, -- eol: i32, -- u: *mut c_void) { -- let mut ctx = &mut *(u as *mut Context); -- if eol == 0 { -- let info = *info; -- ctx.default_sink_info = Some(DefaultInfo { -- sample_spec: info.sample_spec, -- channel_map: info.channel_map, -- flags: info.flags, -- }); -- } -- pa_threaded_mainloop_signal(ctx.mainloop, 0); -- } -- -- let o = pa_context_get_sink_info_by_name(context, -- (*info).default_sink_name, -- Some(sink_info_callback), -- u); -- if !o.is_null() { -- pa_operation_unref(o); -- } --} -- --struct PulseDevListData { -- default_sink_name: *mut c_char, -- default_source_name: *mut c_char, -+struct PulseDevListData<'a> { -+ default_sink_name: CString, -+ default_source_name: CString, - devinfo: Vec, -- context: *mut Context, -+ context: &'a Context, - } - --impl Drop for PulseDevListData { -- fn drop(&mut self) { -- if !self.default_sink_name.is_null() { -- unsafe { -- pa_xfree(self.default_sink_name as *mut _); -- } -- } -- if !self.default_source_name.is_null() { -- unsafe { -- pa_xfree(self.default_source_name as *mut _); -- } -+impl<'a> PulseDevListData<'a> { -+ pub fn new<'b>(context: &'b Context) -> Self -+ where 'b: 'a -+ { -+ PulseDevListData { -+ default_sink_name: CString::default(), -+ default_source_name: CString::default(), -+ devinfo: Vec::new(), -+ context: context, - } - } - } - --impl Default for PulseDevListData { -- fn default() -> Self { -- PulseDevListData { -- default_sink_name: ptr::null_mut(), -- default_source_name: ptr::null_mut(), -- devinfo: Vec::new(), -- context: ptr::null_mut(), -+impl<'a> Drop for PulseDevListData<'a> { -+ fn drop(&mut self) { -+ for elem in &mut self.devinfo { -+ let _ = unsafe { Box::from_raw(elem) }; - } - } - } -@@ -566,192 +655,7 @@ fn pulse_format_to_cubeb_format(format: - PA_SAMPLE_S16BE => cubeb::DEVICE_FMT_S16BE, - PA_SAMPLE_FLOAT32LE => cubeb::DEVICE_FMT_F32LE, - PA_SAMPLE_FLOAT32BE => cubeb::DEVICE_FMT_F32BE, -- _ => { -- panic!("Invalid format"); -- }, -+ // Unsupported format, return F32NE -+ _ => cubeb::CUBEB_FMT_F32NE, - } - } -- --unsafe extern "C" fn pulse_sink_info_cb(_context: *mut pa_context, -- i: *const pa_sink_info, -- eol: i32, -- user_data: *mut c_void) { -- if eol != 0 || i.is_null() { -- return; -- } -- -- debug_assert!(!user_data.is_null()); -- -- let info = *i; -- let mut list_data = &mut *(user_data as *mut PulseDevListData); -- -- let device_id = pa_xstrdup(info.name); -- -- let group_id = { -- let prop = pa_proplist_gets(info.proplist, b"sysfs.path\0".as_ptr() as *const c_char); -- if !prop.is_null() { -- pa_xstrdup(prop) -- } else { -- ptr::null_mut() -- } -- }; -- -- let vendor_name = { -- let prop = pa_proplist_gets(info.proplist, -- b"device.vendor.name\0".as_ptr() as *const c_char); -- if !prop.is_null() { -- pa_xstrdup(prop) -- } else { -- ptr::null_mut() -- } -- }; -- -- let preferred = if strcmp(info.name, list_data.default_sink_name) == 0 { -- cubeb::DEVICE_PREF_ALL -- } else { -- cubeb::DevicePref::empty() -- }; -- -- let ctx = &(*list_data.context); -- -- let devinfo = cubeb::DeviceInfo { -- device_id: device_id, -- devid: device_id as cubeb::DeviceId, -- friendly_name: pa_xstrdup(info.description), -- group_id: group_id, -- vendor_name: vendor_name, -- devtype: cubeb::DEVICE_TYPE_OUTPUT, -- state: ctx.state_from_sink_port(info.active_port), -- preferred: preferred, -- format: cubeb::DeviceFmt::all(), -- default_format: pulse_format_to_cubeb_format(info.sample_spec.format), -- max_channels: info.channel_map.channels as u32, -- min_rate: 1, -- max_rate: PA_RATE_MAX, -- default_rate: info.sample_spec.rate, -- latency_lo: 0, -- latency_hi: 0, -- }; -- list_data.devinfo.push(devinfo); -- -- pa_threaded_mainloop_signal(ctx.mainloop, 0); --} -- --unsafe extern "C" fn pulse_source_info_cb(_context: *mut pa_context, -- i: *const pa_source_info, -- eol: i32, -- user_data: *mut c_void) { -- if eol != 0 || i.is_null() { -- return; -- } -- -- debug_assert!(!user_data.is_null()); -- -- let info = *i; -- let mut list_data = &mut *(user_data as *mut PulseDevListData); -- -- let device_id = pa_xstrdup(info.name); -- -- let group_id = { -- let prop = pa_proplist_gets(info.proplist, b"sysfs.path\0".as_ptr() as *mut c_char); -- if !prop.is_null() { -- pa_xstrdup(prop) -- } else { -- ptr::null_mut() -- } -- }; -- -- let vendor_name = { -- let prop = pa_proplist_gets(info.proplist, -- b"device.vendor.name\0".as_ptr() as *mut c_char); -- if !prop.is_null() { -- pa_xstrdup(prop) -- } else { -- ptr::null_mut() -- } -- }; -- -- let preferred = if strcmp(info.name, list_data.default_source_name) == 0 { -- cubeb::DEVICE_PREF_ALL -- } else { -- cubeb::DevicePref::empty() -- }; -- -- let ctx = &(*list_data.context); -- -- let devinfo = cubeb::DeviceInfo { -- device_id: device_id, -- devid: device_id as cubeb::DeviceId, -- friendly_name: pa_xstrdup(info.description), -- group_id: group_id, -- vendor_name: vendor_name, -- devtype: cubeb::DEVICE_TYPE_INPUT, -- state: ctx.state_from_source_port(info.active_port), -- preferred: preferred, -- format: cubeb::DeviceFmt::all(), -- default_format: pulse_format_to_cubeb_format(info.sample_spec.format), -- max_channels: info.channel_map.channels as u32, -- min_rate: 1, -- max_rate: PA_RATE_MAX, -- default_rate: info.sample_spec.rate, -- latency_lo: 0, -- latency_hi: 0, -- }; -- -- list_data.devinfo.push(devinfo); -- -- pa_threaded_mainloop_signal(ctx.mainloop, 0); --} -- --unsafe extern "C" fn pulse_server_info_cb(_context: *mut pa_context, -- i: *const pa_server_info, -- user_data: *mut c_void) { -- assert!(!i.is_null()); -- let info = *i; -- let list_data = &mut *(user_data as *mut PulseDevListData); -- -- dup_str!(list_data.default_sink_name, info.default_sink_name); -- dup_str!(list_data.default_source_name, info.default_source_name); -- -- pa_threaded_mainloop_signal((*list_data.context).mainloop, 0); --} -- --unsafe extern "C" fn pulse_subscribe_callback(_ctx: *mut pa_context, -- t: pa_subscription_event_type_t, -- index: u32, -- user_data: *mut c_void) { -- let mut ctx = &mut *(user_data as *mut Context); -- -- match t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK { -- PA_SUBSCRIPTION_EVENT_SOURCE | -- PA_SUBSCRIPTION_EVENT_SINK => { -- -- if cubeb::log_enabled() { -- if (t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK) == PA_SUBSCRIPTION_EVENT_SOURCE && -- (t & PA_SUBSCRIPTION_EVENT_TYPE_MASK) == PA_SUBSCRIPTION_EVENT_REMOVE { -- log!("Removing sink index %d", index); -- } else if (t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK) == PA_SUBSCRIPTION_EVENT_SOURCE && -- (t & PA_SUBSCRIPTION_EVENT_TYPE_MASK) == PA_SUBSCRIPTION_EVENT_NEW { -- log!("Adding sink index %d", index); -- } -- if (t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK) == PA_SUBSCRIPTION_EVENT_SINK && -- (t & PA_SUBSCRIPTION_EVENT_TYPE_MASK) == PA_SUBSCRIPTION_EVENT_REMOVE { -- log!("Removing source index %d", index); -- } else if (t & PA_SUBSCRIPTION_EVENT_FACILITY_MASK) == PA_SUBSCRIPTION_EVENT_SINK && -- (t & PA_SUBSCRIPTION_EVENT_TYPE_MASK) == PA_SUBSCRIPTION_EVENT_NEW { -- log!("Adding source index %d", index); -- } -- } -- -- if (t & PA_SUBSCRIPTION_EVENT_TYPE_MASK) == PA_SUBSCRIPTION_EVENT_REMOVE || -- (t & PA_SUBSCRIPTION_EVENT_TYPE_MASK) == PA_SUBSCRIPTION_EVENT_NEW { -- ctx.collection_changed_callback.unwrap()(ctx as *mut _ as *mut _, ctx.collection_changed_user_ptr); -- } -- }, -- _ => {}, -- } --} -- --extern "C" { -- pub fn strcmp(cs: *const c_char, ct: *const c_char) -> c_int; --} -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/src/backend/mod.rs.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/src/backend/mod.rs ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/src/backend/mod.rs.cubeb-pulse-arm 2017-07-31 18:20:49.000000000 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/src/backend/mod.rs 2017-08-04 13:37:46.386821731 +0200 -@@ -7,8 +7,16 @@ mod context; - mod cork_state; - mod stream; - -+use std::os::raw::c_char; -+use std::ffi::CStr; -+ - pub type Result = ::std::result::Result; - - pub use self::context::Context; - pub use self::stream::Device; - pub use self::stream::Stream; -+ -+// helper to convert *const c_char to Option -+fn try_cstr_from<'str>(s: *const c_char) -> Option<&'str CStr> { -+ if s.is_null() { None } else { Some(unsafe { CStr::from_ptr(s) }) } -+} -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/src/backend/stream.rs.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/src/backend/stream.rs ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/src/backend/stream.rs.cubeb-pulse-arm 2017-07-31 18:20:49.000000000 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/src/backend/stream.rs 2017-08-04 13:37:46.387821728 +0200 -@@ -6,8 +6,10 @@ - use backend::*; - use backend::cork_state::CorkState; - use cubeb; -+use pulse::{self, CVolumeExt, ChannelMapExt, SampleSpecExt, USecExt}; - use pulse_ffi::*; --use std::os::raw::{c_char, c_long, c_void}; -+use std::ffi::{CStr, CString}; -+use std::os::raw::{c_long, c_void}; - use std::ptr; - - const PULSE_NO_GAIN: f32 = -1.0; -@@ -36,15 +38,12 @@ fn cubeb_channel_to_pa_channel(channel: - MAP[idx as usize] - } - --fn layout_to_channel_map(layout: cubeb::ChannelLayout) -> pa_channel_map { -+fn layout_to_channel_map(layout: cubeb::ChannelLayout) -> pulse::ChannelMap { - assert_ne!(layout, cubeb::LAYOUT_UNDEFINED); - - let order = cubeb::mixer::channel_index_to_order(layout); - -- let mut cm: pa_channel_map = Default::default(); -- unsafe { -- pa_channel_map_init(&mut cm); -- } -+ let mut cm = pulse::ChannelMap::init(); - cm.channels = order.len() as u8; - for (s, d) in order.iter().zip(cm.map.iter_mut()) { - *d = cubeb_channel_to_pa_channel(*s); -@@ -57,24 +56,27 @@ pub struct Device(cubeb::Device); - impl Drop for Device { - fn drop(&mut self) { - unsafe { -- pa_xfree(self.0.input_name as *mut _); -- pa_xfree(self.0.output_name as *mut _); -+ if !self.0.input_name.is_null() { -+ let _ = CString::from_raw(self.0.input_name); -+ } -+ if !self.0.output_name.is_null() { -+ let _ = CString::from_raw(self.0.output_name); -+ } - } - } - } - -- - #[derive(Debug)] - pub struct Stream<'ctx> { - context: &'ctx Context, -- output_stream: *mut pa_stream, -- input_stream: *mut pa_stream, -+ output_stream: Option, -+ input_stream: Option, - data_callback: cubeb::DataCallback, - state_callback: cubeb::StateCallback, - user_ptr: *mut c_void, - drain_timer: *mut pa_time_event, -- output_sample_spec: pa_sample_spec, -- input_sample_spec: pa_sample_spec, -+ output_sample_spec: pulse::SampleSpec, -+ input_sample_spec: pulse::SampleSpec, - shutdown: bool, - volume: f32, - state: cubeb::State, -@@ -88,7 +90,7 @@ impl<'ctx> Drop for Stream<'ctx> { - - impl<'ctx> Stream<'ctx> { - pub fn new(context: &'ctx Context, -- stream_name: *const c_char, -+ stream_name: &CStr, - input_device: cubeb::DeviceId, - input_stream_params: Option, - output_device: cubeb::DeviceId, -@@ -99,83 +101,167 @@ impl<'ctx> Stream<'ctx> { - user_ptr: *mut c_void) - -> Result>> { - -+ fn check_error(s: &pulse::Stream, u: *mut c_void) { -+ let stm = unsafe { &mut *(u as *mut Stream) }; -+ if !s.get_state().is_good() { -+ stm.state_change_callback(cubeb::STATE_ERROR); -+ } -+ stm.context.mainloop.signal(); -+ } -+ -+ fn read_data(s: &pulse::Stream, nbytes: usize, u: *mut c_void) { -+ fn read_from_input(s: &pulse::Stream, buffer: *mut *const c_void, size: *mut usize) -> i32 { -+ let readable_size: i32 = s.readable_size() -+ .and_then(|s| Ok(s as i32)) -+ .unwrap_or(-1); -+ if readable_size > 0 { -+ if unsafe { s.peek(buffer, size).is_err() } { -+ return -1; -+ } -+ } -+ readable_size -+ } -+ -+ logv!("Input callback buffer size {}", nbytes); -+ let mut stm = unsafe { &mut *(u as *mut Stream) }; -+ if stm.shutdown { -+ return; -+ } -+ -+ let mut read_data: *const c_void = ptr::null(); -+ let mut read_size: usize = 0; -+ while read_from_input(s, &mut read_data, &mut read_size) > 0 { -+ /* read_data can be NULL in case of a hole. */ -+ if !read_data.is_null() { -+ let in_frame_size = stm.input_sample_spec.frame_size(); -+ let read_frames = read_size / in_frame_size; -+ -+ if stm.output_stream.is_some() { -+ // input/capture + output/playback operation -+ let out_frame_size = stm.output_sample_spec.frame_size(); -+ let write_size = read_frames * out_frame_size; -+ // Offer full duplex data for writing -+ stm.trigger_user_callback(read_data, write_size); -+ } else { -+ // input/capture only operation. Call callback directly -+ let got = unsafe { -+ stm.data_callback.unwrap()(stm as *mut _ as *mut _, -+ stm.user_ptr, -+ read_data, -+ ptr::null_mut(), -+ read_frames as c_long) -+ }; -+ -+ if got < 0 || got as usize != read_frames { -+ let _ = s.cancel_write(); -+ stm.shutdown = true; -+ break; -+ } -+ } -+ } -+ -+ if read_size > 0 { -+ let _ = s.drop(); -+ } -+ -+ if stm.shutdown { -+ return; -+ } -+ } -+ } -+ -+ fn write_data(_: &pulse::Stream, nbytes: usize, u: *mut c_void) { -+ logv!("Output callback to be written buffer size {}", nbytes); -+ let mut stm = unsafe { &mut *(u as *mut Stream) }; -+ if stm.shutdown || stm.state != cubeb::STATE_STARTED { -+ return; -+ } -+ -+ if stm.input_stream.is_none() { -+ // Output/playback only operation. -+ // Write directly to output -+ debug_assert!(stm.output_stream.is_some()); -+ stm.trigger_user_callback(ptr::null(), nbytes); -+ } -+ } -+ - let mut stm = Box::new(Stream { - context: context, -- output_stream: ptr::null_mut(), -- input_stream: ptr::null_mut(), -+ output_stream: None, -+ input_stream: None, - data_callback: data_callback, - state_callback: state_callback, - user_ptr: user_ptr, - drain_timer: ptr::null_mut(), -- output_sample_spec: pa_sample_spec::default(), -- input_sample_spec: pa_sample_spec::default(), -+ output_sample_spec: pulse::SampleSpec::default(), -+ input_sample_spec: pulse::SampleSpec::default(), - shutdown: false, - volume: PULSE_NO_GAIN, - state: cubeb::STATE_ERROR, - }); - -- unsafe { -- pa_threaded_mainloop_lock(stm.context.mainloop); -+ if let Some(ref context) = stm.context.context { -+ stm.context.mainloop.lock(); -+ -+ // Setup output stream - if let Some(ref stream_params) = output_stream_params { -- match stm.pulse_stream_init(stream_params, stream_name) { -- Ok(s) => stm.output_stream = s, -+ match Stream::stream_init(context, stream_params, stream_name) { -+ Ok(s) => { -+ stm.output_sample_spec = *s.get_sample_spec(); -+ -+ s.set_state_callback(check_error, stm.as_mut() as *mut _ as *mut _); -+ s.set_write_callback(write_data, stm.as_mut() as *mut _ as *mut _); -+ -+ let battr = set_buffering_attribute(latency_frames, &stm.output_sample_spec); -+ let device_name = super::try_cstr_from(output_device as *const _); -+ let _ = s.connect_playback(device_name, -+ &battr, -+ pulse::STREAM_AUTO_TIMING_UPDATE | pulse::STREAM_INTERPOLATE_TIMING | -+ pulse::STREAM_START_CORKED | -+ pulse::STREAM_ADJUST_LATENCY, -+ None, -+ None); -+ -+ stm.output_stream = Some(s); -+ }, - Err(e) => { -- pa_threaded_mainloop_unlock(stm.context.mainloop); -+ stm.context.mainloop.unlock(); - stm.destroy(); - return Err(e); - }, - } - -- stm.output_sample_spec = *pa_stream_get_sample_spec(stm.output_stream); -- -- pa_stream_set_state_callback(stm.output_stream, -- Some(stream_state_callback), -- stm.as_mut() as *mut _ as *mut _); -- pa_stream_set_write_callback(stm.output_stream, -- Some(stream_write_callback), -- stm.as_mut() as *mut _ as *mut _); -- -- let battr = set_buffering_attribute(latency_frames, &stm.output_sample_spec); -- pa_stream_connect_playback(stm.output_stream, -- output_device as *mut c_char, -- &battr, -- PA_STREAM_AUTO_TIMING_UPDATE | PA_STREAM_INTERPOLATE_TIMING | -- PA_STREAM_START_CORKED | -- PA_STREAM_ADJUST_LATENCY, -- ptr::null(), -- ptr::null_mut()); - } - - // Set up input stream - if let Some(ref stream_params) = input_stream_params { -- match stm.pulse_stream_init(stream_params, stream_name) { -- Ok(s) => stm.input_stream = s, -+ match Stream::stream_init(context, stream_params, stream_name) { -+ Ok(s) => { -+ stm.input_sample_spec = *s.get_sample_spec(); -+ -+ s.set_state_callback(check_error, stm.as_mut() as *mut _ as *mut _); -+ s.set_read_callback(read_data, stm.as_mut() as *mut _ as *mut _); -+ -+ let battr = set_buffering_attribute(latency_frames, &stm.input_sample_spec); -+ let device_name = super::try_cstr_from(input_device as *const _); -+ let _ = s.connect_record(device_name, -+ &battr, -+ pulse::STREAM_AUTO_TIMING_UPDATE | pulse::STREAM_INTERPOLATE_TIMING | -+ pulse::STREAM_START_CORKED | -+ pulse::STREAM_ADJUST_LATENCY); -+ -+ stm.input_stream = Some(s); -+ }, - Err(e) => { -- pa_threaded_mainloop_unlock(stm.context.mainloop); -+ stm.context.mainloop.unlock(); - stm.destroy(); - return Err(e); - }, - } - -- stm.input_sample_spec = *(pa_stream_get_sample_spec(stm.input_stream)); -- -- pa_stream_set_state_callback(stm.input_stream, -- Some(stream_state_callback), -- stm.as_mut() as *mut _ as *mut _); -- pa_stream_set_read_callback(stm.input_stream, -- Some(stream_read_callback), -- stm.as_mut() as *mut _ as *mut _); -- -- let battr = set_buffering_attribute(latency_frames, &stm.input_sample_spec); -- pa_stream_connect_record(stm.input_stream, -- input_device as *mut c_char, -- &battr, -- PA_STREAM_AUTO_TIMING_UPDATE | PA_STREAM_INTERPOLATE_TIMING | -- PA_STREAM_START_CORKED | -- PA_STREAM_ADJUST_LATENCY); - } - -- let r = if stm.wait_until_stream_ready() { -+ let r = if stm.wait_until_ready() { - /* force a timing update now, otherwise timing info does not become valid - until some point after initialization has completed. */ - stm.update_timing_info() -@@ -183,7 +269,7 @@ impl<'ctx> Stream<'ctx> { - false - }; - -- pa_threaded_mainloop_unlock(stm.context.mainloop); -+ stm.context.mainloop.unlock(); - - if !r { - stm.destroy(); -@@ -191,10 +277,10 @@ impl<'ctx> Stream<'ctx> { - } - - if cubeb::log_enabled() { -- if output_stream_params.is_some() { -- let output_att = *pa_stream_get_buffer_attr(stm.output_stream); -- log!("Output buffer attributes maxlength %u, tlength %u, \ -- prebuf %u, minreq %u, fragsize %u", -+ if let Some(ref output_stream) = stm.output_stream { -+ let output_att = output_stream.get_buffer_attr(); -+ log!("Output buffer attributes maxlength {}, tlength {}, \ -+ prebuf {}, minreq {}, fragsize {}", - output_att.maxlength, - output_att.tlength, - output_att.prebuf, -@@ -202,10 +288,10 @@ impl<'ctx> Stream<'ctx> { - output_att.fragsize); - } - -- if input_stream_params.is_some() { -- let input_att = *pa_stream_get_buffer_attr(stm.input_stream); -- log!("Input buffer attributes maxlength %u, tlength %u, \ -- prebuf %u, minreq %u, fragsize %u", -+ if let Some(ref input_stream) = stm.input_stream { -+ let input_att = input_stream.get_buffer_attr(); -+ log!("Input buffer attributes maxlength {}, tlength {}, \ -+ prebuf {}, minreq {}, fragsize {}", - input_att.maxlength, - input_att.tlength, - input_att.prebuf, -@@ -219,224 +305,250 @@ impl<'ctx> Stream<'ctx> { - } - - fn destroy(&mut self) { -- self.stream_cork(CorkState::cork()); -+ self.cork(CorkState::cork()); - -- unsafe { -- pa_threaded_mainloop_lock(self.context.mainloop); -- if !self.output_stream.is_null() { -- if !self.drain_timer.is_null() { -- /* there's no pa_rttime_free, so use this instead. */ -- let ma = pa_threaded_mainloop_get_api(self.context.mainloop); -- if !ma.is_null() { -- (*ma).time_free.unwrap()(self.drain_timer); -+ self.context.mainloop.lock(); -+ { -+ match self.output_stream.take() { -+ Some(stm) => { -+ if !self.drain_timer.is_null() { -+ /* there's no pa_rttime_free, so use this instead. */ -+ self.context -+ .mainloop -+ .get_api() -+ .time_free(self.drain_timer); - } -- } -- -- pa_stream_set_state_callback(self.output_stream, None, ptr::null_mut()); -- pa_stream_set_write_callback(self.output_stream, None, ptr::null_mut()); -- pa_stream_disconnect(self.output_stream); -- pa_stream_unref(self.output_stream); -+ stm.clear_state_callback(); -+ stm.clear_write_callback(); -+ let _ = stm.disconnect(); -+ stm.unref(); -+ }, -+ _ => {}, -+ } -+ -+ match self.input_stream.take() { -+ Some(stm) => { -+ stm.clear_state_callback(); -+ stm.clear_read_callback(); -+ let _ = stm.disconnect(); -+ stm.unref(); -+ }, -+ _ => {}, - } -- -- if !self.input_stream.is_null() { -- pa_stream_set_state_callback(self.input_stream, None, ptr::null_mut()); -- pa_stream_set_read_callback(self.input_stream, None, ptr::null_mut()); -- pa_stream_disconnect(self.input_stream); -- pa_stream_unref(self.input_stream); -- } -- pa_threaded_mainloop_unlock(self.context.mainloop); - } -+ self.context.mainloop.unlock(); - } - - pub fn start(&mut self) -> i32 { -+ fn output_preroll(_: &pulse::MainloopApi, u: *mut c_void) { -+ let mut stm = unsafe { &mut *(u as *mut Stream) }; -+ if !stm.shutdown { -+ let size = stm.output_stream -+ .as_ref() -+ .map_or(0, |s| s.writable_size().unwrap_or(0)); -+ stm.trigger_user_callback(ptr::null_mut(), size); -+ } -+ } -+ - self.shutdown = false; -- self.stream_cork(CorkState::uncork() | CorkState::notify()); -+ self.cork(CorkState::uncork() | CorkState::notify()); - -- if !self.output_stream.is_null() && self.input_stream.is_null() { -- unsafe { -- /* On output only case need to manually call user cb once in order to make -- * things roll. This is done via a defer event in order to execute it -- * from PA server thread. */ -- pa_threaded_mainloop_lock(self.context.mainloop); -- pa_mainloop_api_once(pa_threaded_mainloop_get_api(self.context.mainloop), -- Some(pulse_defer_event_cb), -- self as *mut _ as *mut _); -- pa_threaded_mainloop_unlock(self.context.mainloop); -- } -+ if self.output_stream.is_some() && self.input_stream.is_none() { -+ /* On output only case need to manually call user cb once in order to make -+ * things roll. This is done via a defer event in order to execute it -+ * from PA server thread. */ -+ self.context.mainloop.lock(); -+ self.context -+ .mainloop -+ .get_api() -+ .once(output_preroll, self as *mut _ as *mut _); -+ self.context.mainloop.unlock(); - } - - cubeb::OK - } - - pub fn stop(&mut self) -> i32 { -- unsafe { -- pa_threaded_mainloop_lock(self.context.mainloop); -+ { -+ self.context.mainloop.lock(); - self.shutdown = true; - // If draining is taking place wait to finish - while !self.drain_timer.is_null() { -- pa_threaded_mainloop_wait(self.context.mainloop); -+ self.context.mainloop.wait(); - } -- pa_threaded_mainloop_unlock(self.context.mainloop); -+ self.context.mainloop.unlock(); - } -- self.stream_cork(CorkState::cork() | CorkState::notify()); -+ self.cork(CorkState::cork() | CorkState::notify()); - - cubeb::OK - } - - pub fn position(&self) -> Result { -- if self.output_stream.is_null() { -- return Err(cubeb::ERROR); -- } -+ let in_thread = self.context.mainloop.in_thread(); - -- let position = unsafe { -- let in_thread = pa_threaded_mainloop_in_thread(self.context.mainloop); -- -- if in_thread == 0 { -- pa_threaded_mainloop_lock(self.context.mainloop); -- } -- -- let mut r_usec: pa_usec_t = Default::default(); -- let r = pa_stream_get_time(self.output_stream, &mut r_usec); -- if in_thread == 0 { -- pa_threaded_mainloop_unlock(self.context.mainloop); -- } -- -- if r != 0 { -- return Err(cubeb::ERROR); -- } -+ if !in_thread { -+ self.context.mainloop.lock(); -+ } - -- let bytes = pa_usec_to_bytes(r_usec, &self.output_sample_spec); -- (bytes / pa_frame_size(&self.output_sample_spec)) as u64 -+ let r = match self.output_stream { -+ None => Err(cubeb::ERROR), -+ Some(ref stm) => { -+ match stm.get_time() { -+ Ok(r_usec) => { -+ let bytes = r_usec.to_bytes(&self.output_sample_spec); -+ Ok((bytes / self.output_sample_spec.frame_size()) as u64) -+ }, -+ Err(_) => Err(cubeb::ERROR), -+ } -+ }, - }; -- Ok(position) -- } - -- pub fn latency(&self) -> Result { -- if self.output_stream.is_null() { -- return Err(cubeb::ERROR); -+ if !in_thread { -+ self.context.mainloop.unlock(); - } - -- let mut r_usec: pa_usec_t = 0; -- let mut negative: i32 = 0; -- let r = unsafe { pa_stream_get_latency(self.output_stream, &mut r_usec, &mut negative) }; -+ r -+ } - -- if r != 0 { -- return Err(cubeb::ERROR); -+ pub fn latency(&self) -> Result { -+ match self.output_stream { -+ None => Err(cubeb::ERROR), -+ Some(ref stm) => { -+ match stm.get_latency() { -+ Ok((r_usec, negative)) => { -+ debug_assert!(negative); -+ let latency = (r_usec * self.output_sample_spec.rate as pa_usec_t / PA_USEC_PER_SEC) as u32; -+ Ok(latency) -+ }, -+ Err(_) => Err(cubeb::ERROR), -+ } -+ }, - } -- -- debug_assert_eq!(negative, 0); -- let latency = (r_usec * self.output_sample_spec.rate as pa_usec_t / PA_USEC_PER_SEC) as u32; -- -- Ok(latency) - } - - pub fn set_volume(&mut self, volume: f32) -> i32 { -- if self.output_stream.is_null() { -- return cubeb::ERROR; -- } -- -- unsafe { -- pa_threaded_mainloop_lock(self.context.mainloop); -- -- while self.context.default_sink_info.is_none() { -- pa_threaded_mainloop_wait(self.context.mainloop); -- } -- -- let mut cvol: pa_cvolume = Default::default(); -- -- /* if the pulse daemon is configured to use flat volumes, -- * apply our own gain instead of changing the input volume on the sink. */ -- let flags = { -- match self.context.default_sink_info { -- Some(ref info) => info.flags, -- _ => 0, -- } -- }; -- -- if (flags & PA_SINK_FLAT_VOLUME) != 0 { -- self.volume = volume; -- } else { -- let ss = pa_stream_get_sample_spec(self.output_stream); -- let vol = pa_sw_volume_from_linear(volume as f64); -- pa_cvolume_set(&mut cvol, (*ss).channels as u32, vol); -- -- let index = pa_stream_get_index(self.output_stream); -+ match self.output_stream { -+ None => cubeb::ERROR, -+ Some(ref stm) => { -+ if let Some(ref context) = self.context.context { -+ self.context.mainloop.lock(); -+ -+ let mut cvol: pa_cvolume = Default::default(); -+ -+ /* if the pulse daemon is configured to use flat -+ * volumes, apply our own gain instead of changing -+ * the input volume on the sink. */ -+ let flags = { -+ match self.context.default_sink_info { -+ Some(ref info) => info.flags, -+ _ => pulse::SinkFlags::empty(), -+ } -+ }; -+ -+ if flags.contains(pulse::SINK_FLAT_VOLUME) { -+ self.volume = volume; -+ } else { -+ let channels = stm.get_sample_spec().channels; -+ let vol = pulse::sw_volume_from_linear(volume as f64); -+ cvol.set(channels as u32, vol); -+ -+ let index = stm.get_index(); -+ -+ let context_ptr = self.context as *const _ as *mut _; -+ if let Ok(o) = context.set_sink_input_volume(index, &cvol, context_success, context_ptr) { -+ self.context.operation_wait(stm, &o); -+ } -+ } - -- let op = pa_context_set_sink_input_volume(self.context.context, -- index, -- &cvol, -- Some(volume_success), -- self as *mut _ as *mut _); -- if !op.is_null() { -- self.context.operation_wait(self.output_stream, op); -- pa_operation_unref(op); -+ self.context.mainloop.unlock(); -+ cubeb::OK -+ } else { -+ cubeb::ERROR - } -- } -- -- pa_threaded_mainloop_unlock(self.context.mainloop); -+ }, - } -- cubeb::OK - } - - pub fn set_panning(&mut self, panning: f32) -> i32 { -- if self.output_stream.is_null() { -- return cubeb::ERROR; -- } -+ #[repr(C)] -+ struct SinkInputInfoResult<'a> { -+ pub cvol: pulse::CVolume, -+ pub mainloop: &'a pulse::ThreadedMainloop, -+ } -+ -+ fn get_input_volume(_: &pulse::Context, info: *const pulse::SinkInputInfo, eol: i32, u: *mut c_void) { -+ let mut r = unsafe { &mut *(u as *mut SinkInputInfoResult) }; -+ if eol == 0 { -+ let info = unsafe { *info }; -+ r.cvol = info.volume; -+ } -+ r.mainloop.signal(); -+ } -+ -+ match self.output_stream { -+ None => cubeb::ERROR, -+ Some(ref stm) => { -+ if let Some(ref context) = self.context.context { -+ self.context.mainloop.lock(); -+ -+ let map = stm.get_channel_map(); -+ if !map.can_balance() { -+ self.context.mainloop.unlock(); -+ return cubeb::ERROR; -+ } - -- unsafe { -- pa_threaded_mainloop_lock(self.context.mainloop); -+ let index = stm.get_index(); - -- let map = pa_stream_get_channel_map(self.output_stream); -- if pa_channel_map_can_balance(map) == 0 { -- pa_threaded_mainloop_unlock(self.context.mainloop); -- return cubeb::ERROR; -- } -+ let mut r = SinkInputInfoResult { -+ cvol: pulse::CVolume::default(), -+ mainloop: &self.context.mainloop, -+ }; - -- let index = pa_stream_get_index(self.output_stream); -+ if let Ok(o) = context.get_sink_input_info(index, get_input_volume, &mut r as *mut _ as *mut _) { -+ self.context.operation_wait(stm, &o); -+ } - -- let mut cvol: pa_cvolume = Default::default(); -- let mut r = SinkInputInfoResult { -- cvol: &mut cvol, -- mainloop: self.context.mainloop, -- }; -+ r.cvol.set_balance(map, panning); - -- let op = pa_context_get_sink_input_info(self.context.context, -- index, -- Some(sink_input_info_cb), -- &mut r as *mut _ as *mut _); -- if !op.is_null() { -- self.context.operation_wait(self.output_stream, op); -- pa_operation_unref(op); -- } -- -- pa_cvolume_set_balance(&mut cvol, map, panning); -- -- let op = pa_context_set_sink_input_volume(self.context.context, -- index, -- &cvol, -- Some(volume_success), -- self as *mut _ as *mut _); -- if !op.is_null() { -- self.context.operation_wait(self.output_stream, op); -- pa_operation_unref(op); -- } -+ let context_ptr = self.context as *const _ as *mut _; -+ if let Ok(o) = context.set_sink_input_volume(index, &r.cvol, context_success, context_ptr) { -+ self.context.operation_wait(stm, &o); -+ } - -- pa_threaded_mainloop_unlock(self.context.mainloop); -- } -+ self.context.mainloop.unlock(); - -- cubeb::OK -+ cubeb::OK -+ } else { -+ cubeb::ERROR -+ } -+ }, -+ } - } - - pub fn current_device(&self) -> Result> { - if self.context.version_0_9_8 { - let mut dev = Box::new(cubeb::Device::default()); - -- if !self.input_stream.is_null() { -- dev.input_name = unsafe { pa_xstrdup(pa_stream_get_device_name(self.input_stream)) }; -+ if self.input_stream.is_some() { -+ if let Some(ref stm) = self.input_stream { -+ dev.input_name = match stm.get_device_name() { -+ Ok(name) => name.to_owned().into_raw(), -+ Err(_) => { -+ return Err(cubeb::ERROR); -+ }, -+ } -+ } - } - -- if !self.output_stream.is_null() { -- dev.output_name = unsafe { pa_xstrdup(pa_stream_get_device_name(self.output_stream)) }; -+ if !self.output_stream.is_some() { -+ if let Some(ref stm) = self.output_stream { -+ dev.output_name = match stm.get_device_name() { -+ Ok(name) => name.to_owned().into_raw(), -+ Err(_) => { -+ return Err(cubeb::ERROR); -+ }, -+ } -+ } - } - - Ok(dev) -@@ -445,51 +557,62 @@ impl<'ctx> Stream<'ctx> { - } - } - -- fn pulse_stream_init(&mut self, -- stream_params: &cubeb::StreamParams, -- stream_name: *const c_char) -- -> Result<*mut pa_stream> { -+ fn stream_init(context: &pulse::Context, -+ stream_params: &cubeb::StreamParams, -+ stream_name: &CStr) -+ -> Result { - -- fn to_pulse_format(format: cubeb::SampleFormat) -> pa_sample_format_t { -+ fn to_pulse_format(format: cubeb::SampleFormat) -> pulse::SampleFormat { - match format { -- cubeb::SAMPLE_S16LE => PA_SAMPLE_S16LE, -- cubeb::SAMPLE_S16BE => PA_SAMPLE_S16BE, -- cubeb::SAMPLE_FLOAT32LE => PA_SAMPLE_FLOAT32LE, -- cubeb::SAMPLE_FLOAT32BE => PA_SAMPLE_FLOAT32BE, -- _ => panic!("Invalid format: {:?}", format), -+ cubeb::SAMPLE_S16LE => pulse::SampleFormat::Signed16LE, -+ cubeb::SAMPLE_S16BE => pulse::SampleFormat::Signed16BE, -+ cubeb::SAMPLE_FLOAT32LE => pulse::SampleFormat::Float32LE, -+ cubeb::SAMPLE_FLOAT32BE => pulse::SampleFormat::Float32BE, -+ _ => pulse::SampleFormat::Invalid, - } - } - - let fmt = to_pulse_format(stream_params.format); -- if fmt == PA_SAMPLE_INVALID { -+ if fmt == pulse::SampleFormat::Invalid { - return Err(cubeb::ERROR_INVALID_FORMAT); - } - -- let ss = pa_sample_spec { -+ let ss = pulse::SampleSpec { - channels: stream_params.channels as u8, -- format: fmt, -+ format: fmt.into(), - rate: stream_params.rate, - }; - -- let stream = if stream_params.layout == cubeb::LAYOUT_UNDEFINED { -- unsafe { pa_stream_new(self.context.context, stream_name, &ss, ptr::null_mut()) } -- } else { -- let cm = layout_to_channel_map(stream_params.layout); -- unsafe { pa_stream_new(self.context.context, stream_name, &ss, &cm) } -+ let cm: Option = match stream_params.layout { -+ cubeb::LAYOUT_UNDEFINED => None, -+ _ => Some(layout_to_channel_map(stream_params.layout)), - }; - -- if !stream.is_null() { -- Ok(stream) -- } else { -- Err(cubeb::ERROR) -+ let stream = pulse::Stream::new(context, stream_name, &ss, cm.as_ref()); -+ -+ match stream { -+ None => Err(cubeb::ERROR), -+ Some(stm) => Ok(stm), -+ } -+ } -+ -+ pub fn cork_stream(&self, stream: Option<&pulse::Stream>, state: CorkState) { -+ if let Some(stm) = stream { -+ if let Ok(o) = stm.cork(state.is_cork() as i32, -+ stream_success, -+ self as *const _ as *mut _) { -+ self.context.operation_wait(stream, &o); -+ } - } - } - -- fn stream_cork(&mut self, state: CorkState) { -- unsafe { pa_threaded_mainloop_lock(self.context.mainloop) }; -- self.context.pulse_stream_cork(self.output_stream, state); -- self.context.pulse_stream_cork(self.input_stream, state); -- unsafe { pa_threaded_mainloop_unlock(self.context.mainloop) }; -+ fn cork(&mut self, state: CorkState) { -+ { -+ self.context.mainloop.lock(); -+ self.cork_stream(self.output_stream.as_ref(), state); -+ self.cork_stream(self.input_stream.as_ref(), state); -+ self.context.mainloop.unlock() -+ } - - if state.is_notify() { - self.state_change_callback(if state.is_cork() { -@@ -503,18 +626,9 @@ impl<'ctx> Stream<'ctx> { - fn update_timing_info(&self) -> bool { - let mut r = false; - -- if !self.output_stream.is_null() { -- let o = unsafe { -- pa_stream_update_timing_info(self.output_stream, -- Some(stream_success_callback), -- self as *const _ as *mut _) -- }; -- -- if !o.is_null() { -- r = self.context.operation_wait(self.output_stream, o); -- unsafe { -- pa_operation_unref(o); -- } -+ if let Some(ref stm) = self.output_stream { -+ if let Ok(o) = stm.update_timing_info(stream_success, self as *const _ as *mut _) { -+ r = self.context.operation_wait(stm, &o); - } - - if !r { -@@ -522,18 +636,9 @@ impl<'ctx> Stream<'ctx> { - } - } - -- if !self.input_stream.is_null() { -- let o = unsafe { -- pa_stream_update_timing_info(self.input_stream, -- Some(stream_success_callback), -- self as *const _ as *mut _) -- }; -- -- if !o.is_null() { -- r = self.context.operation_wait(self.input_stream, o); -- unsafe { -- pa_operation_unref(o); -- } -+ if let Some(ref stm) = self.input_stream { -+ if let Ok(o) = stm.update_timing_info(stream_success, self as *const _ as *mut _) { -+ r = self.context.operation_wait(stm, &o); - } - } - -@@ -547,232 +652,162 @@ impl<'ctx> Stream<'ctx> { - } - } - -- fn wait_until_stream_ready(&self) -> bool { -- if !self.output_stream.is_null() && !wait_until_io_stream_ready(self.output_stream, self.context.mainloop) { -- return false; -- } -- -- if !self.input_stream.is_null() && !wait_until_io_stream_ready(self.input_stream, self.context.mainloop) { -- return false; -- } -- -- true -- } -- -- fn trigger_user_callback(&mut self, s: *mut pa_stream, input_data: *const c_void, nbytes: usize) { -- let frame_size = unsafe { pa_frame_size(&self.output_sample_spec) }; -- debug_assert_eq!(nbytes % frame_size, 0); -- -- let mut buffer: *mut c_void = ptr::null_mut(); -- let mut r: i32; -- -- let mut towrite = nbytes; -- let mut read_offset = 0usize; -- while towrite > 0 { -- let mut size = towrite; -- r = unsafe { pa_stream_begin_write(s, &mut buffer, &mut size) }; -- // Note: this has failed running under rr on occassion - needs investigation. -- debug_assert_eq!(r, 0); -- debug_assert!(size > 0); -- debug_assert_eq!(size % frame_size, 0); -- -- logv!("Trigger user callback with output buffer size={}, read_offset={}", -- size, -- read_offset); -- let read_ptr = unsafe { (input_data as *const u8).offset(read_offset as isize) }; -- let got = unsafe { -- self.data_callback.unwrap()(self as *const _ as *mut _, -- self.user_ptr, -- read_ptr as *const _ as *mut _, -- buffer, -- (size / frame_size) as c_long) -- }; -- if got < 0 { -- unsafe { -- pa_stream_cancel_write(s); -- } -- self.shutdown = true; -- return; -- } -- // If more iterations move offset of read buffer -- if !input_data.is_null() { -- let in_frame_size = unsafe { pa_frame_size(&self.input_sample_spec) }; -- read_offset += (size / frame_size) * in_frame_size; -+ fn wait_until_ready(&self) -> bool { -+ fn wait_until_io_stream_ready(stm: &pulse::Stream, mainloop: &pulse::ThreadedMainloop) -> bool { -+ if mainloop.is_null() { -+ return false; - } - -- if self.volume != PULSE_NO_GAIN { -- let samples = (self.output_sample_spec.channels as usize * size / frame_size) as isize; -- -- if self.output_sample_spec.format == PA_SAMPLE_S16BE || -- self.output_sample_spec.format == PA_SAMPLE_S16LE { -- let b = buffer as *mut i16; -- for i in 0..samples { -- unsafe { *b.offset(i) *= self.volume as i16 }; -- } -- } else { -- let b = buffer as *mut f32; -- for i in 0..samples { -- unsafe { *b.offset(i) *= self.volume }; -- } -+ loop { -+ let state = stm.get_state(); -+ if !state.is_good() { -+ return false; -+ } -+ if state == pulse::StreamState::Ready { -+ break; - } -+ mainloop.wait(); - } - -- r = unsafe { -- pa_stream_write(s, -- buffer, -- got as usize * frame_size, -- None, -- 0, -- PA_SEEK_RELATIVE) -- }; -- debug_assert_eq!(r, 0); -+ true -+ } - -- if (got as usize) < size / frame_size { -- let mut latency: pa_usec_t = 0; -- let rr: i32 = unsafe { pa_stream_get_latency(s, &mut latency, ptr::null_mut()) }; -- if rr == -(PA_ERR_NODATA as i32) { -- /* this needs a better guess. */ -- latency = 100 * PA_USEC_PER_MSEC; -- } -- debug_assert!(r == 0 || r == -(PA_ERR_NODATA as i32)); -- /* pa_stream_drain is useless, see PA bug# 866. this is a workaround. */ -- /* arbitrary safety margin: double the current latency. */ -- debug_assert!(self.drain_timer.is_null()); -- self.drain_timer = unsafe { -- pa_context_rttime_new(self.context.context, -- pa_rtclock_now() + 2 * latency, -- Some(stream_drain_callback), -- self as *const _ as *mut _) -- }; -- self.shutdown = true; -- return; -+ if let Some(ref stm) = self.output_stream { -+ if !wait_until_io_stream_ready(stm, &self.context.mainloop) { -+ return false; - } -- -- towrite -= size; - } - -- debug_assert_eq!(towrite, 0); -- } --} -- --unsafe extern "C" fn stream_success_callback(_s: *mut pa_stream, _success: i32, u: *mut c_void) { -- let stm = &*(u as *mut Stream); -- pa_threaded_mainloop_signal(stm.context.mainloop, 0); --} -- --unsafe extern "C" fn stream_drain_callback(a: *mut pa_mainloop_api, -- e: *mut pa_time_event, -- _tv: *const timeval, -- u: *mut c_void) { -- let mut stm = &mut *(u as *mut Stream); -- debug_assert_eq!(stm.drain_timer, e); -- stm.state_change_callback(cubeb::STATE_DRAINED); -- /* there's no pa_rttime_free, so use this instead. */ -- (*a).time_free.unwrap()(stm.drain_timer); -- stm.drain_timer = ptr::null_mut(); -- pa_threaded_mainloop_signal(stm.context.mainloop, 0); --} -- --unsafe extern "C" fn stream_state_callback(s: *mut pa_stream, u: *mut c_void) { -- let stm = &mut *(u as *mut Stream); -- if !PA_STREAM_IS_GOOD(pa_stream_get_state(s)) { -- stm.state_change_callback(cubeb::STATE_ERROR); -- } -- pa_threaded_mainloop_signal(stm.context.mainloop, 0); --} -- --fn read_from_input(s: *mut pa_stream, buffer: *mut *const c_void, size: *mut usize) -> i32 { -- let readable_size = unsafe { pa_stream_readable_size(s) }; -- if readable_size > 0 && unsafe { pa_stream_peek(s, buffer, size) } < 0 { -- return -1; -- } -- -- readable_size as i32 --} -+ if let Some(ref stm) = self.input_stream { -+ if !wait_until_io_stream_ready(stm, &self.context.mainloop) { -+ return false; -+ } -+ } - --unsafe extern "C" fn stream_write_callback(s: *mut pa_stream, nbytes: usize, u: *mut c_void) { -- logv!("Output callback to be written buffer size {}", nbytes); -- let mut stm = &mut *(u as *mut Stream); -- if stm.shutdown || stm.state != cubeb::STATE_STARTED { -- return; -+ true - } - -- if stm.input_stream.is_null() { -- // Output/playback only operation. -- // Write directly to output -- debug_assert!(!stm.output_stream.is_null()); -- stm.trigger_user_callback(s, ptr::null(), nbytes); -- } --} -+ fn trigger_user_callback(&mut self, input_data: *const c_void, nbytes: usize) { -+ fn drained_cb(a: &pulse::MainloopApi, e: *mut pa_time_event, _tv: &pulse::TimeVal, u: *mut c_void) { -+ let mut stm = unsafe { &mut *(u as *mut Stream) }; -+ debug_assert_eq!(stm.drain_timer, e); -+ stm.state_change_callback(cubeb::STATE_DRAINED); -+ /* there's no pa_rttime_free, so use this instead. */ -+ a.time_free(stm.drain_timer); -+ stm.drain_timer = ptr::null_mut(); -+ stm.context.mainloop.signal(); -+ } -+ -+ if let Some(ref stm) = self.output_stream { -+ -+ let frame_size = self.output_sample_spec.frame_size(); -+ debug_assert_eq!(nbytes % frame_size, 0); -+ -+ let mut towrite = nbytes; -+ let mut read_offset = 0usize; -+ while towrite > 0 { -+ match stm.begin_write(towrite) { -+ Err(e) => { -+ panic!("Failed to write data: {}", e); -+ }, -+ Ok((buffer, size)) => { -+ debug_assert!(size > 0); -+ debug_assert_eq!(size % frame_size, 0); -+ -+ logv!("Trigger user callback with output buffer size={}, read_offset={}", -+ size, -+ read_offset); -+ let read_ptr = unsafe { (input_data as *const u8).offset(read_offset as isize) }; -+ let got = unsafe { -+ self.data_callback.unwrap()(self as *const _ as *mut _, -+ self.user_ptr, -+ read_ptr as *const _ as *mut _, -+ buffer, -+ (size / frame_size) as c_long) -+ }; -+ if got < 0 { -+ let _ = stm.cancel_write(); -+ self.shutdown = true; -+ return; -+ } -+ -+ // If more iterations move offset of read buffer -+ if !input_data.is_null() { -+ let in_frame_size = self.input_sample_spec.frame_size(); -+ read_offset += (size / frame_size) * in_frame_size; -+ } -+ -+ if self.volume != PULSE_NO_GAIN { -+ let samples = (self.output_sample_spec.channels as usize * size / frame_size) as isize; -+ -+ if self.output_sample_spec.format == PA_SAMPLE_S16BE || -+ self.output_sample_spec.format == PA_SAMPLE_S16LE { -+ let b = buffer as *mut i16; -+ for i in 0..samples { -+ unsafe { *b.offset(i) *= self.volume as i16 }; -+ } -+ } else { -+ let b = buffer as *mut f32; -+ for i in 0..samples { -+ unsafe { *b.offset(i) *= self.volume }; -+ } -+ } -+ } -+ -+ let r = stm.write(buffer, -+ got as usize * frame_size, -+ 0, -+ pulse::SeekMode::Relative); -+ debug_assert!(r.is_ok()); -+ -+ if (got as usize) < size / frame_size { -+ let latency = match stm.get_latency() { -+ Ok((l, negative)) => { -+ assert_ne!(negative, true); -+ l -+ }, -+ Err(e) => { -+ debug_assert_eq!(e, pulse::ErrorCode::from_error_code(PA_ERR_NODATA)); -+ /* this needs a better guess. */ -+ 100 * PA_USEC_PER_MSEC -+ }, -+ }; -+ -+ /* pa_stream_drain is useless, see PA bug# 866. this is a workaround. */ -+ /* arbitrary safety margin: double the current latency. */ -+ debug_assert!(self.drain_timer.is_null()); -+ let stream_ptr = self as *const _ as *mut _; -+ if let Some(ref context) = self.context.context { -+ self.drain_timer = -+ context.rttime_new(pulse::rtclock_now() + 2 * latency, drained_cb, stream_ptr); -+ } -+ self.shutdown = true; -+ return; -+ } - --unsafe extern "C" fn stream_read_callback(s: *mut pa_stream, nbytes: usize, u: *mut c_void) { -- logv!("Input callback buffer size {}", nbytes); -- let mut stm = &mut *(u as *mut Stream); -- if stm.shutdown { -- return; -- } -- -- let mut read_data: *const c_void = ptr::null(); -- let mut read_size: usize = 0; -- while read_from_input(s, &mut read_data, &mut read_size) > 0 { -- /* read_data can be NULL in case of a hole. */ -- if !read_data.is_null() { -- let in_frame_size = pa_frame_size(&stm.input_sample_spec); -- let read_frames = read_size / in_frame_size; -- -- if !stm.output_stream.is_null() { -- // input/capture + output/playback operation -- let out_frame_size = pa_frame_size(&stm.output_sample_spec); -- let write_size = read_frames * out_frame_size; -- // Offer full duplex data for writing -- let stream = stm.output_stream; -- stm.trigger_user_callback(stream, read_data, write_size); -- } else { -- // input/capture only operation. Call callback directly -- let got = stm.data_callback.unwrap()(stm as *mut _ as *mut _, -- stm.user_ptr, -- read_data, -- ptr::null_mut(), -- read_frames as c_long); -- if got < 0 || got as usize != read_frames { -- pa_stream_cancel_write(s); -- stm.shutdown = true; -- break; -+ towrite -= size; -+ }, - } - } -- } -- -- if read_size > 0 { -- pa_stream_drop(s); -- } -- -- if stm.shutdown { -- return; -+ debug_assert_eq!(towrite, 0); - } - } - } - --fn wait_until_io_stream_ready(stream: *mut pa_stream, mainloop: *mut pa_threaded_mainloop) -> bool { -- if stream.is_null() || mainloop.is_null() { -- return false; -- } -- -- loop { -- let state = unsafe { pa_stream_get_state(stream) }; -- if !PA_STREAM_IS_GOOD(state) { -- return false; -- } -- if state == PA_STREAM_READY { -- break; -- } -- unsafe { pa_threaded_mainloop_wait(mainloop) }; -- } -+fn stream_success(_: &pulse::Stream, success: i32, u: *mut c_void) { -+ let stm = unsafe { &*(u as *mut Stream) }; -+ debug_assert_ne!(success, 0); -+ stm.context.mainloop.signal(); -+} - -- true -+fn context_success(_: &pulse::Context, success: i32, u: *mut c_void) { -+ let ctx = unsafe { &*(u as *mut Context) }; -+ debug_assert_ne!(success, 0); -+ ctx.mainloop.signal(); - } - - fn set_buffering_attribute(latency_frames: u32, sample_spec: &pa_sample_spec) -> pa_buffer_attr { -- let tlength = latency_frames * unsafe { pa_frame_size(sample_spec) } as u32; -+ let tlength = latency_frames * sample_spec.frame_size() as u32; - let minreq = tlength / 4; - let battr = pa_buffer_attr { - maxlength: u32::max_value(), -@@ -791,34 +826,3 @@ fn set_buffering_attribute(latency_frame - - battr - } -- --unsafe extern "C" fn pulse_defer_event_cb(_a: *mut pa_mainloop_api, u: *mut c_void) { -- let mut stm = &mut *(u as *mut Stream); -- if stm.shutdown { -- return; -- } -- let writable_size = pa_stream_writable_size(stm.output_stream); -- let stream = stm.output_stream; -- stm.trigger_user_callback(stream, ptr::null_mut(), writable_size); --} -- --#[repr(C)] --struct SinkInputInfoResult { -- pub cvol: *mut pa_cvolume, -- pub mainloop: *mut pa_threaded_mainloop, --} -- --unsafe extern "C" fn sink_input_info_cb(_c: *mut pa_context, i: *const pa_sink_input_info, eol: i32, u: *mut c_void) { -- let info = &*i; -- let mut r = &mut *(u as *mut SinkInputInfoResult); -- if eol == 0 { -- *r.cvol = info.volume; -- } -- pa_threaded_mainloop_signal(r.mainloop, 0); --} -- --unsafe extern "C" fn volume_success(_c: *mut pa_context, success: i32, u: *mut c_void) { -- let stm = &*(u as *mut Stream); -- debug_assert_ne!(success, 0); -- pa_threaded_mainloop_signal(stm.context.mainloop, 0); --} -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/src/capi.rs.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/src/capi.rs ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/src/capi.rs.cubeb-pulse-arm 2017-07-31 18:20:49.000000000 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/src/capi.rs 2017-08-04 13:37:46.387821728 +0200 -@@ -5,6 +5,7 @@ - - use backend; - use cubeb; -+use std::ffi::CStr; - use std::os::raw::{c_char, c_void}; - - unsafe extern "C" fn capi_init(c: *mut *mut cubeb::Context, context_name: *const c_char) -> i32 { -@@ -114,21 +115,18 @@ unsafe extern "C" fn capi_stream_init(c: - state_callback: cubeb::StateCallback, - user_ptr: *mut c_void) - -> i32 { -+ fn try_stream_params_from(sp: *mut cubeb::StreamParams) -> Option { -+ if sp.is_null() { None } else { Some(unsafe { *sp }) } -+ } -+ - let mut ctx = &mut *(c as *mut backend::Context); -+ let stream_name = CStr::from_ptr(stream_name); - - match ctx.new_stream(stream_name, - input_device, -- if input_stream_params.is_null() { -- None -- } else { -- Some(*input_stream_params) -- }, -+ try_stream_params_from(input_stream_params), - output_device, -- if output_stream_params.is_null() { -- None -- } else { -- Some(*output_stream_params) -- }, -+ try_stream_params_from(output_stream_params), - latency_frames, - data_callback, - state_callback, -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/src/lib.rs.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/src/lib.rs ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/src/lib.rs.cubeb-pulse-arm 2017-07-31 18:20:49.000000000 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/src/lib.rs 2017-08-04 13:37:46.387821728 +0200 -@@ -8,6 +8,7 @@ - #[macro_use] - extern crate cubeb_ffi as cubeb; - extern crate pulse_ffi; -+extern crate pulse; - extern crate semver; - - mod capi; -diff -up firefox-55.0/media/libcubeb/cubeb-pulse-rs/update.sh.cubeb-pulse-arm firefox-55.0/media/libcubeb/cubeb-pulse-rs/update.sh ---- firefox-55.0/media/libcubeb/cubeb-pulse-rs/update.sh.cubeb-pulse-arm 2017-07-31 18:20:49.000000000 +0200 -+++ firefox-55.0/media/libcubeb/cubeb-pulse-rs/update.sh 2017-08-04 13:37:46.383821740 +0200 -@@ -13,6 +13,9 @@ cp -pr $1/cubeb-ffi/src/* cubeb-ffi/src/ - test -d pulse-ffi/src || mkdir -p pulse-ffi/src - cp -pr $1/pulse-ffi/Cargo.toml pulse-ffi/ - cp -pr $1/pulse-ffi/src/* pulse-ffi/src/ -+test -d pulse-rs/src || mkdir -p pulse-rs/src -+cp -pr $1/pulse-rs/Cargo.toml pulse-rs/ -+cp -pr $1/pulse-rs/src/* pulse-rs/src/ - - if [ -d $1/.git ]; then - rev=$(cd $1 && git rev-parse --verify HEAD) -diff -up firefox-55.0/toolkit/library/gtest/rust/Cargo.lock.cubeb-pulse-arm firefox-55.0/toolkit/library/gtest/rust/Cargo.lock ---- firefox-55.0/toolkit/library/gtest/rust/Cargo.lock.cubeb-pulse-arm 2017-08-04 13:37:46.388821725 +0200 -+++ firefox-55.0/toolkit/library/gtest/rust/Cargo.lock 2017-08-04 13:59:15.592940994 +0200 -@@ -252,6 +252,7 @@ name = "cubeb-pulse" - version = "0.0.1" - dependencies = [ - "cubeb-ffi 0.0.1", -+ "pulse 0.1.0", - "pulse-ffi 0.1.0", - "semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - ] -@@ -660,6 +661,14 @@ version = "0.1.1" - source = "registry+https://github.com/rust-lang/crates.io-index" - - [[package]] -+name = "pulse" -+version = "0.1.0" -+dependencies = [ -+ "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", -+ "pulse-ffi 0.1.0", -+] -+ -+[[package]] - name = "pulse-ffi" - version = "0.1.0" - dependencies = [ -diff -up firefox-55.0/toolkit/library/rust/Cargo.lock.cubeb-pulse-arm firefox-55.0/toolkit/library/rust/Cargo.lock ---- firefox-55.0/toolkit/library/rust/Cargo.lock.cubeb-pulse-arm 2017-08-04 13:37:46.388821725 +0200 -+++ firefox-55.0/toolkit/library/rust/Cargo.lock 2017-08-04 13:52:24.551163669 +0200 -@@ -250,6 +250,7 @@ name = "cubeb-pulse" - version = "0.0.1" - dependencies = [ - "cubeb-ffi 0.0.1", -+ "pulse 0.1.0", - "pulse-ffi 0.1.0", - "semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - ] -@@ -647,6 +648,14 @@ version = "0.1.1" - source = "registry+https://github.com/rust-lang/crates.io-index" - - [[package]] -+name = "pulse" -+version = "0.1.0" -+dependencies = [ -+ "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", -+ "pulse-ffi 0.1.0", -+] -+ -+[[package]] - name = "pulse-ffi" - version = "0.1.0" - dependencies = [ diff --git a/build-disable-elfhack.patch b/build-disable-elfhack.patch deleted file mode 100644 index a80c551..0000000 --- a/build-disable-elfhack.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up firefox-65.0/toolkit/moz.configure.disable-elfhack firefox-65.0/toolkit/moz.configure ---- firefox-65.0/toolkit/moz.configure.disable-elfhack 2019-01-28 14:16:48.530345132 +0100 -+++ firefox-65.0/toolkit/moz.configure 2019-01-28 14:18:03.231029682 +0100 -@@ -1036,7 +1036,7 @@ with only_when('--enable-compile-environ - help='{Enable|Disable} elf hacks') - - set_config('USE_ELF_HACK', -- depends_if('--enable-elf-hack')(lambda _: True)) -+ depends_if('--enable-elf-hack')(lambda _: False)) - - - @depends(check_build_environment) diff --git a/build-icu-big-endian.patch b/build-icu-big-endian.patch deleted file mode 100644 index 0be2d3c..0000000 --- a/build-icu-big-endian.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up firefox-61.0/build/autoconf/icu.m4.icu firefox-61.0/build/autoconf/icu.m4 ---- firefox-61.0/build/autoconf/icu.m4.icu 2018-06-20 09:03:17.957565445 +0200 -+++ firefox-61.0/build/autoconf/icu.m4 2018-06-20 09:08:28.159403451 +0200 -@@ -77,7 +77,7 @@ if test -n "$USE_ICU"; then - # TODO: the l is actually endian-dependent - # We could make this set as 'l' or 'b' for little or big, respectively, - # but we'd need to check in a big-endian version of the file. -- ICU_DATA_FILE="icudt${version}l.dat" -+ ICU_DATA_FILE="icudt${version}b.dat" - fi - - AC_SUBST(MOZ_ICU_VERSION) diff --git a/build-jit-atomic-always-lucky.patch b/build-jit-atomic-always-lucky.patch deleted file mode 100644 index ab99524..0000000 --- a/build-jit-atomic-always-lucky.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up firefox-60.5.0/js/src/jit/AtomicOperations.h.jit-atomic-lucky firefox-60.5.0/js/src/jit/AtomicOperations.h ---- firefox-60.5.0/js/src/jit/AtomicOperations.h.jit-atomic-lucky 2019-01-22 10:20:27.993697161 +0100 -+++ firefox-60.5.0/js/src/jit/AtomicOperations.h 2019-01-22 10:23:15.337873762 +0100 -@@ -394,7 +394,7 @@ inline bool AtomicOperations::isLockfree - #elif defined(__s390__) || defined(__s390x__) - #include "jit/none/AtomicOperations-feeling-lucky.h" - #else --#error "No AtomicOperations support provided for this platform" -+#include "jit/none/AtomicOperations-feeling-lucky.h" - #endif - - #endif // jit_AtomicOperations_h diff --git a/build-ppc-jit.patch b/build-ppc-jit.patch deleted file mode 100644 index a9dc6d1..0000000 --- a/build-ppc-jit.patch +++ /dev/null @@ -1,51 +0,0 @@ -diff -up firefox-55.0/js/src/jit/MIR.h.old firefox-55.0/js/src/jit/MIR.h ---- firefox-55.0/js/src/jit/MIR.h.old 2017-08-08 14:04:44.528460099 +0200 -+++ firefox-55.0/js/src/jit/MIR.h 2017-08-08 14:05:11.045364831 +0200 -@@ -12434,7 +12434,7 @@ class MNearbyInt - TRIVIAL_NEW_WRAPPERS - - static bool HasAssemblerSupport(RoundingMode mode) { -- return Assembler::HasRoundInstruction(mode); -+ return false; - } - - RoundingMode roundingMode() const { return roundingMode_; } -diff -up firefox-55.0/js/src/jit/ExecutableAllocator.h.old firefox-55.0/js/src/jit/ExecutableAllocator.h ---- firefox-55.0/js/src/jit/ExecutableAllocator.h.old 2017-08-09 09:24:18.784983505 +0200 -+++ firefox-55.0/js/src/jit/ExecutableAllocator.h 2017-08-09 09:28:01.471100075 +0200 -@@ -307,6 +307,10 @@ class ExecutableAllocator - { - sync_instruction_memory((caddr_t)code, size); - } -+#else -+ static void cacheFlush(void*, size_t) -+ { -+ } - #endif - - private: -diff -up firefox-55.0/js/src/wasm/WasmBuiltins.cpp.old firefox-55.0/js/src/wasm/WasmBuiltins.cpp ---- firefox-55.0/js/src/wasm/WasmBuiltins.cpp.old 2017-08-09 12:50:46.877450765 +0200 -+++ firefox-55.0/js/src/wasm/WasmBuiltins.cpp 2017-08-09 12:50:59.725406974 +0200 -@@ -881,7 +881,6 @@ wasm::EnsureBuiltinThunksInitialized() - MOZ_ASSERT(!masm.numSymbolicAccesses()); - #endif - -- ExecutableAllocator::cacheFlush(thunks->codeBase, thunks->codeSize); - if (!ExecutableAllocator::makeExecutable(thunks->codeBase, thunks->codeSize)) - return false; - -diff -up firefox-55.0/js/src/wasm/WasmCode.cpp.old firefox-55.0/js/src/wasm/WasmCode.cpp ---- firefox-55.0/js/src/wasm/WasmCode.cpp.old 2017-08-09 12:50:37.205483731 +0200 -+++ firefox-55.0/js/src/wasm/WasmCode.cpp 2017-08-09 12:51:10.365370708 +0200 -@@ -287,8 +287,6 @@ CodeSegment::initialize(Tier tier, - if (!StaticallyLink(*this, linkData)) - return false; - -- ExecutableAllocator::cacheFlush(bytes_.get(), RoundupCodeLength(codeLength)); -- - // Reprotect the whole region to avoid having separate RW and RX mappings. - if (!ExecutableAllocator::makeExecutable(bytes_.get(), RoundupCodeLength(codeLength))) - return false; -diff -up firefox-55.0/media/libyuv/libyuv/tools_libyuv/autoroller/unittests/testdata/DEPS.chromium.old firefox-55.0/media/libyuv/libyuv/tools_libyuv/autoroller/unittests/testdata/DEPS.chromium -diff -up firefox-55.0/media/webrtc/trunk/Makefile.old firefox-55.0/media/webrtc/trunk/Makefile diff --git a/build-rust-ppc64le.patch b/build-rust-ppc64le.patch deleted file mode 100644 index 2474c35..0000000 --- a/build-rust-ppc64le.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff -up firefox-55.0/build/moz.configure/rust.configure.rust-ppc64le firefox-55.0/build/moz.configure/rust.configure ---- firefox-55.0/build/moz.configure/rust.configure.rust-ppc64le 2017-07-31 18:20:49.000000000 +0200 -+++ firefox-55.0/build/moz.configure/rust.configure 2017-08-02 10:19:03.254220003 +0200 -@@ -151,6 +151,9 @@ def rust_triple_alias(host_or_target): - ('sparc64', 'Linux'): 'sparc64-unknown-linux-gnu', - ('x86', 'Linux'): 'i686-unknown-linux-gnu', - ('x86_64', 'Linux'): 'x86_64-unknown-linux-gnu', -+ ('ppc64le', 'Linux'): 'powerpc64le-unknown-linux-gnu', -+ ('ppc64', 'Linux'): 'powerpc64-unknown-linux-gnu', -+ ('s390x', 'Linux'): 's390x-unknown-linux-gnu', - # OS X - ('x86', 'OSX'): 'i686-apple-darwin', - ('x86_64', 'OSX'): 'x86_64-apple-darwin', -@@ -174,8 +177,10 @@ def rust_triple_alias(host_or_target): - ('sparc64', 'SunOS'): 'sparcv9-sun-solaris', - }.get((host_or_target.cpu, os_or_kernel), None) - -+ if (rustc_target == 'powerpc64-unknown-linux-gnu' and host_or_target.endianness == 'little'): -+ rustc_target = 'powerpc64le-unknown-linux-gnu' - if rustc_target is None: -- die("Don't know how to translate {} for rustc".format(host_or_target.alias)) -+ die("Don't know how to translate {} for rustc, cpu: {}, os: {}".format(target.alias, target.cpu, os_or_kernel)) - - # Check to see whether our rustc has a reasonably functional stdlib - # for our chosen target. diff --git a/build-seccomp.patch b/build-seccomp.patch new file mode 100644 index 0000000..b57f65a --- /dev/null +++ b/build-seccomp.patch @@ -0,0 +1,11 @@ +diff -up thunderbird-145.0/security/sandbox/chromium/sandbox/linux/system_headers/linux_seccomp.h.seccomp thunderbird-145.0/security/sandbox/chromium/sandbox/linux/system_headers/linux_seccomp.h +--- thunderbird-145.0/security/sandbox/chromium/sandbox/linux/system_headers/linux_seccomp.h.seccomp 2025-12-09 13:42:31.378958842 +0100 ++++ thunderbird-145.0/security/sandbox/chromium/sandbox/linux/system_headers/linux_seccomp.h 2025-12-09 13:42:37.886937626 +0100 +@@ -6,6 +6,7 @@ + #define SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_SECCOMP_H_ + + #include ++#include + #include + + #include "build/build_config.h" diff --git a/disable-openh264-download.patch b/disable-openh264-download.patch new file mode 100644 index 0000000..0631850 --- /dev/null +++ b/disable-openh264-download.patch @@ -0,0 +1,36 @@ +diff -up firefox-121.0/toolkit/content/jar.mn.disable-openh264-download firefox-121.0/toolkit/content/jar.mn +--- firefox-121.0/toolkit/content/jar.mn.disable-openh264-download 2023-12-18 20:15:04.352014249 +0100 ++++ firefox-121.0/toolkit/content/jar.mn 2023-12-18 20:19:26.857929200 +0100 +@@ -130,7 +130,6 @@ toolkit.jar: + #ifdef XP_MACOSX + content/global/macWindowMenu.js + #endif +- content/global/gmp-sources/openh264.json (gmp-sources/openh264.json) + content/global/gmp-sources/widevinecdm.json (gmp-sources/widevinecdm.json) + content/global/gmp-sources/widevinecdm_l1.json (gmp-sources/widevinecdm_l1.json) + +diff -up firefox-121.0/toolkit/modules/GMPInstallManager.sys.mjs.disable-openh264-download firefox-121.0/toolkit/modules/GMPInstallManager.sys.mjs +--- firefox-121.0/toolkit/modules/GMPInstallManager.sys.mjs.disable-openh264-download 2023-12-11 21:42:21.000000000 +0100 ++++ firefox-121.0/toolkit/modules/GMPInstallManager.sys.mjs 2023-12-18 20:18:52.665768579 +0100 +@@ -35,11 +35,6 @@ function getScopedLogger(prefix) { + + const LOCAL_GMP_SOURCES = [ + { +- id: "gmp-gmpopenh264", +- src: "chrome://global/content/gmp-sources/openh264.json", +- installByDefault: true, +- }, +- { + id: "gmp-widevinecdm", + src: "chrome://global/content/gmp-sources/widevinecdm.json", + installByDefault: true, +@@ -421,6 +416,9 @@ GMPInstallManager.prototype = { + * downloaderr, verifyerr or previouserrorencountered + */ + installAddon(gmpAddon) { ++ if (gmpAddon.isOpenH264) { ++ return Promise.reject({ type: "disabled" }); ++ } + if (this._deferred) { + let log = getScopedLogger("GMPInstallManager.installAddon"); + log.error("previous error encountered"); diff --git a/distribution.ini b/distribution.ini deleted file mode 100644 index 11f1f96..0000000 --- a/distribution.ini +++ /dev/null @@ -1,9 +0,0 @@ -[Global] -id=fedora -version=1.0 -about=Mozilla Firefox for Fedora - -[Preferences] -app.distributor=fedora -app.distributor.channel=fedora -app.partner.fedora=fedora diff --git a/distribution.ini.in b/distribution.ini.in new file mode 100644 index 0000000..0eaacc7 --- /dev/null +++ b/distribution.ini.in @@ -0,0 +1,9 @@ +[Global] +id=__ID__ +version=1.0 +about=Mozilla Firefox for __NAME__ + +[Preferences] +app.distributor=__ID__ +app.distributor.channel=__ID__ +app.partner.fedora=__ID__ diff --git a/fedora-build.patch b/fedora-build.patch deleted file mode 100644 index 74127ec..0000000 --- a/fedora-build.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff -up firefox-54.0/media/libyuv/libyuv/tools_libyuv/autoroller/unittests/testdata/DEPS.chromium.old firefox-54.0/media/libyuv/libyuv/tools_libyuv/autoroller/unittests/testdata/DEPS.chromium -diff -up firefox-54.0/media/mtransport/third_party/nICEr/nicer.gyp.old firefox-54.0/media/mtransport/third_party/nICEr/nicer.gyp ---- firefox-54.0/media/mtransport/third_party/nICEr/nicer.gyp.old 2017-06-08 14:59:08.786996664 +0200 -+++ firefox-54.0/media/mtransport/third_party/nICEr/nicer.gyp 2017-06-08 14:59:22.642946570 +0200 -@@ -211,7 +211,6 @@ - '-Wno-parentheses', - '-Wno-strict-prototypes', - '-Wmissing-prototypes', -- '-Wno-format', - ], - 'defines' : [ - 'LINUX', -diff -up firefox-54.0/media/mtransport/third_party/nrappkit/nrappkit.gyp.build firefox-54.0/media/mtransport/third_party/nrappkit/nrappkit.gyp ---- firefox-54.0/media/mtransport/third_party/nrappkit/nrappkit.gyp.build 2017-06-08 15:08:03.627063097 +0200 -+++ firefox-54.0/media/mtransport/third_party/nrappkit/nrappkit.gyp 2017-06-08 15:08:15.657019606 +0200 -@@ -206,7 +206,6 @@ - '-Wno-parentheses', - '-Wno-strict-prototypes', - '-Wmissing-prototypes', -- '-Wno-format', - ], - 'defines' : [ - 'LINUX', diff --git a/fedora-customization.patch b/fedora-customization.patch new file mode 100644 index 0000000..395f48d --- /dev/null +++ b/fedora-customization.patch @@ -0,0 +1,17 @@ +diff -up firefox-124.0/toolkit/xre/nsAppRunner.cpp.fedora-customization firefox-124.0/toolkit/xre/nsAppRunner.cpp +diff -up firefox-124.0/widget/gtk/nsWindow.cpp.fedora-customization firefox-124.0/widget/gtk/nsWindow.cpp +--- firefox-124.0/widget/gtk/nsWindow.cpp.fedora-customization 2024-03-13 12:35:57.098591719 +0100 ++++ firefox-124.0/widget/gtk/nsWindow.cpp 2024-03-13 12:43:17.375928494 +0100 +@@ -3459,6 +3459,12 @@ nsresult nsWindow::SetTitle(const nsAStr + return NS_OK; + } + ++ const char* appTitle = getenv("MOZ_APP_TITLE"); ++ if (appTitle) { ++ gtk_window_set_title(GTK_WINDOW(mShell), appTitle); ++ return NS_OK; ++ } ++ + // convert the string into utf8 and set the title. + #define UTF8_FOLLOWBYTE(ch) (((ch) & 0xC0) == 0x80) + NS_ConvertUTF16toUTF8 titleUTF8(aTitle); diff --git a/firefox-enable-addons.patch b/firefox-enable-addons.patch index 15d0707..75e1403 100644 --- a/firefox-enable-addons.patch +++ b/firefox-enable-addons.patch @@ -1,10 +1,10 @@ -diff -up firefox-55.0/browser/app/profile/firefox.js.addons firefox-55.0/browser/app/profile/firefox.js ---- firefox-55.0/browser/app/profile/firefox.js.addons 2017-08-02 10:58:30.566363833 +0200 -+++ firefox-55.0/browser/app/profile/firefox.js 2017-08-02 10:59:15.377216959 +0200 -@@ -65,7 +65,8 @@ pref("extensions.systemAddon.update.url" +diff -up firefox-125.0/browser/app/profile/firefox.js.addons firefox-125.0/browser/app/profile/firefox.js +--- firefox-125.0/browser/app/profile/firefox.js.addons 2024-04-09 10:34:30.728405003 +0200 ++++ firefox-125.0/browser/app/profile/firefox.js 2024-04-09 10:36:01.444584632 +0200 +@@ -58,7 +58,8 @@ pref("extensions.systemAddon.update.enab // Disable add-ons that are not installed by the user in all scopes by default. - // See the SCOPE constants in AddonManager.jsm for values to use here. + // See the SCOPE constants in AddonManager.sys.mjs for values to use here. -pref("extensions.autoDisableScopes", 15); +pref("extensions.autoDisableScopes", 0); +pref("extensions.showMismatchUI", false); diff --git a/firefox-fedora-ua.patch b/firefox-fedora-ua.patch deleted file mode 100644 index 7f1f554..0000000 --- a/firefox-fedora-ua.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff -up firefox-65.0/netwerk/protocol/http/nsHttpHandler.cpp.fedora-ua firefox-65.0/netwerk/protocol/http/nsHttpHandler.cpp ---- firefox-65.0/netwerk/protocol/http/nsHttpHandler.cpp.fedora-ua 2019-01-28 14:28:35.806375063 +0100 -+++ firefox-65.0/netwerk/protocol/http/nsHttpHandler.cpp 2019-01-28 14:30:25.886917219 +0100 -@@ -873,6 +873,7 @@ void nsHttpHandler::BuildUserAgent() { - mUserAgent.SetCapacity(mLegacyAppName.Length() + mLegacyAppVersion.Length() + - #ifndef UA_SPARE_PLATFORM - mPlatform.Length() + -+ mPlatform.Length() + 8 + - #endif - mOscpu.Length() + mMisc.Length() + mProduct.Length() + - mProductSub.Length() + mAppName.Length() + -@@ -891,6 +892,7 @@ void nsHttpHandler::BuildUserAgent() { - if (!mPlatform.IsEmpty()) { - mUserAgent += mPlatform; - mUserAgent.AppendLiteral("; "); -+ mUserAgent.AppendLiteral("Fedora; "); - } - #endif - if (!mCompatDevice.IsEmpty()) { diff --git a/firefox-gcc-13-build.patch b/firefox-gcc-13-build.patch new file mode 100644 index 0000000..8512b76 --- /dev/null +++ b/firefox-gcc-13-build.patch @@ -0,0 +1,24 @@ +--- firefox-109.0.1/gfx/2d/Rect.h.old 2023-02-07 09:44:24.946279843 +0100 ++++ firefox-109.0.1/gfx/2d/Rect.h 2023-02-07 09:44:47.969032049 +0100 +@@ -324,8 +324,8 @@ IntRectTyped RoundedToInt(const R + + template + bool RectIsInt32Safe(const RectTyped& aRect) { +- float min = (float)std::numeric_limits::min(); +- float max = (float)std::numeric_limits::max(); ++ float min = (float)std::numeric_limits::min(); ++ float max = (float)std::numeric_limits::max(); + return aRect.x > min && aRect.y > min && aRect.width < max && + aRect.height < max && aRect.XMost() < max && aRect.YMost() < max; + } +diff -up firefox-109.0.1/toolkit/components/telemetry/pingsender/pingsender.cpp.old firefox-109.0.1/toolkit/components/telemetry/pingsender/pingsender.cpp +--- firefox-109.0.1/toolkit/components/telemetry/pingsender/pingsender.cpp.old 2023-02-07 11:03:41.788720090 +0100 ++++ firefox-109.0.1/toolkit/components/telemetry/pingsender/pingsender.cpp 2023-02-07 11:04:29.195345659 +0100 +@@ -10,6 +10,7 @@ + #include + #include + #include ++#include + + #include + diff --git a/firefox-gcc-15.0-s390.patch b/firefox-gcc-15.0-s390.patch new file mode 100644 index 0000000..9cf82fc --- /dev/null +++ b/firefox-gcc-15.0-s390.patch @@ -0,0 +1,19 @@ +diff -up firefox-137.0.2/toolkit/components/protobuf/src/google/protobuf/port_def.inc.s390 firefox-137.0.2/toolkit/components/protobuf/src/google/protobuf/port_def.inc +--- firefox-137.0.2/toolkit/components/protobuf/src/google/protobuf/port_def.inc.s390 2025-04-22 11:42:00.650759505 +0200 ++++ firefox-137.0.2/toolkit/components/protobuf/src/google/protobuf/port_def.inc 2025-04-22 11:46:02.522031338 +0200 +@@ -257,12 +257,14 @@ + #if __has_cpp_attribute(clang::musttail) && !defined(__arm__) && \ + !defined(_ARCH_PPC) && !defined(__wasm__) && \ + !(defined(_MSC_VER) && defined(_M_IX86)) && \ +- !(defined(__NDK_MAJOR__) && __NDK_MAJOR <= 24) ++ !(defined(__NDK_MAJOR__) && __NDK_MAJOR <= 24) && \ ++ !defined(__s390__) + # ifndef PROTO2_OPENSOURCE + // Compilation fails on ARM32: b/195943306 + // Compilation fails on powerpc64le: b/187985113 + // Compilation fails on X86 Windows: + // https://github.com/llvm/llvm-project/issues/53271 ++// Compilation fails on S390 for calls with more than 4 arguments + # endif + #define PROTOBUF_MUSTTAIL [[clang::musttail]] + #define PROTOBUF_TAILCALL true diff --git a/firefox-gcc-always-inline.patch b/firefox-gcc-always-inline.patch new file mode 100644 index 0000000..d7af60f --- /dev/null +++ b/firefox-gcc-always-inline.patch @@ -0,0 +1,14 @@ +diff -up firefox-114.0.2/gfx/wr/swgl/src/gl.cc.inline firefox-114.0.2/gfx/wr/swgl/src/gl.cc +--- firefox-114.0.2/gfx/wr/swgl/src/gl.cc.inline 2023-06-22 11:08:53.294593327 +0200 ++++ firefox-114.0.2/gfx/wr/swgl/src/gl.cc 2023-06-22 11:12:43.663486734 +0200 +@@ -58,9 +58,7 @@ WINBASEAPI BOOL WINAPI QueryPerformanceF + } + + #else +-// GCC is slower when dealing with always_inline, especially in debug builds. +-// When using Clang, use always_inline more aggressively. +-# if defined(__clang__) || defined(NDEBUG) ++# if defined(__clang__) || defined (__GNUC__) || defined(NDEBUG) + # define ALWAYS_INLINE __attribute__((always_inline)) inline + # else + # define ALWAYS_INLINE inline diff --git a/firefox-gcc-build.patch b/firefox-gcc-build.patch new file mode 100644 index 0000000..55017ad --- /dev/null +++ b/firefox-gcc-build.patch @@ -0,0 +1,38 @@ +--- firefox-80.0.1/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h 2020-08-31 10:04:19.000000000 -0400 ++++ firefox-80.0.1/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h 2020-09-12 07:24:35.298931628 -0400 +@@ -1962,7 +1962,7 @@ struct kernel_statfs { + LSS_ENTRYPOINT \ + "pop %%ebx" \ + args \ +- : "esp", "memory"); \ ++ : "memory"); \ + LSS_RETURN(type,__res) + #undef _syscall0 + #define _syscall0(type,name) \ +@@ -2019,7 +2019,7 @@ struct kernel_statfs { + : "i" (__NR_##name), "ri" ((long)(arg1)), \ + "c" ((long)(arg2)), "d" ((long)(arg3)), \ + "S" ((long)(arg4)), "D" ((long)(arg5)) \ +- : "esp", "memory"); \ ++ : "memory"); \ + LSS_RETURN(type,__res); \ + } + #undef _syscall6 +@@ -2041,7 +2041,7 @@ struct kernel_statfs { + : "i" (__NR_##name), "0" ((long)(&__s)), \ + "c" ((long)(arg2)), "d" ((long)(arg3)), \ + "S" ((long)(arg4)), "D" ((long)(arg5)) \ +- : "esp", "memory"); \ ++ : "memory"); \ + LSS_RETURN(type,__res); \ + } + LSS_INLINE int LSS_NAME(clone)(int (*fn)(void *), void *child_stack, +@@ -2127,7 +2127,7 @@ struct kernel_statfs { + : "0"(-EINVAL), "i"(__NR_clone), + "m"(fn), "m"(child_stack), "m"(flags), "m"(arg), + "m"(parent_tidptr), "m"(newtls), "m"(child_tidptr) +- : "esp", "memory", "ecx", "edx", "esi", "edi"); ++ : "memory", "ecx", "edx", "esi", "edi"); + LSS_RETURN(int, __res); + } + diff --git a/firefox-i686-build.patch b/firefox-i686-build.patch new file mode 100644 index 0000000..320199f --- /dev/null +++ b/firefox-i686-build.patch @@ -0,0 +1,12 @@ +diff -up firefox-105.0/mozglue/misc/SIMD_avx2.cpp.old firefox-105.0/mozglue/misc/SIMD_avx2.cpp +--- firefox-105.0/mozglue/misc/SIMD_avx2.cpp.old 2022-09-22 21:35:07.006221995 +0200 ++++ firefox-105.0/mozglue/misc/SIMD_avx2.cpp 2022-09-22 21:36:12.972480517 +0200 +@@ -55,7 +55,7 @@ __m256i CmpEq256(__m256i a, __m256i b) { + return _mm256_cmpeq_epi64(a, b); + } + +-# if defined(__GNUC__) && !defined(__clang__) ++# if 0 + + // See the comment in SIMD.cpp over Load32BitsIntoXMM. This is just adapted + // from that workaround. Testing this, it also yields the correct instructions diff --git a/firefox-locale-debug.patch b/firefox-locale-debug.patch deleted file mode 100644 index 0a481cb..0000000 --- a/firefox-locale-debug.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -up firefox-63.0.1/intl/locale/LocaleService.cpp.old firefox-63.0.1/intl/locale/LocaleService.cpp ---- firefox-63.0.1/intl/locale/LocaleService.cpp.old 2018-11-14 13:34:16.338285161 +0100 -+++ firefox-63.0.1/intl/locale/LocaleService.cpp 2018-11-14 13:34:21.438270308 +0100 -@@ -708,7 +708,6 @@ LocaleService::GetDefaultLocale(nsACStri - GetGREFileContents("update.locale", &locale); - locale.Trim(" \t\n\r"); - // This should never be empty. -- MOZ_ASSERT(!locale.IsEmpty()); - if (SanitizeForBCP47(locale, true)) { - mDefaultLocale.Assign(locale); - } diff --git a/firefox-mozconfig b/firefox-mozconfig index 78aa1da..2736abc 100644 --- a/firefox-mozconfig +++ b/firefox-mozconfig @@ -1,26 +1,20 @@ . $topsrcdir/browser/config/mozconfig -ac_add_options --prefix="$PREFIX" -ac_add_options --libdir="$LIBDIR" ac_add_options --with-system-zlib -ac_add_options --with-system-bz2 ac_add_options --disable-strip -#ac_add_options --enable-libnotify ac_add_options --enable-necko-wifi -ac_add_options --enable-startup-notification ac_add_options --disable-updater ac_add_options --enable-chrome-format=omni ac_add_options --enable-pulseaudio +ac_add_options --enable-av1 ac_add_options --without-system-icu -ac_add_options --with-mozilla-api-keyfile=../mozilla-api-key -ac_add_options --with-google-location-service-api-keyfile=../google-api-key -ac_add_options --with-google-safebrowsing-api-keyfile=../google-api-key ac_add_options --enable-release ac_add_options --update-channel=release -ac_add_options --disable-system-sqlite -# Workaround for mozbz#1341234 -ac_add_options BINDGEN_CFLAGS="$(pkg-config nspr pixman-1 --cflags)" -ac_add_options --enable-av1 +ac_add_options --allow-addon-sideload +ac_add_options --with-system-fdk-aac +ac_add_options --enable-js-shell +ac_add_options --with-unsigned-addon-scopes=app,system +ac_add_options --disable-bootstrap export BUILD_OFFICIAL=1 export MOZILLA_OFFICIAL=1 diff --git a/firefox-nss-addon-hack.patch b/firefox-nss-addon-hack.patch new file mode 100644 index 0000000..0322707 --- /dev/null +++ b/firefox-nss-addon-hack.patch @@ -0,0 +1,19 @@ +diff -up firefox-84.0.2/security/certverifier/NSSCertDBTrustDomain.cpp.nss-hack firefox-84.0.2/security/certverifier/NSSCertDBTrustDomain.cpp +--- firefox-84.0.2/security/certverifier/NSSCertDBTrustDomain.cpp.nss-hack 2021-01-11 12:12:02.585514543 +0100 ++++ firefox-84.0.2/security/certverifier/NSSCertDBTrustDomain.cpp 2021-01-11 12:47:50.345984582 +0100 +@@ -1619,6 +1619,15 @@ SECStatus InitializeNSS(const nsACString + return srv; + } + ++ /* Sets the NSS_USE_ALG_IN_ANY_SIGNATURE bit. ++ * does not change NSS_USE_ALG_IN_CERT_SIGNATURE, ++ * so policy will still disable use of sha1 in ++ * certificate related signature processing. */ ++ srv = NSS_SetAlgorithmPolicy(SEC_OID_SHA1, NSS_USE_ALG_IN_ANY_SIGNATURE, 0); ++ if (srv != SECSuccess) { ++ NS_WARNING("Unable to use SHA1 for Add-ons, expect broken/disabled Add-ons. See https://bugzilla.redhat.com/show_bug.cgi?id=1908018 for details."); ++ } ++ + if (nssDbConfig == NSSDBConfig::ReadWrite) { + UniquePK11SlotInfo slot(PK11_GetInternalKeySlot()); + if (!slot) { diff --git a/firefox-pipewire.patch b/firefox-pipewire.patch deleted file mode 100644 index aa1541b..0000000 --- a/firefox-pipewire.patch +++ /dev/null @@ -1,2508 +0,0 @@ -diff -up firefox-66.0/config/system-headers.mozbuild.firefox-pipewire firefox-66.0/config/system-headers.mozbuild ---- firefox-66.0/config/system-headers.mozbuild.firefox-pipewire 2019-03-12 01:22:15.000000000 +0100 -+++ firefox-66.0/config/system-headers.mozbuild 2019-03-12 15:27:37.675285710 +0100 -@@ -314,6 +314,7 @@ system_headers = [ - 'Gestalt.h', - 'getopt.h', - 'gio/gio.h', -+ 'gio/gunixfdlist.h', - 'glibconfig.h', - 'glib.h', - 'glib-object.h', -@@ -607,6 +608,7 @@ system_headers = [ - 'Pgenerr.h', - 'PGenErr.h', - 'Ph.h', -+ 'pipewire/pipewire.h', - 'pixman.h', - 'pk11func.h', - 'pk11pqg.h', -diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_linux.cc.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_linux.cc ---- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_linux.cc.firefox-pipewire 2019-03-12 15:27:37.675285710 +0100 -+++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_linux.cc 2019-03-12 15:27:37.675285710 +0100 -@@ -0,0 +1,39 @@ -+/* -+ * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved. -+ * -+ * Use of this source code is governed by a BSD-style license -+ * that can be found in the LICENSE file in the root of the source -+ * tree. An additional intellectual property rights grant can be found -+ * in the file PATENTS. All contributing project authors may -+ * be found in the AUTHORS file in the root of the source tree. -+ */ -+ -+#include "modules/desktop_capture/desktop_capture_options.h" -+#include "modules/desktop_capture/desktop_capturer.h" -+ -+#if defined(USE_X11) -+#include "modules/desktop_capture/app_capturer_x11.h" -+#endif // defined(USE_X11) -+ -+namespace webrtc { -+ -+// static -+AppCapturer* AppCapturer::Create(const DesktopCaptureOptions& options) { -+#if defined(USE_X11) -+ return AppCapturerX11::Create(options); -+#endif // defined(USE_X11) -+ -+ return nullptr; -+} -+ -+// static -+std::unique_ptr DesktopCapturer::CreateRawAppCapturer( -+ const DesktopCaptureOptions& options) { -+#if defined(USE_X11) -+ return AppCapturerX11::CreateRawAppCapturer(options); -+#endif // defined(USE_X11) -+ -+ return nullptr; -+} -+ -+} // namespace webrtc -diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_x11.cc.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_x11.cc ---- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_x11.cc.firefox-pipewire 2019-03-12 01:22:20.000000000 +0100 -+++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_x11.cc 2019-03-12 15:27:37.675285710 +0100 -@@ -7,9 +7,6 @@ - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ --#include "modules/desktop_capture/app_capturer.h" --#include "modules/desktop_capture/shared_desktop_frame.h" --#include "modules/desktop_capture/x11/shared_x_util.h" - - #include - #include -@@ -21,79 +18,18 @@ - - #include - -+#include "modules/desktop_capture/app_capturer_x11.h" - #include "modules/desktop_capture/desktop_capture_options.h" - #include "modules/desktop_capture/desktop_frame.h" - #include "modules/desktop_capture/x11/shared_x_display.h" -+#include "modules/desktop_capture/x11/shared_x_util.h" - #include "modules/desktop_capture/x11/x_error_trap.h" - #include "modules/desktop_capture/x11/x_server_pixel_buffer.h" - #include "rtc_base/logging.h" - - namespace webrtc { - --namespace { -- --class ScreenCapturerProxy : DesktopCapturer::Callback { --public: -- ScreenCapturerProxy() -- : screen_capturer_(DesktopCapturer::CreateScreenCapturer(DesktopCaptureOptions::CreateDefault())) { -- screen_capturer_->SelectSource(kFullDesktopScreenId); -- screen_capturer_->Start(this); -- } -- void CaptureFrame() { screen_capturer_->CaptureFrame(); } -- std::unique_ptr GetFrame() { return std::move(frame_); } -- -- // Callback interface -- virtual void OnCaptureResult(DesktopCapturer::Result result, -- std::unique_ptr frame) { -- frame_ = std::move(frame); -- } -- --protected: -- std::unique_ptr screen_capturer_; -- std::unique_ptr frame_; --}; -- --class AppCapturerLinux : public AppCapturer { --public: -- AppCapturerLinux(const DesktopCaptureOptions& options); -- virtual ~AppCapturerLinux(); -- -- // AppCapturer interface. -- virtual bool GetAppList(AppList* apps) override; -- virtual bool SelectApp(ProcessId processId) override; -- virtual bool BringAppToFront() override; -- -- // DesktopCapturer interface. -- virtual void Start(Callback* callback) override; -- virtual void CaptureFrame() override; -- virtual bool SelectSource(SourceId id) override -- { -- return SelectApp(static_cast(id)); -- } -- --protected: -- Display* GetDisplay() { return x_display_->display(); } -- bool UpdateRegions(); -- -- void FillDesktopFrameRegionWithColor(DesktopFrame* pDesktopFrame,Region rgn, uint32_t color); --private: -- Callback* callback_; -- ProcessId selected_process_; -- -- // Sample Mode -- ScreenCapturerProxy screen_capturer_proxy_; -- // Mask of foreground (non-app windows in front of selected) -- Region rgn_mask_; -- // Region of selected windows -- Region rgn_visual_; -- // Mask of background (desktop, non-app windows behind selected) -- Region rgn_background_; -- -- rtc::scoped_refptr x_display_; -- RTC_DISALLOW_COPY_AND_ASSIGN(AppCapturerLinux); --}; -- --AppCapturerLinux::AppCapturerLinux(const DesktopCaptureOptions& options) -+AppCapturerX11::AppCapturerX11(const DesktopCaptureOptions& options) - : callback_(NULL), - selected_process_(0), - x_display_(options.x_display()) { -@@ -102,7 +38,7 @@ AppCapturerLinux::AppCapturerLinux(const - rgn_background_ = XCreateRegion(); - } - --AppCapturerLinux::~AppCapturerLinux() { -+AppCapturerX11::~AppCapturerX11() { - if (rgn_mask_) { - XDestroyRegion(rgn_mask_); - } -@@ -115,28 +51,28 @@ AppCapturerLinux::~AppCapturerLinux() { - } - - // AppCapturer interface. --bool AppCapturerLinux::GetAppList(AppList* apps) { -+bool AppCapturerX11::GetAppList(AppList* apps) { - // Implemented in DesktopDeviceInfo - return true; - } --bool AppCapturerLinux::SelectApp(ProcessId processId) { -+bool AppCapturerX11::SelectApp(ProcessId processId) { - selected_process_ = processId; - return true; - } --bool AppCapturerLinux::BringAppToFront() { -+bool AppCapturerX11::BringAppToFront() { - // Not implemented yet: See Bug 1036653 - return true; - } - - // DesktopCapturer interface. --void AppCapturerLinux::Start(Callback* callback) { -+void AppCapturerX11::Start(Callback* callback) { - assert(!callback_); - assert(callback); - - callback_ = callback; - } - --void AppCapturerLinux::CaptureFrame() { -+void AppCapturerX11::CaptureFrame() { - XErrorTrap error_trap(GetDisplay()); - - //Capture screen >> set root window as capture window -@@ -164,7 +100,7 @@ void AppCapturerLinux::CaptureFrame() { - } - } - --void AppCapturerLinux::FillDesktopFrameRegionWithColor(DesktopFrame* pDesktopFrame, Region rgn, uint32_t color) { -+void AppCapturerX11::FillDesktopFrameRegionWithColor(DesktopFrame* pDesktopFrame, Region rgn, uint32_t color) { - XErrorTrap error_trap(GetDisplay()); - - if (!pDesktopFrame) { -@@ -187,7 +123,7 @@ void AppCapturerLinux::FillDesktopFrameR - } - } - --bool AppCapturerLinux::UpdateRegions() { -+bool AppCapturerX11::UpdateRegions() { - XErrorTrap error_trap(GetDisplay()); - - XSubtractRegion(rgn_visual_, rgn_visual_, rgn_visual_); -@@ -264,21 +200,19 @@ bool AppCapturerLinux::UpdateRegions() { - return true; - } - --} // namespace -- - // static --AppCapturer* AppCapturer::Create(const DesktopCaptureOptions& options) { -- return new AppCapturerLinux(options); -+AppCapturer* AppCapturerX11::Create(const DesktopCaptureOptions& options) { -+ return new AppCapturerX11(options); - } - - // static --std::unique_ptr DesktopCapturer::CreateRawAppCapturer( -+std::unique_ptr AppCapturerX11::CreateRawAppCapturer( - const DesktopCaptureOptions& options) { - - if (!options.x_display()) - return nullptr; - -- std::unique_ptr capturer(new AppCapturerLinux(options)); -+ std::unique_ptr capturer(new AppCapturerX11(options)); - - return std::unique_ptr(std::move(capturer)); - } -diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_x11.h.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_x11.h ---- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_x11.h.firefox-pipewire 2019-03-12 15:27:37.676285720 +0100 -+++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_x11.h 2019-03-12 16:08:04.440031789 +0100 -@@ -0,0 +1,97 @@ -+/* -+ * Copyright 2018 The WebRTC project authors. All Rights Reserved. -+ * -+ * Use of this source code is governed by a BSD-style license -+ * that can be found in the LICENSE file in the root of the source -+ * tree. An additional intellectual property rights grant can be found -+ * in the file PATENTS. All contributing project authors may -+ * be found in the AUTHORS file in the root of the source tree. -+ */ -+ -+#ifndef MODULES_DESKTOP_CAPTURE_APP_CAPTURER_X11_H_ -+#define MODULES_DESKTOP_CAPTURE_APP_CAPTURER_X11_H_ -+ -+#include -+#include -+#include -+#include -+ -+#include "modules/desktop_capture/app_capturer.h" -+#include "modules/desktop_capture/shared_desktop_frame.h" -+#include "modules/desktop_capture/desktop_capture_options.h" -+#include "modules/desktop_capture/desktop_capturer.h" -+#include "modules/desktop_capture/desktop_geometry.h" -+#include "modules/desktop_capture/x11/shared_x_display.h" -+#include "modules/desktop_capture/x11/x_server_pixel_buffer.h" -+#include "rtc_base/constructormagic.h" -+#include "rtc_base/scoped_ref_ptr.h" -+ -+namespace webrtc { -+ -+class ScreenCapturerProxy : DesktopCapturer::Callback { -+public: -+ ScreenCapturerProxy() -+ : screen_capturer_(DesktopCapturer::CreateScreenCapturer(DesktopCaptureOptions::CreateDefault())) { -+ screen_capturer_->SelectSource(kFullDesktopScreenId); -+ screen_capturer_->Start(this); -+ } -+ void CaptureFrame() { screen_capturer_->CaptureFrame(); } -+ std::unique_ptr GetFrame() { return std::move(frame_); } -+ -+ // Callback interface -+ virtual void OnCaptureResult(DesktopCapturer::Result result, -+ std::unique_ptr frame) { -+ frame_ = std::move(frame); -+ } -+ -+protected: -+ std::unique_ptr screen_capturer_; -+ std::unique_ptr frame_; -+}; -+ -+class AppCapturerX11 : public AppCapturer { -+public: -+ AppCapturerX11(const DesktopCaptureOptions& options); -+ virtual ~AppCapturerX11(); -+ -+ static AppCapturer* Create(const DesktopCaptureOptions& options); -+ static std::unique_ptr CreateRawAppCapturer(const DesktopCaptureOptions& options); -+ -+ // AppCapturer interface. -+ virtual bool GetAppList(AppList* apps) override; -+ virtual bool SelectApp(ProcessId processId) override; -+ virtual bool BringAppToFront() override; -+ -+ // DesktopCapturer interface. -+ virtual void Start(Callback* callback) override; -+ virtual void CaptureFrame() override; -+ virtual bool SelectSource(SourceId id) override -+ { -+ return SelectApp(static_cast(id)); -+ } -+ -+protected: -+ Display* GetDisplay() { return x_display_->display(); } -+ bool UpdateRegions(); -+ -+ void FillDesktopFrameRegionWithColor(DesktopFrame* pDesktopFrame,Region rgn, uint32_t color); -+private: -+ Callback* callback_; -+ ProcessId selected_process_; -+ -+ // Sample Mode -+ ScreenCapturerProxy screen_capturer_proxy_; -+ // Mask of foreground (non-app windows in front of selected) -+ Region rgn_mask_; -+ // Region of selected windows -+ Region rgn_visual_; -+ // Mask of background (desktop, non-app windows behind selected) -+ Region rgn_background_; -+ -+ rtc::scoped_refptr x_display_; -+ RTC_DISALLOW_COPY_AND_ASSIGN(AppCapturerX11); -+}; -+ -+} // namespace webrtc -+ -+#endif // MODULES_DESKTOP_CAPTURE_APP_CAPTURER_X11_H_ -diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/base_capturer_pipewire.cc.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/base_capturer_pipewire.cc ---- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/base_capturer_pipewire.cc.firefox-pipewire 2019-03-12 15:27:37.676285720 +0100 -+++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/base_capturer_pipewire.cc 2019-03-12 15:27:37.676285720 +0100 -@@ -0,0 +1,849 @@ -+/* -+ * Copyright 2018 The WebRTC project authors. All Rights Reserved. -+ * -+ * Use of this source code is governed by a BSD-style license -+ * that can be found in the LICENSE file in the root of the source -+ * tree. An additional intellectual property rights grant can be found -+ * in the file PATENTS. All contributing project authors may -+ * be found in the AUTHORS file in the root of the source tree. -+ */ -+ -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+ -+#include "modules/desktop_capture/base_capturer_pipewire.h" -+ -+#include "modules/desktop_capture/desktop_capture_options.h" -+#include "modules/desktop_capture/desktop_capturer.h" -+#include "rtc_base/checks.h" -+#include "rtc_base/logging.h" -+ -+namespace webrtc { -+ -+const char kDesktopBusName[] = "org.freedesktop.portal.Desktop"; -+const char kDesktopObjectPath[] = "/org/freedesktop/portal/desktop"; -+const char kDesktopRequestObjectPath[] = -+ "/org/freedesktop/portal/desktop/request"; -+const char kSessionInterfaceName[] = "org.freedesktop.portal.Session"; -+const char kRequestInterfaceName[] = "org.freedesktop.portal.Request"; -+const char kScreenCastInterfaceName[] = "org.freedesktop.portal.ScreenCast"; -+ -+const int kBytesPerPixelPw = 4; -+ -+// static -+void BaseCapturerPipeWire::OnStateChanged(void* data, -+ pw_remote_state old_state, -+ pw_remote_state state, -+ const char* error_message) { -+ BaseCapturerPipeWire* that = static_cast(data); -+ RTC_DCHECK(that); -+ -+ switch (state) { -+ case PW_REMOTE_STATE_ERROR: -+ RTC_LOG(LS_ERROR) << "PipeWire remote state error: " << error_message; -+ break; -+ case PW_REMOTE_STATE_CONNECTED: -+ RTC_LOG(LS_INFO) << "PipeWire remote state: connected."; -+ that->CreateReceivingStream(); -+ break; -+ case PW_REMOTE_STATE_CONNECTING: -+ RTC_LOG(LS_INFO) << "PipeWire remote state: connecting."; -+ break; -+ case PW_REMOTE_STATE_UNCONNECTED: -+ RTC_LOG(LS_INFO) << "PipeWire remote state: unconnected."; -+ break; -+ } -+} -+ -+// static -+void BaseCapturerPipeWire::OnStreamStateChanged(void* data, -+ pw_stream_state old_state, -+ pw_stream_state state, -+ const char* error_message) { -+ BaseCapturerPipeWire* that = static_cast(data); -+ RTC_DCHECK(that); -+ -+ switch (state) { -+ case PW_STREAM_STATE_ERROR: -+ RTC_LOG(LS_ERROR) << "PipeWire stream state error: " << error_message; -+ break; -+ case PW_STREAM_STATE_CONFIGURE: -+ pw_stream_set_active(that->pw_stream_, true); -+ break; -+ case PW_STREAM_STATE_UNCONNECTED: -+ case PW_STREAM_STATE_CONNECTING: -+ case PW_STREAM_STATE_READY: -+ case PW_STREAM_STATE_PAUSED: -+ case PW_STREAM_STATE_STREAMING: -+ break; -+ } -+} -+ -+// static -+void BaseCapturerPipeWire::OnStreamFormatChanged( -+ void* data, -+ const struct spa_pod* format) { -+ BaseCapturerPipeWire* that = static_cast(data); -+ RTC_DCHECK(that); -+ -+ RTC_LOG(LS_INFO) << "PipeWire stream format changed."; -+ -+ if (!format) { -+ pw_stream_finish_format(that->pw_stream_, /*res=*/0, /*params=*/nullptr, -+ /*n_params=*/0); -+ return; -+ } -+ -+ that->spa_video_format_ = new spa_video_info_raw(); -+ spa_format_video_raw_parse(format, that->spa_video_format_, -+ &that->pw_type_->format_video); -+ -+ auto width = that->spa_video_format_->size.width; -+ auto height = that->spa_video_format_->size.height; -+ auto stride = SPA_ROUND_UP_N(width * kBytesPerPixelPw, 4); -+ auto size = height * stride; -+ -+ uint8_t buffer[1024] = {}; -+ auto builder = spa_pod_builder{buffer, sizeof(buffer)}; -+ -+ // Setup buffers and meta header for new format. -+ const struct spa_pod* params[2]; -+ params[0] = reinterpret_cast(spa_pod_builder_object( -+ &builder, -+ // id to enumerate buffer requirements -+ that->pw_core_type_->param.idBuffers, -+ that->pw_core_type_->param_buffers.Buffers, -+ // Size: specified as integer (i) and set to specified size -+ ":", that->pw_core_type_->param_buffers.size, "i", size, -+ // Stride: specified as integer (i) and set to specified stride -+ ":", that->pw_core_type_->param_buffers.stride, "i", stride, -+ // Buffers: specifies how many buffers we want to deal with, set as -+ // integer (i) where preferred number is 8, then allowed number is defined -+ // as range (r) from min and max values and it is undecided (u) to allow -+ // negotiation -+ ":", that->pw_core_type_->param_buffers.buffers, "iru", 8, -+ SPA_POD_PROP_MIN_MAX(1, 32), -+ // Align: memory alignment of the buffer, set as integer (i) to specified -+ // value -+ ":", that->pw_core_type_->param_buffers.align, "i", 16)); -+ params[1] = reinterpret_cast(spa_pod_builder_object( -+ &builder, -+ // id to enumerate supported metadata -+ that->pw_core_type_->param.idMeta, that->pw_core_type_->param_meta.Meta, -+ // Type: specified as id or enum (I) -+ ":", that->pw_core_type_->param_meta.type, "I", -+ that->pw_core_type_->meta.Header, -+ // Size: size of the metadata, specified as integer (i) -+ ":", that->pw_core_type_->param_meta.size, "i", -+ sizeof(struct spa_meta_header))); -+ -+ pw_stream_finish_format(that->pw_stream_, /*res=*/0, params, /*n_params=*/2); -+} -+ -+// static -+void BaseCapturerPipeWire::OnStreamProcess(void* data) { -+ BaseCapturerPipeWire* that = static_cast(data); -+ RTC_DCHECK(that); -+ -+ pw_buffer* buf = nullptr; -+ -+ if (!(buf = pw_stream_dequeue_buffer(that->pw_stream_))) { -+ return; -+ } -+ -+ that->HandleBuffer(buf); -+ -+ pw_stream_queue_buffer(that->pw_stream_, buf); -+} -+ -+BaseCapturerPipeWire::BaseCapturerPipeWire(CaptureSourceType source_type) -+ : capture_source_type_(source_type) {} -+ -+BaseCapturerPipeWire::~BaseCapturerPipeWire() { -+ if (pw_main_loop_) { -+ pw_thread_loop_stop(pw_main_loop_); -+ } -+ -+ if (pw_type_) { -+ delete pw_type_; -+ } -+ -+ if (spa_video_format_) { -+ delete spa_video_format_; -+ } -+ -+ if (pw_stream_) { -+ pw_stream_destroy(pw_stream_); -+ } -+ -+ if (pw_remote_) { -+ pw_remote_destroy(pw_remote_); -+ } -+ -+ if (pw_core_) { -+ pw_core_destroy(pw_core_); -+ } -+ -+ if (pw_main_loop_) { -+ pw_thread_loop_destroy(pw_main_loop_); -+ } -+ -+ if (pw_loop_) { -+ pw_loop_destroy(pw_loop_); -+ } -+ -+ if (current_frame_) { -+ free(current_frame_); -+ } -+ -+ if (start_request_signal_id_) { -+ g_dbus_connection_signal_unsubscribe(connection_, start_request_signal_id_); -+ } -+ if (sources_request_signal_id_) { -+ g_dbus_connection_signal_unsubscribe(connection_, -+ sources_request_signal_id_); -+ } -+ if (session_request_signal_id_) { -+ g_dbus_connection_signal_unsubscribe(connection_, -+ session_request_signal_id_); -+ } -+ -+ if (session_handle_) { -+ GDBusMessage* message = g_dbus_message_new_method_call( -+ kDesktopBusName, session_handle_, kSessionInterfaceName, "Close"); -+ if (message) { -+ GError* error = nullptr; -+ g_dbus_connection_send_message(connection_, message, -+ G_DBUS_SEND_MESSAGE_FLAGS_NONE, -+ /*out_serial=*/nullptr, &error); -+ if (error) { -+ RTC_LOG(LS_ERROR) << "Failed to close the session: " << error->message; -+ g_error_free(error); -+ } -+ g_object_unref(message); -+ } -+ } -+ -+ g_free(start_handle_); -+ g_free(sources_handle_); -+ g_free(session_handle_); -+ g_free(portal_handle_); -+ -+ if (proxy_) { -+ g_clear_object(&proxy_); -+ } -+} -+ -+void BaseCapturerPipeWire::InitPortals() { -+ g_dbus_proxy_new_for_bus( -+ G_BUS_TYPE_SESSION, G_DBUS_PROXY_FLAGS_NONE, /*info=*/nullptr, -+ kDesktopBusName, kDesktopObjectPath, kScreenCastInterfaceName, -+ /*cancellable=*/nullptr, -+ reinterpret_cast(OnProxyRequested), this); -+} -+ -+void BaseCapturerPipeWire::InitPipeWire() { -+ pw_init(/*argc=*/nullptr, /*argc=*/nullptr); -+ -+ pw_loop_ = pw_loop_new(/*properties=*/nullptr); -+ pw_main_loop_ = pw_thread_loop_new(pw_loop_, "pipewire-main-loop"); -+ -+ pw_core_ = pw_core_new(pw_loop_, /*properties=*/nullptr); -+ pw_core_type_ = pw_core_get_type(pw_core_); -+ pw_remote_ = pw_remote_new(pw_core_, nullptr, /*user_data_size=*/0); -+ -+ InitPipeWireTypes(); -+ -+ // Initialize event handlers, remote end and stream-related. -+ pw_remote_events_.version = PW_VERSION_REMOTE_EVENTS; -+ pw_remote_events_.state_changed = &OnStateChanged; -+ -+ pw_stream_events_.version = PW_VERSION_STREAM_EVENTS; -+ pw_stream_events_.state_changed = &OnStreamStateChanged; -+ pw_stream_events_.format_changed = &OnStreamFormatChanged; -+ pw_stream_events_.process = &OnStreamProcess; -+ -+ pw_remote_add_listener(pw_remote_, &spa_remote_listener_, &pw_remote_events_, -+ this); -+ pw_remote_connect_fd(pw_remote_, pw_fd_); -+ -+ if (pw_thread_loop_start(pw_main_loop_) < 0) { -+ RTC_LOG(LS_ERROR) << "Failed to start main PipeWire loop"; -+ portal_init_failed_ = true; -+ } -+} -+ -+void BaseCapturerPipeWire::InitPipeWireTypes() { -+ spa_type_map* map = pw_core_type_->map; -+ pw_type_ = new PipeWireType(); -+ -+ spa_type_media_type_map(map, &pw_type_->media_type); -+ spa_type_media_subtype_map(map, &pw_type_->media_subtype); -+ spa_type_format_video_map(map, &pw_type_->format_video); -+ spa_type_video_format_map(map, &pw_type_->video_format); -+} -+ -+void BaseCapturerPipeWire::CreateReceivingStream() { -+ spa_rectangle pwMinScreenBounds = spa_rectangle{1, 1}; -+ spa_rectangle pwScreenBounds = -+ spa_rectangle{static_cast(desktop_size_.width()), -+ static_cast(desktop_size_.height())}; -+ -+ spa_fraction pwFrameRateMin = spa_fraction{0, 1}; -+ spa_fraction pwFrameRateMax = spa_fraction{60, 1}; -+ -+ pw_properties* reuseProps = pw_properties_new("pipewire.client.reuse", "1", -+ /*end of varargs*/ nullptr); -+ pw_stream_ = pw_stream_new(pw_remote_, "webrtc-consume-stream", reuseProps); -+ -+ uint8_t buffer[1024] = {}; -+ const spa_pod* params[1]; -+ spa_pod_builder builder = spa_pod_builder{buffer, sizeof(buffer)}; -+ params[0] = reinterpret_cast(spa_pod_builder_object( -+ &builder, -+ // id to enumerate formats -+ pw_core_type_->param.idEnumFormat, pw_core_type_->spa_format, "I", -+ pw_type_->media_type.video, "I", pw_type_->media_subtype.raw, -+ // Video format: specified as id or enum (I), preferred format is BGRx, -+ // then allowed formats are enumerated (e) and the format is undecided (u) -+ // to allow negotiation -+ ":", pw_type_->format_video.format, "Ieu", pw_type_->video_format.BGRx, -+ SPA_POD_PROP_ENUM(2, pw_type_->video_format.RGBx, -+ pw_type_->video_format.BGRx), -+ // Video size: specified as rectangle (R), preferred size is specified as -+ // first parameter, then allowed size is defined as range (r) from min and -+ // max values and the format is undecided (u) to allow negotiation -+ ":", pw_type_->format_video.size, "Rru", &pwScreenBounds, 2, -+ &pwMinScreenBounds, &pwScreenBounds, -+ // Frame rate: specified as fraction (F) and set to minimum frame rate -+ // value -+ ":", pw_type_->format_video.framerate, "F", &pwFrameRateMin, -+ // Max frame rate: specified as fraction (F), preferred frame rate is set -+ // to maximum value, then allowed frame rate is defined as range (r) from -+ // min and max values and it is undecided (u) to allow negotiation -+ ":", pw_type_->format_video.max_framerate, "Fru", &pwFrameRateMax, 2, -+ &pwFrameRateMin, &pwFrameRateMax)); -+ -+ pw_stream_add_listener(pw_stream_, &spa_stream_listener_, &pw_stream_events_, -+ this); -+ pw_stream_flags flags = static_cast( -+ PW_STREAM_FLAG_AUTOCONNECT | PW_STREAM_FLAG_INACTIVE | -+ PW_STREAM_FLAG_MAP_BUFFERS); -+ if (pw_stream_connect(pw_stream_, PW_DIRECTION_INPUT, /*port_path=*/nullptr, -+ flags, params, -+ /*n_params=*/1) != 0) { -+ RTC_LOG(LS_ERROR) << "Could not connect receiving stream."; -+ portal_init_failed_ = true; -+ return; -+ } -+} -+ -+void BaseCapturerPipeWire::HandleBuffer(pw_buffer* buffer) { -+ spa_buffer* spaBuffer = buffer->buffer; -+ void* src = nullptr; -+ -+ if (!(src = spaBuffer->datas[0].data)) { -+ return; -+ } -+ -+ uint32_t maxSize = spaBuffer->datas[0].maxsize; -+ int32_t srcStride = spaBuffer->datas[0].chunk->stride; -+ if (srcStride != (desktop_size_.width() * kBytesPerPixelPw)) { -+ RTC_LOG(LS_ERROR) << "Got buffer with stride different from screen stride: " -+ << srcStride -+ << " != " << (desktop_size_.width() * kBytesPerPixelPw); -+ portal_init_failed_ = true; -+ return; -+ } -+ -+ if (!current_frame_) { -+ current_frame_ = static_cast(malloc(maxSize)); -+ } -+ RTC_DCHECK(current_frame_ != nullptr); -+ -+ // If both sides decided to go with the RGBx format we need to convert it to -+ // BGRx to match color format expected by WebRTC. -+ if (spa_video_format_->format == pw_type_->video_format.RGBx) { -+ uint8_t* tempFrame = static_cast(malloc(maxSize)); -+ std::memcpy(tempFrame, src, maxSize); -+ ConvertRGBxToBGRx(tempFrame, maxSize); -+ std::memcpy(current_frame_, tempFrame, maxSize); -+ free(tempFrame); -+ } else { -+ std::memcpy(current_frame_, src, maxSize); -+ } -+} -+ -+void BaseCapturerPipeWire::ConvertRGBxToBGRx(uint8_t* frame, uint32_t size) { -+ // Change color format for KDE KWin which uses RGBx and not BGRx -+ for (uint32_t i = 0; i < size; i += 4) { -+ uint8_t tempR = frame[i]; -+ uint8_t tempB = frame[i + 2]; -+ frame[i] = tempB; -+ frame[i + 2] = tempR; -+ } -+} -+ -+guint BaseCapturerPipeWire::SetupRequestResponseSignal( -+ const gchar* object_path, -+ GDBusSignalCallback callback) { -+ return g_dbus_connection_signal_subscribe( -+ connection_, kDesktopBusName, kRequestInterfaceName, "Response", -+ object_path, /*arg0=*/nullptr, G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE, -+ callback, this, /*user_data_free_func=*/nullptr); -+} -+ -+// static -+void BaseCapturerPipeWire::OnProxyRequested(GObject* /*object*/, -+ GAsyncResult* result, -+ gpointer user_data) { -+ BaseCapturerPipeWire* that = -+ static_cast(user_data); -+ RTC_DCHECK(that); -+ -+ GError* error = nullptr; -+ that->proxy_ = g_dbus_proxy_new_finish(result, &error); -+ if (!that->proxy_) { -+ RTC_LOG(LS_ERROR) << "Failed to create a proxy for the screen cast portal: " -+ << error->message; -+ g_error_free(error); -+ that->portal_init_failed_ = true; -+ return; -+ } -+ that->connection_ = g_dbus_proxy_get_connection(that->proxy_); -+ -+ RTC_LOG(LS_INFO) << "Created proxy for the screen cast portal."; -+ that->SessionRequest(); -+} -+ -+// static -+gchar* BaseCapturerPipeWire::PrepareSignalHandle(GDBusConnection* connection, -+ const gchar* token) { -+ gchar* sender = g_strdup(g_dbus_connection_get_unique_name(connection) + 1); -+ for (int i = 0; sender[i]; i++) { -+ if (sender[i] == '.') { -+ sender[i] = '_'; -+ } -+ } -+ -+ gchar* handle = g_strconcat(kDesktopRequestObjectPath, "/", sender, "/", -+ token, /*end of varargs*/ nullptr); -+ g_free(sender); -+ -+ return handle; -+} -+ -+void BaseCapturerPipeWire::SessionRequest() { -+ GVariantBuilder builder; -+ gchar* variant_string; -+ -+ g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT); -+ variant_string = -+ g_strdup_printf("webrtc_session%d", g_random_int_range(0, G_MAXINT)); -+ g_variant_builder_add(&builder, "{sv}", "session_handle_token", -+ g_variant_new_string(variant_string)); -+ g_free(variant_string); -+ variant_string = g_strdup_printf("webrtc%d", g_random_int_range(0, G_MAXINT)); -+ g_variant_builder_add(&builder, "{sv}", "handle_token", -+ g_variant_new_string(variant_string)); -+ -+ portal_handle_ = PrepareSignalHandle(connection_, variant_string); -+ session_request_signal_id_ = SetupRequestResponseSignal( -+ portal_handle_, OnSessionRequestResponseSignal); -+ g_free(variant_string); -+ -+ RTC_LOG(LS_INFO) << "Screen cast session requested."; -+ g_dbus_proxy_call( -+ proxy_, "CreateSession", g_variant_new("(a{sv})", &builder), -+ G_DBUS_CALL_FLAGS_NONE, /*timeout=*/-1, /*cancellable=*/nullptr, -+ reinterpret_cast(OnSessionRequested), this); -+} -+ -+// static -+void BaseCapturerPipeWire::OnSessionRequested(GDBusConnection* connection, -+ GAsyncResult* result, -+ gpointer user_data) { -+ BaseCapturerPipeWire* that = -+ static_cast(user_data); -+ RTC_DCHECK(that); -+ -+ GError* error = nullptr; -+ GVariant* variant = g_dbus_proxy_call_finish(that->proxy_, result, &error); -+ if (!variant) { -+ RTC_LOG(LS_ERROR) << "Failed to create a screen cast session: " -+ << error->message; -+ g_error_free(error); -+ that->portal_init_failed_ = true; -+ return; -+ } -+ RTC_LOG(LS_INFO) << "Initializing the screen cast session."; -+ -+ gchar* handle = nullptr; -+ g_variant_get_child(variant, 0, "o", &handle); -+ g_variant_unref(variant); -+ if (!handle) { -+ RTC_LOG(LS_ERROR) << "Failed to initialize the screen cast session."; -+ if (that->session_request_signal_id_) { -+ g_dbus_connection_signal_unsubscribe(connection, -+ that->session_request_signal_id_); -+ that->session_request_signal_id_ = 0; -+ } -+ that->portal_init_failed_ = true; -+ return; -+ } -+ -+ g_free(handle); -+ -+ RTC_LOG(LS_INFO) << "Subscribing to the screen cast session."; -+} -+ -+// static -+void BaseCapturerPipeWire::OnSessionRequestResponseSignal( -+ GDBusConnection* connection, -+ const gchar* sender_name, -+ const gchar* object_path, -+ const gchar* interface_name, -+ const gchar* signal_name, -+ GVariant* parameters, -+ gpointer user_data) { -+ BaseCapturerPipeWire* that = -+ static_cast(user_data); -+ RTC_DCHECK(that); -+ -+ -+ RTC_LOG(LS_INFO) -+ << "Received response for the screen cast session subscription."; -+ -+ guint32 portal_response; -+ GVariant* response_data; -+ g_variant_get(parameters, "(u@a{sv})", &portal_response, &response_data); -+ g_variant_lookup(response_data, "session_handle", "s", -+ &that->session_handle_); -+ g_variant_unref(response_data); -+ -+ if (!that->session_handle_ || portal_response) { -+ RTC_LOG(LS_ERROR) -+ << "Failed to request the screen cast session subscription."; -+ that->portal_init_failed_ = true; -+ return; -+ } -+ -+ that->SourcesRequest(); -+} -+ -+void BaseCapturerPipeWire::SourcesRequest() { -+ GVariantBuilder builder; -+ gchar* variant_string; -+ -+ g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT); -+ // We want to record monitor content. -+ g_variant_builder_add(&builder, "{sv}", "types", -+ g_variant_new_uint32(capture_source_type_)); -+ // We don't want to allow selection of multiple sources. -+ g_variant_builder_add(&builder, "{sv}", "multiple", -+ g_variant_new_boolean(false)); -+ variant_string = g_strdup_printf("webrtc%d", g_random_int_range(0, G_MAXINT)); -+ g_variant_builder_add(&builder, "{sv}", "handle_token", -+ g_variant_new_string(variant_string)); -+ -+ sources_handle_ = PrepareSignalHandle(connection_, variant_string); -+ sources_request_signal_id_ = SetupRequestResponseSignal( -+ sources_handle_, OnSourcesRequestResponseSignal); -+ g_free(variant_string); -+ -+ RTC_LOG(LS_INFO) << "Requesting sources from the screen cast session."; -+ g_dbus_proxy_call( -+ proxy_, "SelectSources", -+ g_variant_new("(oa{sv})", session_handle_, &builder), -+ G_DBUS_CALL_FLAGS_NONE, /*timeout=*/-1, /*cancellable=*/nullptr, -+ reinterpret_cast(OnSourcesRequested), this); -+} -+ -+// static -+void BaseCapturerPipeWire::OnSourcesRequested(GDBusConnection* connection, -+ GAsyncResult* result, -+ gpointer user_data) { -+ BaseCapturerPipeWire* that = -+ static_cast(user_data); -+ RTC_DCHECK(that); -+ -+ GError* error = nullptr; -+ GVariant* variant = g_dbus_proxy_call_finish(that->proxy_, result, &error); -+ if (!variant) { -+ RTC_LOG(LS_ERROR) << "Failed to request the sources: " << error->message; -+ g_error_free(error); -+ that->portal_init_failed_ = true; -+ return; -+ } -+ -+ RTC_LOG(LS_INFO) << "Sources requested from the screen cast session."; -+ -+ gchar* handle = nullptr; -+ g_variant_get_child(variant, 0, "o", &handle); -+ g_variant_unref(variant); -+ if (!handle) { -+ RTC_LOG(LS_ERROR) << "Failed to initialize the screen cast session."; -+ if (that->sources_request_signal_id_) { -+ g_dbus_connection_signal_unsubscribe(connection, -+ that->sources_request_signal_id_); -+ that->sources_request_signal_id_ = 0; -+ } -+ that->portal_init_failed_ = true; -+ return; -+ } -+ -+ g_free(handle); -+ -+ RTC_LOG(LS_INFO) << "Subscribed to sources signal."; -+} -+ -+// static -+void BaseCapturerPipeWire::OnSourcesRequestResponseSignal( -+ GDBusConnection* connection, -+ const gchar* sender_name, -+ const gchar* object_path, -+ const gchar* interface_name, -+ const gchar* signal_name, -+ GVariant* parameters, -+ gpointer user_data) { -+ BaseCapturerPipeWire* that = -+ static_cast(user_data); -+ RTC_DCHECK(that); -+ -+ guint32 portal_response; -+ g_variant_get(parameters, "(u@a{sv})", &portal_response, nullptr); -+ if (portal_response) { -+ RTC_LOG(LS_ERROR) -+ << "Failed to select sources for the screen cast session."; -+ that->portal_init_failed_ = true; -+ return; -+ } -+ -+ RTC_LOG(LS_INFO) << "Received sources signal from session."; -+ that->StartRequest(); -+} -+ -+void BaseCapturerPipeWire::StartRequest() { -+ GVariantBuilder builder; -+ gchar* variant_string; -+ -+ g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT); -+ variant_string = g_strdup_printf("webrtc%d", g_random_int_range(0, G_MAXINT)); -+ g_variant_builder_add(&builder, "{sv}", "handle_token", -+ g_variant_new_string(variant_string)); -+ -+ start_handle_ = PrepareSignalHandle(connection_, variant_string); -+ start_request_signal_id_ = -+ SetupRequestResponseSignal(start_handle_, OnStartRequestResponseSignal); -+ g_free(variant_string); -+ -+ // "Identifier for the application window", this is Wayland, so not "x11:...". -+ const gchar parent_window[] = ""; -+ -+ RTC_LOG(LS_INFO) << "Starting the screen cast session."; -+ g_dbus_proxy_call( -+ proxy_, "Start", -+ g_variant_new("(osa{sv})", session_handle_, parent_window, &builder), -+ G_DBUS_CALL_FLAGS_NONE, /*timeout=*/-1, /*cancellable=*/nullptr, -+ reinterpret_cast(OnStartRequested), this); -+} -+ -+// static -+void BaseCapturerPipeWire::OnStartRequested(GDBusConnection* connection, -+ GAsyncResult* result, -+ gpointer user_data) { -+ BaseCapturerPipeWire* that = -+ static_cast(user_data); -+ RTC_DCHECK(that); -+ -+ GError* error = nullptr; -+ GVariant* variant = g_dbus_proxy_call_finish(that->proxy_, result, &error); -+ if (!variant) { -+ RTC_LOG(LS_ERROR) << "Failed to start the screen cast session: " -+ << error->message; -+ g_error_free(error); -+ that->portal_init_failed_ = true; -+ return; -+ } -+ -+ RTC_LOG(LS_INFO) << "Initializing the start of the screen cast session."; -+ -+ gchar* handle = nullptr; -+ g_variant_get_child(variant, 0, "o", &handle); -+ g_variant_unref(variant); -+ if (!handle) { -+ RTC_LOG(LS_ERROR) -+ << "Failed to initialize the start of the screen cast session."; -+ if (that->start_request_signal_id_) { -+ g_dbus_connection_signal_unsubscribe(connection, -+ that->start_request_signal_id_); -+ that->start_request_signal_id_ = 0; -+ } -+ that->portal_init_failed_ = true; -+ return; -+ } -+ -+ g_free(handle); -+ -+ RTC_LOG(LS_INFO) << "Subscribed to the start signal."; -+} -+ -+// static -+void BaseCapturerPipeWire::OnStartRequestResponseSignal( -+ GDBusConnection* connection, -+ const gchar* sender_name, -+ const gchar* object_path, -+ const gchar* interface_name, -+ const gchar* signal_name, -+ GVariant* parameters, -+ gpointer user_data) { -+ BaseCapturerPipeWire* that = -+ static_cast(user_data); -+ RTC_DCHECK(that); -+ -+ RTC_LOG(LS_INFO) << "Start signal received."; -+ guint32 portal_response; -+ GVariant* response_data; -+ GVariantIter* iter = nullptr; -+ g_variant_get(parameters, "(u@a{sv})", &portal_response, &response_data); -+ if (portal_response || !response_data) { -+ RTC_LOG(LS_ERROR) << "Failed to start the screen cast session."; -+ that->portal_init_failed_ = true; -+ return; -+ } -+ -+ // Array of PipeWire streams. See -+ // https://github.com/flatpak/xdg-desktop-portal/blob/master/data/org.freedesktop.portal.ScreenCast.xml -+ // documentation for . -+ if (g_variant_lookup(response_data, "streams", "a(ua{sv})", &iter)) { -+ GVariant* variant; -+ -+ while (g_variant_iter_next(iter, "@(ua{sv})", &variant)) { -+ guint32 stream_id; -+ gint32 width; -+ gint32 height; -+ GVariant* options; -+ -+ g_variant_get(variant, "(u@a{sv})", &stream_id, &options); -+ RTC_DCHECK(options != nullptr); -+ -+ g_variant_lookup(options, "size", "(ii)", &width, &height); -+ -+ that->desktop_size_.set(width, height); -+ -+ g_variant_unref(options); -+ g_variant_unref(variant); -+ } -+ } -+ g_variant_iter_free(iter); -+ g_variant_unref(response_data); -+ -+ that->OpenPipeWireRemote(); -+} -+ -+void BaseCapturerPipeWire::OpenPipeWireRemote() { -+ GVariantBuilder builder; -+ g_variant_builder_init(&builder, G_VARIANT_TYPE_VARDICT); -+ -+ RTC_LOG(LS_INFO) << "Opening the PipeWire remote."; -+ -+ g_dbus_proxy_call_with_unix_fd_list( -+ proxy_, "OpenPipeWireRemote", -+ g_variant_new("(oa{sv})", session_handle_, &builder), -+ G_DBUS_CALL_FLAGS_NONE, /*timeout=*/-1, /*fd_list=*/nullptr, -+ /*cancellable=*/nullptr, -+ reinterpret_cast(OnOpenPipeWireRemoteRequested), -+ this); -+} -+ -+// static -+void BaseCapturerPipeWire::OnOpenPipeWireRemoteRequested( -+ GDBusConnection* connection, -+ GAsyncResult* result, -+ gpointer user_data) { -+ BaseCapturerPipeWire* that = -+ static_cast(user_data); -+ RTC_DCHECK(that); -+ -+ GError* error = nullptr; -+ GUnixFDList* outlist = nullptr; -+ GVariant* variant = g_dbus_proxy_call_with_unix_fd_list_finish( -+ that->proxy_, &outlist, result, &error); -+ if (!variant) { -+ RTC_LOG(LS_ERROR) << "Failed to open the PipeWire remote: " -+ << error->message; -+ g_error_free(error); -+ that->portal_init_failed_ = true; -+ return; -+ } -+ -+ gint32 index; -+ g_variant_get(variant, "(h)", &index); -+ -+ if ((that->pw_fd_ = g_unix_fd_list_get(outlist, index, &error)) == -1) { -+ RTC_LOG(LS_ERROR) << "Failed to get file descriptor from the list: " -+ << error->message; -+ g_error_free(error); -+ g_variant_unref(variant); -+ that->portal_init_failed_ = true; -+ return; -+ } -+ -+ g_variant_unref(variant); -+ g_object_unref(outlist); -+ -+ that->InitPipeWire(); -+ RTC_LOG(LS_INFO) << "PipeWire remote opened."; -+} -+ -+void BaseCapturerPipeWire::Start(Callback* callback) { -+ RTC_DCHECK(!callback_); -+ RTC_DCHECK(callback); -+ -+ InitPortals(); -+ -+ callback_ = callback; -+} -+ -+void BaseCapturerPipeWire::CaptureFrame() { -+ if (portal_init_failed_) { -+ callback_->OnCaptureResult(Result::ERROR_PERMANENT, nullptr); -+ return; -+ } -+ -+ if (!current_frame_) { -+ callback_->OnCaptureResult(Result::ERROR_TEMPORARY, nullptr); -+ return; -+ } -+ -+ std::unique_ptr result(new BasicDesktopFrame(desktop_size_)); -+ result->CopyPixelsFrom( -+ current_frame_, (desktop_size_.width() * kBytesPerPixelPw), -+ DesktopRect::MakeWH(desktop_size_.width(), desktop_size_.height())); -+ if (!result) { -+ callback_->OnCaptureResult(Result::ERROR_TEMPORARY, nullptr); -+ return; -+ } -+ callback_->OnCaptureResult(Result::SUCCESS, std::move(result)); -+} -+ -+bool BaseCapturerPipeWire::GetSourceList(SourceList* sources) { -+ RTC_DCHECK(sources->size() == 0); -+ // List of available screens is already presented by the xdg-desktop-portal. -+ // But we have to add an empty source as the code expects it. -+ sources->push_back({0}); -+ return true; -+} -+ -+bool BaseCapturerPipeWire::SelectSource(SourceId id) { -+ // Screen selection is handled by the xdg-desktop-portal. -+ return true; -+} -+ -+} // namespace webrtc -diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/base_capturer_pipewire.h.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/base_capturer_pipewire.h ---- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/base_capturer_pipewire.h.firefox-pipewire 2019-03-12 15:27:37.676285720 +0100 -+++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/base_capturer_pipewire.h 2019-03-12 16:08:26.294298896 +0100 -@@ -0,0 +1,166 @@ -+/* -+ * Copyright 2018 The WebRTC project authors. All Rights Reserved. -+ * -+ * Use of this source code is governed by a BSD-style license -+ * that can be found in the LICENSE file in the root of the source -+ * tree. An additional intellectual property rights grant can be found -+ * in the file PATENTS. All contributing project authors may -+ * be found in the AUTHORS file in the root of the source tree. -+ */ -+ -+#ifndef MODULES_DESKTOP_CAPTURE_BASE_CAPTURER_PIPEWIRE_H_ -+#define MODULES_DESKTOP_CAPTURE_BASE_CAPTURER_PIPEWIRE_H_ -+ -+#include -+#define typeof __typeof__ -+#include -+#include -+ -+#include "modules/desktop_capture/desktop_capture_options.h" -+#include "modules/desktop_capture/desktop_capturer.h" -+ -+namespace webrtc { -+ -+class PipeWireType { -+ public: -+ spa_type_media_type media_type; -+ spa_type_media_subtype media_subtype; -+ spa_type_format_video format_video; -+ spa_type_video_format video_format; -+}; -+ -+class BaseCapturerPipeWire : public DesktopCapturer { -+ public: -+ enum CaptureSourceType { Screen = 1, Window }; -+ -+ explicit BaseCapturerPipeWire(CaptureSourceType source_type); -+ ~BaseCapturerPipeWire() override; -+ -+ // DesktopCapturer interface. -+ void Start(Callback* delegate) override; -+ void CaptureFrame() override; -+ bool GetSourceList(SourceList* sources) override; -+ bool SelectSource(SourceId id) override; -+ -+ private: -+ // PipeWire types --> -+ pw_core* pw_core_ = nullptr; -+ pw_type* pw_core_type_ = nullptr; -+ pw_stream* pw_stream_ = nullptr; -+ pw_remote* pw_remote_ = nullptr; -+ pw_loop* pw_loop_ = nullptr; -+ pw_thread_loop* pw_main_loop_ = nullptr; -+ PipeWireType* pw_type_ = nullptr; -+ -+ spa_hook spa_stream_listener_ = {}; -+ spa_hook spa_remote_listener_ = {}; -+ -+ pw_stream_events pw_stream_events_ = {}; -+ pw_remote_events pw_remote_events_ = {}; -+ -+ spa_video_info_raw* spa_video_format_ = nullptr; -+ -+ gint32 pw_fd_ = -1; -+ -+ CaptureSourceType capture_source_type_ = -+ BaseCapturerPipeWire::CaptureSourceType::Screen; -+ -+ // <-- end of PipeWire types -+ -+ GDBusConnection* connection_ = nullptr; -+ GDBusProxy* proxy_ = nullptr; -+ gchar* portal_handle_ = nullptr; -+ gchar* session_handle_ = nullptr; -+ gchar* sources_handle_ = nullptr; -+ gchar* start_handle_ = nullptr; -+ guint session_request_signal_id_ = 0; -+ guint sources_request_signal_id_ = 0; -+ guint start_request_signal_id_ = 0; -+ -+ DesktopSize desktop_size_ = {}; -+ DesktopCaptureOptions options_ = {}; -+ -+ uint8_t* current_frame_ = nullptr; -+ Callback* callback_ = nullptr; -+ -+ bool portal_init_failed_ = false; -+ -+ void InitPortals(); -+ void InitPipeWire(); -+ void InitPipeWireTypes(); -+ -+ void CreateReceivingStream(); -+ void HandleBuffer(pw_buffer* buffer); -+ -+ void ConvertRGBxToBGRx(uint8_t* frame, uint32_t size); -+ -+ static void OnStateChanged(void* data, -+ pw_remote_state old_state, -+ pw_remote_state state, -+ const char* error); -+ static void OnStreamStateChanged(void* data, -+ pw_stream_state old_state, -+ pw_stream_state state, -+ const char* error_message); -+ -+ static void OnStreamFormatChanged(void* data, const struct spa_pod* format); -+ static void OnStreamProcess(void* data); -+ static void OnNewBuffer(void* data, uint32_t id); -+ -+ guint SetupRequestResponseSignal(const gchar* object_path, -+ GDBusSignalCallback callback); -+ -+ static void OnProxyRequested(GObject* object, -+ GAsyncResult* result, -+ gpointer user_data); -+ -+ static gchar* PrepareSignalHandle(GDBusConnection* connection, -+ const gchar* token); -+ -+ void SessionRequest(); -+ static void OnSessionRequested(GDBusConnection* connection, -+ GAsyncResult* result, -+ gpointer user_data); -+ static void OnSessionRequestResponseSignal(GDBusConnection* connection, -+ const gchar* sender_name, -+ const gchar* object_path, -+ const gchar* interface_name, -+ const gchar* signal_name, -+ GVariant* parameters, -+ gpointer user_data); -+ -+ void SourcesRequest(); -+ static void OnSourcesRequested(GDBusConnection* connection, -+ GAsyncResult* result, -+ gpointer user_data); -+ static void OnSourcesRequestResponseSignal(GDBusConnection* connection, -+ const gchar* sender_name, -+ const gchar* object_path, -+ const gchar* interface_name, -+ const gchar* signal_name, -+ GVariant* parameters, -+ gpointer user_data); -+ -+ void StartRequest(); -+ static void OnStartRequested(GDBusConnection* connection, -+ GAsyncResult* result, -+ gpointer user_data); -+ static void OnStartRequestResponseSignal(GDBusConnection* connection, -+ const gchar* sender_name, -+ const gchar* object_path, -+ const gchar* interface_name, -+ const gchar* signal_name, -+ GVariant* parameters, -+ gpointer user_data); -+ -+ void OpenPipeWireRemote(); -+ static void OnOpenPipeWireRemoteRequested(GDBusConnection* connection, -+ GAsyncResult* result, -+ gpointer user_data); -+ -+ RTC_DISALLOW_COPY_AND_ASSIGN(BaseCapturerPipeWire); -+}; -+ -+} // namespace webrtc -+ -+#endif // MODULES_DESKTOP_CAPTURE_BASE_CAPTURER_PIPEWIRE_H_ -diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build ---- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build.firefox-pipewire 2019-03-12 01:22:20.000000000 +0100 -+++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build 2019-03-12 15:27:37.676285720 +0100 -@@ -152,10 +152,10 @@ if CONFIG["OS_TARGET"] == "FreeBSD": - "/media/webrtc/trunk/webrtc/modules/desktop_capture/x11/x_server_pixel_buffer.cc" - ] - -+# Common Linux stuff between X11 and PipeWire - if CONFIG["OS_TARGET"] == "Linux": - - DEFINES["USE_NSS_CERTS"] = "1" -- DEFINES["USE_X11"] = "1" - DEFINES["WEBRTC_LINUX"] = True - DEFINES["WEBRTC_POSIX"] = True - DEFINES["_FILE_OFFSET_BITS"] = "64" -@@ -175,6 +175,18 @@ if CONFIG["OS_TARGET"] == "Linux": - ] - - UNIFIED_SOURCES += [ -+ "/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_linux.cc", -+ "/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc", -+ "/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc", -+ "/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc", -+ ] -+ -+# X11 specific files -+if CONFIG["OS_TARGET"] == "Linux": -+ -+ DEFINES["USE_X11"] = "1" -+ -+ UNIFIED_SOURCES += [ - "/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_x11.cc", - "/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_x11.cc", - "/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_x11.cc", -@@ -189,6 +201,27 @@ if CONFIG["OS_TARGET"] == "Linux": - "/media/webrtc/trunk/webrtc/modules/desktop_capture/x11/x_server_pixel_buffer.cc" - ] - -+# PipeWire specific files -+if CONFIG["OS_TARGET"] == "Linux": -+ -+ DEFINES["WEBRTC_USE_PIPEWIRE"] = "1" -+ -+ OS_LIBS += [ -+ "rt", -+ "pipewire-0.2", -+ "glib-2.0", -+ "gio-2.0", -+ "gobject-2.0" -+ ] -+ -+ CXXFLAGS += CONFIG['TK_CFLAGS'] -+ -+ UNIFIED_SOURCES += [ -+ "/media/webrtc/trunk/webrtc/modules/desktop_capture/base_capturer_pipewire.cc", -+ "/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_pipewire.cc", -+ "/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_pipewire.cc" -+ ] -+ - if CONFIG["OS_TARGET"] == "NetBSD": - - DEFINES["USE_X11"] = "1" -diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_options.h.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_options.h ---- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_options.h.firefox-pipewire 2019-03-12 01:22:21.000000000 +0100 -+++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_options.h 2019-03-12 15:27:37.677285729 +0100 -@@ -113,6 +113,11 @@ class DesktopCaptureOptions { - } - #endif - -+#if defined(WEBRTC_USE_PIPEWIRE) -+ bool allow_pipewire() const { return allow_pipewire_; } -+ void set_allow_pipewire(bool allow) { allow_pipewire_ = allow; } -+#endif -+ - private: - #if defined(USE_X11) - rtc::scoped_refptr x_display_; -@@ -135,6 +140,9 @@ class DesktopCaptureOptions { - #endif - bool disable_effects_ = true; - bool detect_updated_region_ = false; -+#if defined(WEBRTC_USE_PIPEWIRE) -+ bool allow_pipewire_ = true; -+#endif - }; - - } // namespace webrtc -diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capturer.cc.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capturer.cc ---- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capturer.cc.firefox-pipewire 2019-03-12 01:22:21.000000000 +0100 -+++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capturer.cc 2019-03-12 15:27:37.677285729 +0100 -@@ -70,4 +70,17 @@ std::unique_ptr Desktop - return capturer; - } - -+#if defined(WEBRTC_USE_PIPEWIRE) || defined(USE_X11) -+bool DesktopCapturer::IsRunningUnderWayland() { -+ const char* xdg_session_type = getenv("XDG_SESSION_TYPE"); -+ if (!xdg_session_type || strncmp(xdg_session_type, "wayland", 7) != 0) -+ return false; -+ -+ if (!(getenv("WAYLAND_DISPLAY"))) -+ return false; -+ -+ return true; -+} -+#endif -+ - } // namespace webrtc -diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capturer.h.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capturer.h ---- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capturer.h.firefox-pipewire 2019-03-12 01:22:20.000000000 +0100 -+++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capturer.h 2019-03-12 15:27:37.677285729 +0100 -@@ -139,6 +139,10 @@ class DesktopCapturer { - static std::unique_ptr CreateAppCapturer( - const DesktopCaptureOptions& options); - -+#if defined(WEBRTC_USE_PIPEWIRE) || defined(USE_X11) -+ static bool IsRunningUnderWayland(); -+#endif -+ - protected: - // CroppingWindowCapturer needs to create raw capturers without wrappers, so - // the following two functions are protected. -diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc ---- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc.firefox-pipewire 2019-03-12 15:27:37.677285729 +0100 -+++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc 2019-03-12 15:27:37.677285729 +0100 -@@ -0,0 +1,40 @@ -+/* -+ * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved. -+ * -+ * Use of this source code is governed by a BSD-style license -+ * that can be found in the LICENSE file in the root of the source -+ * tree. An additional intellectual property rights grant can be found -+ * in the file PATENTS. All contributing project authors may -+ * be found in the AUTHORS file in the root of the source tree. -+ */ -+ -+#include "modules/desktop_capture/mouse_cursor_monitor.h" -+ -+#if defined(USE_X11) -+#include "modules/desktop_capture/mouse_cursor_monitor_x11.h" -+#endif // defined(USE_X11) -+ -+namespace webrtc { -+ -+// static -+MouseCursorMonitor* MouseCursorMonitor::CreateForWindow( -+ const DesktopCaptureOptions& options, WindowId window) { -+#if defined(USE_X11) -+ return MouseCursorMonitorX11::CreateForWindow(options, window); -+#else -+ return nullptr; -+#endif // defined(USE_X11) -+} -+ -+// static -+MouseCursorMonitor* MouseCursorMonitor::CreateForScreen( -+ const DesktopCaptureOptions& options, -+ ScreenId screen) { -+#if defined(USE_X11) -+ return MouseCursorMonitorX11::CreateForScreen(options, screen); -+#else -+ return nullptr; -+#endif // defined(USE_X11) -+} -+ -+} // namespace webrtc -diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_x11.cc.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_x11.cc ---- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_x11.cc.firefox-pipewire 2019-03-12 01:22:21.000000000 +0100 -+++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_x11.cc 2019-03-12 15:27:37.678285739 +0100 -@@ -16,6 +16,8 @@ - #include - #include - -+#include "modules/desktop_capture/mouse_cursor_monitor_x11.h" -+ - #include "modules/desktop_capture/desktop_capture_options.h" - #include "modules/desktop_capture/desktop_capture_types.h" - #include "modules/desktop_capture/desktop_frame.h" -@@ -60,37 +62,6 @@ Window GetTopLevelWindow(Display* displa - - namespace webrtc { - --class MouseCursorMonitorX11 : public MouseCursorMonitor, -- public SharedXDisplay::XEventHandler { -- public: -- MouseCursorMonitorX11(const DesktopCaptureOptions& options, Window window, Window inner_window); -- ~MouseCursorMonitorX11() override; -- -- void Init(Callback* callback, Mode mode) override; -- void Capture() override; -- -- private: -- // SharedXDisplay::XEventHandler interface. -- bool HandleXEvent(const XEvent& event) override; -- -- Display* display() { return x_display_->display(); } -- -- // Captures current cursor shape and stores it in |cursor_shape_|. -- void CaptureCursor(); -- -- rtc::scoped_refptr x_display_; -- Callback* callback_; -- Mode mode_; -- Window window_; -- Window inner_window_; -- -- bool have_xfixes_; -- int xfixes_event_base_; -- int xfixes_error_base_; -- -- std::unique_ptr cursor_shape_; --}; -- - MouseCursorMonitorX11::MouseCursorMonitorX11( - const DesktopCaptureOptions& options, - Window window, Window inner_window) -@@ -257,7 +228,7 @@ void MouseCursorMonitorX11::CaptureCurso - } - - // static --MouseCursorMonitor* MouseCursorMonitor::CreateForWindow( -+MouseCursorMonitor* MouseCursorMonitorX11::CreateForWindow( - const DesktopCaptureOptions& options, WindowId window) { - if (!options.x_display()) - return NULL; -@@ -267,7 +238,7 @@ MouseCursorMonitor* MouseCursorMonitor:: - return new MouseCursorMonitorX11(options, outer_window, window); - } - --MouseCursorMonitor* MouseCursorMonitor::CreateForScreen( -+MouseCursorMonitor* MouseCursorMonitorX11::CreateForScreen( - const DesktopCaptureOptions& options, - ScreenId screen) { - if (!options.x_display()) -diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_x11.h.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_x11.h ---- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_x11.h.firefox-pipewire 2019-03-12 15:27:37.678285739 +0100 -+++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_x11.h 2019-03-13 08:06:28.525517995 +0100 -@@ -0,0 +1,62 @@ -+/* -+ * Copyright 2018 The WebRTC project authors. All Rights Reserved. -+ * -+ * Use of this source code is governed by a BSD-style license -+ * that can be found in the LICENSE file in the root of the source -+ * tree. An additional intellectual property rights grant can be found -+ * in the file PATENTS. All contributing project authors may -+ * be found in the AUTHORS file in the root of the source tree. -+ */ -+ -+#ifndef MODULES_DESKTOP_CAPTURE_MOUSE_CURSOR_MONITOR_X11_H_ -+#define MODULES_DESKTOP_CAPTURE_MOUSE_CURSOR_MONITOR_X11_H_ -+ -+#include -+#include -+ -+#include "modules/desktop_capture/desktop_capture_options.h" -+#include "modules/desktop_capture/desktop_capture_types.h" -+#include "modules/desktop_capture/x11/shared_x_display.h" -+#include "modules/desktop_capture/mouse_cursor.h" -+#include "modules/desktop_capture/mouse_cursor_monitor.h" -+#include "rtc_base/scoped_ref_ptr.h" -+ -+namespace webrtc { -+ -+class MouseCursorMonitorX11 : public MouseCursorMonitor, -+ public SharedXDisplay::XEventHandler { -+ public: -+ MouseCursorMonitorX11(const DesktopCaptureOptions& options, Window window, Window inner_window); -+ ~MouseCursorMonitorX11() override; -+ -+ void Init(Callback* callback, Mode mode) override; -+ void Capture() override; -+ -+ static MouseCursorMonitor* CreateForWindow(const DesktopCaptureOptions& options, WindowId window); -+ static MouseCursorMonitor* CreateForScreen(const DesktopCaptureOptions& options, ScreenId screen); -+ -+ private: -+ // SharedXDisplay::XEventHandler interface. -+ bool HandleXEvent(const XEvent& event) override; -+ -+ Display* display() { return x_display_->display(); } -+ -+ // Captures current cursor shape and stores it in |cursor_shape_|. -+ void CaptureCursor(); -+ -+ rtc::scoped_refptr x_display_; -+ Callback* callback_; -+ Mode mode_; -+ Window window_; -+ Window inner_window_; -+ -+ bool have_xfixes_; -+ int xfixes_event_base_; -+ int xfixes_error_base_; -+ -+ std::unique_ptr cursor_shape_; -+}; -+ -+} // namespace webrtc -+ -+#endif // MODULES_DESKTOP_CAPTURE_MOUSE_CURSOR_MONITOR_X11_H_ -diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc ---- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc.firefox-pipewire 2019-03-12 15:27:37.678285739 +0100 -+++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc 2019-03-12 15:27:37.678285739 +0100 -@@ -0,0 +1,40 @@ -+/* -+ * Copyright 2018 The WebRTC project authors. All Rights Reserved. -+ * -+ * Use of this source code is governed by a BSD-style license -+ * that can be found in the LICENSE file in the root of the source -+ * tree. An additional intellectual property rights grant can be found -+ * in the file PATENTS. All contributing project authors may -+ * be found in the AUTHORS file in the root of the source tree. -+ */ -+ -+#include "modules/desktop_capture/desktop_capture_options.h" -+#include "modules/desktop_capture/desktop_capturer.h" -+ -+#if defined(WEBRTC_USE_PIPEWIRE) -+#include "modules/desktop_capture/screen_capturer_pipewire.h" -+#endif // defined(WEBRTC_USE_PIPEWIRE) -+ -+#if defined(USE_X11) -+#include "modules/desktop_capture/screen_capturer_x11.h" -+#endif // defined(USE_X11) -+ -+namespace webrtc { -+ -+// static -+std::unique_ptr DesktopCapturer::CreateRawScreenCapturer( -+ const DesktopCaptureOptions& options) { -+#if defined(WEBRTC_USE_PIPEWIRE) -+ if (options.allow_pipewire() && DesktopCapturer::IsRunningUnderWayland()) { -+ return ScreenCapturerPipeWire::CreateRawScreenCapturer(options); -+ } -+#endif // defined(WEBRTC_USE_PIPEWIRE) -+ -+#if defined(USE_X11) -+ return ScreenCapturerX11::CreateRawScreenCapturer(options); -+#endif // defined(USE_X11) -+ -+ return nullptr; -+} -+ -+} // namespace webrtc -diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_pipewire.cc.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_pipewire.cc ---- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_pipewire.cc.firefox-pipewire 2019-03-12 15:27:37.678285739 +0100 -+++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_pipewire.cc 2019-03-12 15:27:37.678285739 +0100 -@@ -0,0 +1,31 @@ -+/* -+ * Copyright 2018 The WebRTC project authors. All Rights Reserved. -+ * -+ * Use of this source code is governed by a BSD-style license -+ * that can be found in the LICENSE file in the root of the source -+ * tree. An additional intellectual property rights grant can be found -+ * in the file PATENTS. All contributing project authors may -+ * be found in the AUTHORS file in the root of the source tree. -+ */ -+ -+#include "modules/desktop_capture/screen_capturer_pipewire.h" -+ -+#include -+ -+namespace webrtc { -+ -+ScreenCapturerPipeWire::ScreenCapturerPipeWire() -+ : BaseCapturerPipeWire(BaseCapturerPipeWire::CaptureSourceType::Screen) {} -+ScreenCapturerPipeWire::~ScreenCapturerPipeWire() {} -+ -+// static -+std::unique_ptr -+ScreenCapturerPipeWire::CreateRawScreenCapturer( -+ const DesktopCaptureOptions& options) { -+ std::unique_ptr capturer( -+ new ScreenCapturerPipeWire()); -+ -+ return std::move(capturer); -+} -+ -+} // namespace webrtc -diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_pipewire.h.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_pipewire.h ---- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_pipewire.h.firefox-pipewire 2019-03-12 15:27:37.679285748 +0100 -+++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_pipewire.h 2019-03-12 15:27:37.679285748 +0100 -@@ -0,0 +1,33 @@ -+/* -+ * Copyright 2018 The WebRTC project authors. All Rights Reserved. -+ * -+ * Use of this source code is governed by a BSD-style license -+ * that can be found in the LICENSE file in the root of the source -+ * tree. An additional intellectual property rights grant can be found -+ * in the file PATENTS. All contributing project authors may -+ * be found in the AUTHORS file in the root of the source tree. -+ */ -+ -+#ifndef MODULES_DESKTOP_CAPTURE_SCREEN_CAPTURER_PIPEWIRE_H_ -+#define MODULES_DESKTOP_CAPTURE_SCREEN_CAPTURER_PIPEWIRE_H_ -+ -+#include -+ -+#include "modules/desktop_capture/base_capturer_pipewire.h" -+ -+namespace webrtc { -+ -+class ScreenCapturerPipeWire : public BaseCapturerPipeWire { -+ public: -+ ScreenCapturerPipeWire(); -+ ~ScreenCapturerPipeWire() override; -+ -+ static std::unique_ptr CreateRawScreenCapturer( -+ const DesktopCaptureOptions& options); -+ -+ RTC_DISALLOW_COPY_AND_ASSIGN(ScreenCapturerPipeWire); -+}; -+ -+} // namespace webrtc -+ -+#endif // MODULES_DESKTOP_CAPTURE_SCREEN_CAPTURER_PIPEWIRE_H_ -diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_x11.cc.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_x11.cc ---- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_x11.cc.firefox-pipewire 2019-03-12 01:22:21.000000000 +0100 -+++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_x11.cc 2019-03-12 15:27:37.679285748 +0100 -@@ -19,6 +19,8 @@ - #include - #include - -+#include "modules/desktop_capture/screen_capturer_x11.h" -+ - #include "modules/desktop_capture/desktop_capture_options.h" - #include "modules/desktop_capture/desktop_capturer.h" - #include "modules/desktop_capture/desktop_frame.h" -@@ -32,99 +34,12 @@ - #include "rtc_base/timeutils.h" - - namespace webrtc { --namespace { -- --// A class to perform video frame capturing for Linux. --// --// If XDamage is used, this class sets DesktopFrame::updated_region() according --// to the areas reported by XDamage. Otherwise this class does not detect --// DesktopFrame::updated_region(), the field is always set to the entire frame --// rectangle. ScreenCapturerDifferWrapper should be used if that functionality --// is necessary. --class ScreenCapturerLinux : public DesktopCapturer, -- public SharedXDisplay::XEventHandler { -- public: -- ScreenCapturerLinux(); -- ~ScreenCapturerLinux() override; -- -- // TODO(ajwong): Do we really want this to be synchronous? -- bool Init(const DesktopCaptureOptions& options); -- -- // DesktopCapturer interface. -- void Start(Callback* delegate) override; -- void CaptureFrame() override; -- bool GetSourceList(SourceList* sources) override; -- bool SelectSource(SourceId id) override; -- -- private: -- Display* display() { return options_.x_display()->display(); } -- -- // SharedXDisplay::XEventHandler interface. -- bool HandleXEvent(const XEvent& event) override; -- -- void InitXDamage(); -- -- // Capture screen pixels to the current buffer in the queue. In the DAMAGE -- // case, the ScreenCapturerHelper already holds the list of invalid rectangles -- // from HandleXEvent(). In the non-DAMAGE case, this captures the -- // whole screen, then calculates some invalid rectangles that include any -- // differences between this and the previous capture. -- std::unique_ptr CaptureScreen(); -- -- // Called when the screen configuration is changed. -- void ScreenConfigurationChanged(); -- -- // Synchronize the current buffer with |last_buffer_|, by copying pixels from -- // the area of |last_invalid_rects|. -- // Note this only works on the assumption that kNumBuffers == 2, as -- // |last_invalid_rects| holds the differences from the previous buffer and -- // the one prior to that (which will then be the current buffer). -- void SynchronizeFrame(); -- -- void DeinitXlib(); -- -- DesktopCaptureOptions options_; -- -- Callback* callback_ = nullptr; -- -- // X11 graphics context. -- GC gc_ = nullptr; -- Window root_window_ = BadValue; -- -- // XFixes. -- bool has_xfixes_ = false; -- int xfixes_event_base_ = -1; -- int xfixes_error_base_ = -1; -- -- // XDamage information. -- bool use_damage_ = false; -- Damage damage_handle_ = 0; -- int damage_event_base_ = -1; -- int damage_error_base_ = -1; -- XserverRegion damage_region_ = 0; -- -- // Access to the X Server's pixel buffer. -- XServerPixelBuffer x_server_pixel_buffer_; -- -- // A thread-safe list of invalid rectangles, and the size of the most -- // recently captured screen. -- ScreenCapturerHelper helper_; -- -- // Queue of the frames buffers. -- ScreenCaptureFrameQueue queue_; -- -- // Invalid region from the previous capture. This is used to synchronize the -- // current with the last buffer used. -- DesktopRegion last_invalid_region_; - -- RTC_DISALLOW_COPY_AND_ASSIGN(ScreenCapturerLinux); --}; -- --ScreenCapturerLinux::ScreenCapturerLinux() { -+ScreenCapturerX11::ScreenCapturerX11() { - helper_.SetLogGridSize(4); - } - --ScreenCapturerLinux::~ScreenCapturerLinux() { -+ScreenCapturerX11::~ScreenCapturerX11() { - options_.x_display()->RemoveEventHandler(ConfigureNotify, this); - if (use_damage_) { - options_.x_display()->RemoveEventHandler( -@@ -133,7 +48,7 @@ ScreenCapturerLinux::~ScreenCapturerLinu - DeinitXlib(); - } - --bool ScreenCapturerLinux::Init(const DesktopCaptureOptions& options) { -+bool ScreenCapturerX11::Init(const DesktopCaptureOptions& options) { - options_ = options; - - root_window_ = RootWindow(display(), DefaultScreen(display())); -@@ -176,7 +91,7 @@ bool ScreenCapturerLinux::Init(const Des - return true; - } - --void ScreenCapturerLinux::InitXDamage() { -+void ScreenCapturerX11::InitXDamage() { - // Our use of XDamage requires XFixes. - if (!has_xfixes_) { - return; -@@ -217,14 +132,14 @@ void ScreenCapturerLinux::InitXDamage() - RTC_LOG(LS_INFO) << "Using XDamage extension."; - } - --void ScreenCapturerLinux::Start(Callback* callback) { -+void ScreenCapturerX11::Start(Callback* callback) { - RTC_DCHECK(!callback_); - RTC_DCHECK(callback); - - callback_ = callback; - } - --void ScreenCapturerLinux::CaptureFrame() { -+void ScreenCapturerX11::CaptureFrame() { - int64_t capture_start_time_nanos = rtc::TimeNanos(); - - queue_.MoveToNextFrame(); -@@ -238,6 +153,7 @@ void ScreenCapturerLinux::CaptureFrame() - // in a good shape. - if (!x_server_pixel_buffer_.is_initialized()) { - // We failed to initialize pixel buffer. -+ RTC_LOG(LS_ERROR) << "Pixel buffer is not initialized."; - callback_->OnCaptureResult(Result::ERROR_PERMANENT, nullptr); - return; - } -@@ -253,6 +169,7 @@ void ScreenCapturerLinux::CaptureFrame() - - std::unique_ptr result = CaptureScreen(); - if (!result) { -+ RTC_LOG(LS_WARNING) << "Temporarily failed to capture screen."; - callback_->OnCaptureResult(Result::ERROR_TEMPORARY, nullptr); - return; - } -@@ -263,19 +180,19 @@ void ScreenCapturerLinux::CaptureFrame() - callback_->OnCaptureResult(Result::SUCCESS, std::move(result)); - } - --bool ScreenCapturerLinux::GetSourceList(SourceList* sources) { -+bool ScreenCapturerX11::GetSourceList(SourceList* sources) { - RTC_DCHECK(sources->size() == 0); - // TODO(jiayl): implement screen enumeration. - sources->push_back({0}); - return true; - } - --bool ScreenCapturerLinux::SelectSource(SourceId id) { -+bool ScreenCapturerX11::SelectSource(SourceId id) { - // TODO(jiayl): implement screen selection. - return true; - } - --bool ScreenCapturerLinux::HandleXEvent(const XEvent& event) { -+bool ScreenCapturerX11::HandleXEvent(const XEvent& event) { - if (use_damage_ && (event.type == damage_event_base_ + XDamageNotify)) { - const XDamageNotifyEvent* damage_event = - reinterpret_cast(&event); -@@ -290,7 +207,7 @@ bool ScreenCapturerLinux::HandleXEvent(c - return false; - } - --std::unique_ptr ScreenCapturerLinux::CaptureScreen() { -+std::unique_ptr ScreenCapturerX11::CaptureScreen() { - std::unique_ptr frame = queue_.current_frame()->Share(); - RTC_DCHECK(x_server_pixel_buffer_.window_size().equals(frame->size())); - -@@ -348,7 +265,7 @@ std::unique_ptr ScreenCapt - return std::move(frame); - } - --void ScreenCapturerLinux::ScreenConfigurationChanged() { -+void ScreenCapturerX11::ScreenConfigurationChanged() { - // Make sure the frame buffers will be reallocated. - queue_.Reset(); - -@@ -359,7 +276,7 @@ void ScreenCapturerLinux::ScreenConfigur - } - } - --void ScreenCapturerLinux::SynchronizeFrame() { -+void ScreenCapturerX11::SynchronizeFrame() { - // Synchronize the current buffer with the previous one since we do not - // capture the entire desktop. Note that encoder may be reading from the - // previous buffer at this time so thread access complaints are false -@@ -379,7 +296,7 @@ void ScreenCapturerLinux::SynchronizeFra - } - } - --void ScreenCapturerLinux::DeinitXlib() { -+void ScreenCapturerX11::DeinitXlib() { - if (gc_) { - XFreeGC(display(), gc_); - gc_ = nullptr; -@@ -400,15 +317,13 @@ void ScreenCapturerLinux::DeinitXlib() { - } - } - --} // namespace -- - // static --std::unique_ptr DesktopCapturer::CreateRawScreenCapturer( -+std::unique_ptr ScreenCapturerX11::CreateRawScreenCapturer( - const DesktopCaptureOptions& options) { - if (!options.x_display()) - return nullptr; - -- std::unique_ptr capturer(new ScreenCapturerLinux()); -+ std::unique_ptr capturer(new ScreenCapturerX11()); - if (!capturer.get()->Init(options)) { - return nullptr; - } -diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_x11.h.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_x11.h ---- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_x11.h.firefox-pipewire 2019-03-12 15:27:37.679285748 +0100 -+++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_x11.h 2019-03-13 08:06:40.412607602 +0100 -@@ -0,0 +1,123 @@ -+/* -+ * Copyright 2018 The WebRTC project authors. All Rights Reserved. -+ * -+ * Use of this source code is governed by a BSD-style license -+ * that can be found in the LICENSE file in the root of the source -+ * tree. An additional intellectual property rights grant can be found -+ * in the file PATENTS. All contributing project authors may -+ * be found in the AUTHORS file in the root of the source tree. -+ */ -+ -+#ifndef MODULES_DESKTOP_CAPTURE_SCREEN_CAPTURER_X11_H_ -+#define MODULES_DESKTOP_CAPTURE_SCREEN_CAPTURER_X11_H_ -+ -+#include -+#include -+#include -+#include -+#include -+ -+#include "modules/desktop_capture/desktop_capture_options.h" -+#include "modules/desktop_capture/desktop_capturer.h" -+#include "modules/desktop_capture/desktop_frame.h" -+#include "modules/desktop_capture/desktop_region.h" -+#include "modules/desktop_capture/x11/shared_x_display.h" -+#include "modules/desktop_capture/x11/x_server_pixel_buffer.h" -+#include "modules/desktop_capture/screen_capture_frame_queue.h" -+#include "modules/desktop_capture/screen_capturer_helper.h" -+#include "modules/desktop_capture/shared_desktop_frame.h" -+#include "rtc_base/constructormagic.h" -+ -+namespace webrtc { -+ -+// A class to perform video frame capturing for Linux on X11. -+// -+// If XDamage is used, this class sets DesktopFrame::updated_region() according -+// to the areas reported by XDamage. Otherwise this class does not detect -+// DesktopFrame::updated_region(), the field is always set to the entire frame -+// rectangle. ScreenCapturerDifferWrapper should be used if that functionality -+// is necessary. -+class ScreenCapturerX11 : public DesktopCapturer, -+ public SharedXDisplay::XEventHandler { -+ public: -+ ScreenCapturerX11(); -+ ~ScreenCapturerX11() override; -+ -+ static std::unique_ptr CreateRawScreenCapturer(const DesktopCaptureOptions& options); -+ -+ // TODO(ajwong): Do we really want this to be synchronous? -+ bool Init(const DesktopCaptureOptions& options); -+ -+ // DesktopCapturer interface. -+ void Start(Callback* delegate) override; -+ void CaptureFrame() override; -+ bool GetSourceList(SourceList* sources) override; -+ bool SelectSource(SourceId id) override; -+ -+ private: -+ Display* display() { return options_.x_display()->display(); } -+ -+ // SharedXDisplay::XEventHandler interface. -+ bool HandleXEvent(const XEvent& event) override; -+ -+ void InitXDamage(); -+ -+ // Capture screen pixels to the current buffer in the queue. In the DAMAGE -+ // case, the ScreenCapturerHelper already holds the list of invalid rectangles -+ // from HandleXEvent(). In the non-DAMAGE case, this captures the -+ // whole screen, then calculates some invalid rectangles that include any -+ // differences between this and the previous capture. -+ std::unique_ptr CaptureScreen(); -+ -+ // Called when the screen configuration is changed. -+ void ScreenConfigurationChanged(); -+ -+ // Synchronize the current buffer with |last_buffer_|, by copying pixels from -+ // the area of |last_invalid_rects|. -+ // Note this only works on the assumption that kNumBuffers == 2, as -+ // |last_invalid_rects| holds the differences from the previous buffer and -+ // the one prior to that (which will then be the current buffer). -+ void SynchronizeFrame(); -+ -+ void DeinitXlib(); -+ -+ DesktopCaptureOptions options_; -+ -+ Callback* callback_ = nullptr; -+ -+ // X11 graphics context. -+ GC gc_ = nullptr; -+ Window root_window_ = BadValue; -+ -+ // XFixes. -+ bool has_xfixes_ = false; -+ int xfixes_event_base_ = -1; -+ int xfixes_error_base_ = -1; -+ -+ // XDamage information. -+ bool use_damage_ = false; -+ Damage damage_handle_ = 0; -+ int damage_event_base_ = -1; -+ int damage_error_base_ = -1; -+ XserverRegion damage_region_ = 0; -+ -+ // Access to the X Server's pixel buffer. -+ XServerPixelBuffer x_server_pixel_buffer_; -+ -+ // A thread-safe list of invalid rectangles, and the size of the most -+ // recently captured screen. -+ ScreenCapturerHelper helper_; -+ -+ // Queue of the frames buffers. -+ ScreenCaptureFrameQueue queue_; -+ -+ // Invalid region from the previous capture. This is used to synchronize the -+ // current with the last buffer used. -+ DesktopRegion last_invalid_region_; -+ -+ RTC_DISALLOW_COPY_AND_ASSIGN(ScreenCapturerX11); -+}; -+ -+} // namespace webrtc -+ -+#endif // MODULES_DESKTOP_CAPTURE_SCREEN_CAPTURER_X11_H_ -diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc ---- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc.firefox-pipewire 2019-03-12 15:27:37.679285748 +0100 -+++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc 2019-03-12 15:27:37.679285748 +0100 -@@ -0,0 +1,40 @@ -+/* -+ * Copyright 2018 The WebRTC project authors. All Rights Reserved. -+ * -+ * Use of this source code is governed by a BSD-style license -+ * that can be found in the LICENSE file in the root of the source -+ * tree. An additional intellectual property rights grant can be found -+ * in the file PATENTS. All contributing project authors may -+ * be found in the AUTHORS file in the root of the source tree. -+ */ -+ -+#include "modules/desktop_capture/desktop_capture_options.h" -+#include "modules/desktop_capture/desktop_capturer.h" -+ -+#if defined(WEBRTC_USE_PIPEWIRE) -+#include "modules/desktop_capture/window_capturer_pipewire.h" -+#endif // defined(WEBRTC_USE_PIPEWIRE) -+ -+#if defined(USE_X11) -+#include "modules/desktop_capture/window_capturer_x11.h" -+#endif // defined(USE_X11) -+ -+namespace webrtc { -+ -+// static -+std::unique_ptr DesktopCapturer::CreateRawWindowCapturer( -+ const DesktopCaptureOptions& options) { -+#if defined(WEBRTC_USE_PIPEWIRE) -+ if (options.allow_pipewire() && DesktopCapturer::IsRunningUnderWayland()) { -+ return WindowCapturerPipeWire::CreateRawWindowCapturer(options); -+ } -+#endif // defined(WEBRTC_USE_PIPEWIRE) -+ -+#if defined(USE_X11) -+ return WindowCapturerX11::CreateRawWindowCapturer(options); -+#endif // defined(USE_X11) -+ -+ return nullptr; -+} -+ -+} // namespace webrtc -diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_pipewire.cc.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_pipewire.cc ---- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_pipewire.cc.firefox-pipewire 2019-03-12 15:27:37.680285758 +0100 -+++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_pipewire.cc 2019-03-12 15:27:37.680285758 +0100 -@@ -0,0 +1,28 @@ -+/* -+ * Copyright 2018 The WebRTC project authors. All Rights Reserved. -+ * -+ * Use of this source code is governed by a BSD-style license -+ * that can be found in the LICENSE file in the root of the source -+ * tree. An additional intellectual property rights grant can be found -+ * in the file PATENTS. All contributing project authors may -+ * be found in the AUTHORS file in the root of the source tree. -+ */ -+ -+#include "modules/desktop_capture/window_capturer_pipewire.h" -+ -+namespace webrtc { -+ -+WindowCapturerPipeWire::WindowCapturerPipeWire() -+ : BaseCapturerPipeWire(BaseCapturerPipeWire::CaptureSourceType::Window) {} -+WindowCapturerPipeWire::~WindowCapturerPipeWire() {} -+ -+// static -+std::unique_ptr -+WindowCapturerPipeWire::CreateRawWindowCapturer( -+ const DesktopCaptureOptions& options) { -+ std::unique_ptr capturer( -+ new WindowCapturerPipeWire()); -+ -+ return std::move(capturer); -+} -+} // namespace webrtc -diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_pipewire.h.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_pipewire.h ---- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_pipewire.h.firefox-pipewire 2019-03-12 15:27:37.680285758 +0100 -+++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_pipewire.h 2019-03-12 15:27:37.680285758 +0100 -@@ -0,0 +1,33 @@ -+/* -+ * Copyright 2018 The WebRTC project authors. All Rights Reserved. -+ * -+ * Use of this source code is governed by a BSD-style license -+ * that can be found in the LICENSE file in the root of the source -+ * tree. An additional intellectual property rights grant can be found -+ * in the file PATENTS. All contributing project authors may -+ * be found in the AUTHORS file in the root of the source tree. -+ */ -+ -+#ifndef MODULES_DESKTOP_CAPTURE_WINDOW_CAPTURER_PIPEWIRE_H_ -+#define MODULES_DESKTOP_CAPTURE_WINDOW_CAPTURER_PIPEWIRE_H_ -+ -+#include -+ -+#include "modules/desktop_capture/base_capturer_pipewire.h" -+ -+namespace webrtc { -+ -+class WindowCapturerPipeWire : public BaseCapturerPipeWire { -+ public: -+ WindowCapturerPipeWire(); -+ ~WindowCapturerPipeWire() override; -+ -+ static std::unique_ptr CreateRawWindowCapturer( -+ const DesktopCaptureOptions& options); -+ -+ RTC_DISALLOW_COPY_AND_ASSIGN(WindowCapturerPipeWire); -+}; -+ -+} // namespace webrtc -+ -+#endif // MODULES_DESKTOP_CAPTURE_WINDOW_CAPTURER_PIPEWIRE_H_ -diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_x11.cc.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_x11.cc ---- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_x11.cc.firefox-pipewire 2019-03-12 01:22:21.000000000 +0100 -+++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_x11.cc 2019-03-12 15:27:37.680285758 +0100 -@@ -16,6 +16,8 @@ - - #include - -+#include "modules/desktop_capture/window_capturer_x11.h" -+ - #include "modules/desktop_capture/desktop_capture_options.h" - #include "modules/desktop_capture/desktop_capturer.h" - #include "modules/desktop_capture/desktop_frame.h" -@@ -32,49 +34,7 @@ - - namespace webrtc { - --namespace { -- --class WindowCapturerLinux : public DesktopCapturer, -- public SharedXDisplay::XEventHandler { -- public: -- WindowCapturerLinux(const DesktopCaptureOptions& options); -- ~WindowCapturerLinux() override; -- -- // DesktopCapturer interface. -- void Start(Callback* callback) override; -- void CaptureFrame() override; -- bool GetSourceList(SourceList* sources) override; -- bool SelectSource(SourceId id) override; -- bool FocusOnSelectedSource() override; -- bool IsOccluded(const DesktopVector& pos) override; -- -- // SharedXDisplay::XEventHandler interface. -- bool HandleXEvent(const XEvent& event) override; -- -- private: -- Display* display() { return x_display_->display(); } -- -- // Returns window title for the specified X |window|. -- bool GetWindowTitle(::Window window, std::string* title); -- -- // Returns the id of the owning process. -- int GetWindowProcessID(::Window window); -- -- Callback* callback_ = nullptr; -- -- rtc::scoped_refptr x_display_; -- -- bool has_composite_extension_ = false; -- -- ::Window selected_window_ = 0; -- XServerPixelBuffer x_server_pixel_buffer_; -- XAtomCache atom_cache_; -- WindowFinderX11 window_finder_; -- -- RTC_DISALLOW_COPY_AND_ASSIGN(WindowCapturerLinux); --}; -- --WindowCapturerLinux::WindowCapturerLinux(const DesktopCaptureOptions& options) -+WindowCapturerX11::WindowCapturerX11(const DesktopCaptureOptions& options) - : x_display_(options.x_display()), - atom_cache_(display()), - window_finder_(&atom_cache_) { -@@ -91,11 +51,11 @@ WindowCapturerLinux::WindowCapturerLinux - x_display_->AddEventHandler(ConfigureNotify, this); - } - --WindowCapturerLinux::~WindowCapturerLinux() { -+WindowCapturerX11::~WindowCapturerX11() { - x_display_->RemoveEventHandler(ConfigureNotify, this); - } - --bool WindowCapturerLinux::GetSourceList(SourceList* sources) { -+bool WindowCapturerX11::GetSourceList(SourceList* sources) { - return GetWindowList(&atom_cache_, - [this, sources](::Window window) { - Source w; -@@ -108,7 +68,7 @@ bool WindowCapturerLinux::GetSourceList( - }); - } - --bool WindowCapturerLinux::SelectSource(SourceId id) { -+bool WindowCapturerX11::SelectSource(SourceId id) { - if (!x_server_pixel_buffer_.Init(display(), id)) - return false; - -@@ -129,7 +89,7 @@ bool WindowCapturerLinux::SelectSource(S - return true; - } - --bool WindowCapturerLinux::FocusOnSelectedSource() { -+bool WindowCapturerX11::FocusOnSelectedSource() { - if (!selected_window_) - return false; - -@@ -178,14 +138,14 @@ bool WindowCapturerLinux::FocusOnSelecte - return true; - } - --void WindowCapturerLinux::Start(Callback* callback) { -+void WindowCapturerX11::Start(Callback* callback) { - RTC_DCHECK(!callback_); - RTC_DCHECK(callback); - - callback_ = callback; - } - --void WindowCapturerLinux::CaptureFrame() { -+void WindowCapturerX11::CaptureFrame() { - x_display_->ProcessPendingXEvents(); - - if (!x_server_pixel_buffer_.IsWindowValid()) { -@@ -228,12 +188,12 @@ void WindowCapturerLinux::CaptureFrame() - callback_->OnCaptureResult(Result::SUCCESS, std::move(frame)); - } - --bool WindowCapturerLinux::IsOccluded(const DesktopVector& pos) { -+bool WindowCapturerX11::IsOccluded(const DesktopVector& pos) { - return window_finder_.GetWindowUnderPoint(pos) != - static_cast(selected_window_); - } - --bool WindowCapturerLinux::HandleXEvent(const XEvent& event) { -+bool WindowCapturerX11::HandleXEvent(const XEvent& event) { - if (event.type == ConfigureNotify) { - XConfigureEvent xce = event.xconfigure; - if (xce.window == selected_window_) { -@@ -251,7 +211,7 @@ bool WindowCapturerLinux::HandleXEvent(c - return false; - } - --bool WindowCapturerLinux::GetWindowTitle(::Window window, std::string* title) { -+bool WindowCapturerX11::GetWindowTitle(::Window window, std::string* title) { - int status; - bool result = false; - XTextProperty window_name; -@@ -280,9 +240,7 @@ bool WindowCapturerLinux::GetWindowTitle - return result; - } - --} // namespace -- --int WindowCapturerLinux::GetWindowProcessID(::Window window) { -+int WindowCapturerX11::GetWindowProcessID(::Window window) { - // Get _NET_WM_PID property of the window. - Atom process_atom = XInternAtom(display(), "_NET_WM_PID", True); - XWindowProperty process_id(display(), window, process_atom); -@@ -291,11 +249,11 @@ int WindowCapturerLinux::GetWindowProces - } - - // static --std::unique_ptr DesktopCapturer::CreateRawWindowCapturer( -+std::unique_ptr WindowCapturerX11::CreateRawWindowCapturer( - const DesktopCaptureOptions& options) { - if (!options.x_display()) - return nullptr; -- return std::unique_ptr(new WindowCapturerLinux(options)); -+ return std::unique_ptr(new WindowCapturerX11(options)); - } - - } // namespace webrtc -diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_x11.h.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_x11.h ---- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_x11.h.firefox-pipewire 2019-03-12 15:27:37.680285758 +0100 -+++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_x11.h 2019-03-13 08:06:55.974724907 +0100 -@@ -0,0 +1,76 @@ -+/* -+ * Copyright 2018 The WebRTC project authors. All Rights Reserved. -+ * -+ * Use of this source code is governed by a BSD-style license -+ * that can be found in the LICENSE file in the root of the source -+ * tree. An additional intellectual property rights grant can be found -+ * in the file PATENTS. All contributing project authors may -+ * be found in the AUTHORS file in the root of the source tree. -+ */ -+ -+#ifndef MODULES_DESKTOP_CAPTURE_WINDOW_CAPTURER_X11_H_ -+#define MODULES_DESKTOP_CAPTURE_WINDOW_CAPTURER_X11_H_ -+ -+#include -+#include -+#include -+#include -+ -+#include "modules/desktop_capture/desktop_capture_options.h" -+#include "modules/desktop_capture/desktop_capturer.h" -+#include "modules/desktop_capture/desktop_geometry.h" -+#include "modules/desktop_capture/window_finder_x11.h" -+#include "modules/desktop_capture/x11/x_atom_cache.h" -+#include "modules/desktop_capture/x11/shared_x_display.h" -+#include "modules/desktop_capture/x11/x_server_pixel_buffer.h" -+#include "rtc_base/constructormagic.h" -+#include "rtc_base/scoped_ref_ptr.h" -+ -+namespace webrtc { -+ -+class WindowCapturerX11 : public DesktopCapturer, -+ public SharedXDisplay::XEventHandler { -+ public: -+ explicit WindowCapturerX11(const DesktopCaptureOptions& options); -+ ~WindowCapturerX11() override; -+ -+ static std::unique_ptr CreateRawWindowCapturer( -+ const DesktopCaptureOptions& options); -+ -+ // DesktopCapturer interface. -+ void Start(Callback* callback) override; -+ void CaptureFrame() override; -+ bool GetSourceList(SourceList* sources) override; -+ bool SelectSource(SourceId id) override; -+ bool FocusOnSelectedSource() override; -+ bool IsOccluded(const DesktopVector& pos) override; -+ -+ // SharedXDisplay::XEventHandler interface. -+ bool HandleXEvent(const XEvent& event) override; -+ -+ private: -+ Display* display() { return x_display_->display(); } -+ -+ // Returns window title for the specified X |window|. -+ bool GetWindowTitle(::Window window, std::string* title); -+ -+ // Returns the id of the owning process. -+ int GetWindowProcessID(::Window window); -+ -+ Callback* callback_ = nullptr; -+ -+ rtc::scoped_refptr x_display_; -+ -+ bool has_composite_extension_ = false; -+ -+ ::Window selected_window_ = 0; -+ XServerPixelBuffer x_server_pixel_buffer_; -+ XAtomCache atom_cache_; -+ WindowFinderX11 window_finder_; -+ -+ RTC_DISALLOW_COPY_AND_ASSIGN(WindowCapturerX11); -+}; -+ -+} // namespace webrtc -+ -+#endif // MODULES_DESKTOP_CAPTURE_WINDOW_CAPTURER_X11_H_ diff --git a/firefox-redhat-default-prefs.js b/firefox-redhat-default-prefs.js index 1513345..979f21b 100644 --- a/firefox-redhat-default-prefs.js +++ b/firefox-redhat-default-prefs.js @@ -2,13 +2,11 @@ pref("app.update.auto", false); pref("app.update.enabled", false); pref("app.update.autoInstallEnabled", false); pref("general.smoothScroll", true); -pref("intl.locale.matchOS", true); pref("intl.locale.requested", ""); pref("toolkit.storage.synchronous", 0); pref("toolkit.networkmanager.disable", false); pref("offline.autoDetect", true); pref("browser.backspace_action", 2); -pref("browser.display.use_system_colors", true); pref("browser.download.folderList", 1); pref("browser.link.open_external", 3); pref("browser.shell.checkDefaultBrowser", false); @@ -18,15 +16,18 @@ pref("ui.SpellCheckerUnderlineStyle", 1); pref("startup.homepage_override_url", ""); pref("browser.startup.homepage", "data:text/plain,browser.startup.homepage=https://start.fedoraproject.org/"); pref("browser.newtabpage.pinned", '[{"url":"https://start.fedoraproject.org/","title":"Fedora Project - Start Page"}]'); -pref("geo.wifi.uri", "https://location.services.mozilla.com/v1/geolocate?key=%MOZILLA_API_KEY%"); pref("media.gmp-gmpopenh264.provider.enabled",false); pref("media.gmp-gmpopenh264.autoupdate",false); pref("media.gmp-gmpopenh264.enabled",false); -pref("media.gmp-gmpopenh264.enabled",false); +pref("media.gmp.decoder.enabled", true); pref("plugins.notifyMissingFlash", false); -/* See https://bugzilla.redhat.com/show_bug.cgi?id=1226489 */ -pref("browser.display.use_system_colors", false); -pref("layers.use-image-offscreen-surfaces", false); /* Allow sending credetials to all https:// sites */ pref("network.negotiate-auth.trusted-uris", "https://"); -pref("spellchecker.dictionary_path","/usr/share/myspell"); \ No newline at end of file +pref("spellchecker.dictionary_path","/usr/share/hunspell"); +/* Disable DoH by default */ +pref("network.trr.mode", 5); +/* Enable per-user policy dir, see mozbz#1583466 */ +pref("browser.policies.perUserDir", true); +pref("browser.gnome-search-provider.enabled",true); +/* Enable ffvpx playback for WebRTC */ +pref("media.navigator.mediadatadecoder_vpx_enabled", true); diff --git a/firefox-symbolic.svg b/firefox-symbolic.svg index 2078eea..8ecd135 100644 --- a/firefox-symbolic.svg +++ b/firefox-symbolic.svg @@ -1,64 +1,3 @@ - - - - - - image/svg+xml - - Gnome Symbolic Icon Theme - - - - - - - - Gnome Symbolic Icon Theme - + + diff --git a/firefox-wayland.desktop b/firefox-wayland.desktop index 12669c5..cd2dd61 100644 --- a/firefox-wayland.desktop +++ b/firefox-wayland.desktop @@ -11,7 +11,7 @@ MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xm StartupNotify=true Categories=Network;WebBrowser; Keywords=web;browser;internet; -Actions=new-window;new-private-window; +Actions=new-window;new-private-window;profile-manager-window; [Desktop Action new-window] Name=Open a New Window @@ -24,8 +24,8 @@ Name[ast]=Ventana nueva Name[az]=Yeni Pəncərə Name[be]=Новае акно Name[bg]=Нов прозорец -Name[bn-BD]=নতুন উইন্ডো (N) -Name[bn-IN]=নতুন উইন্ডো +Name[bn_BD]=নতুন উইন্ডো (N) +Name[bn_IN]=নতুন উইন্ডো Name[br]=Prenestr nevez Name[brx]=गोदान उइन्ड'(N) Name[bs]=Novi prozor @@ -37,37 +37,37 @@ Name[da]=Nyt vindue Name[de]=Neues Fenster Name[dsb]=Nowe wokno Name[el]=Νέο παράθυρο -Name[en-GB]=New Window -Name[en-US]=New Window -Name[en-ZA]=New Window +Name[en_GB]=New Window +Name[en_US]=New Window +Name[en_ZA]=New Window Name[eo]=Nova fenestro -Name[es-AR]=Nueva ventana -Name[es-CL]=Nueva ventana -Name[es-ES]=Nueva ventana -Name[es-MX]=Nueva ventana +Name[es_AR]=Nueva ventana +Name[es_CL]=Nueva ventana +Name[es_ES]=Nueva ventana +Name[es_MX]=Nueva ventana Name[et]=Uus aken Name[eu]=Leiho berria Name[fa]=پنجره جدید‌ Name[ff]=Henorde Hesere Name[fi]=Uusi ikkuna Name[fr]=Nouvelle fenêtre -Name[fy-NL]=Nij finster -Name[ga-IE]=Fuinneog Nua +Name[fy_NL]=Nij finster +Name[ga_IE]=Fuinneog Nua Name[gd]=Uinneag ùr Name[gl]=Nova xanela Name[gn]=Ovetã pyahu -Name[gu-IN]=નવી વિન્ડો +Name[gu_IN]=નવી વિન્ડો Name[he]=חלון חדש -Name[hi-IN]=नया विंडो +Name[hi_IN]=नया विंडो Name[hr]=Novi prozor Name[hsb]=Nowe wokno Name[hu]=Új ablak -Name[hy-AM]=Նոր Պատուհան +Name[hy_AM]=Նոր Պատուհան Name[id]=Jendela Baru Name[is]=Nýr gluggi Name[it]=Nuova finestra Name[ja]=新しいウィンドウ -Name[ja-JP-mac]=新規ウインドウ +Name[ja_JP-mac]=新規ウインドウ Name[ka]=ახალი ფანჯარა Name[kk]=Жаңа терезе Name[km]=បង្អួច​​​ថ្មី @@ -86,15 +86,15 @@ Name[ml]=പുതിയ ജാലകം Name[mr]=नवीन पटल Name[ms]=Tetingkap Baru Name[my]=ဝင်းဒိုးအသစ် -Name[nb-NO]=Nytt vindu -Name[ne-NP]=नयाँ सञ्झ्याल +Name[nb_NO]=Nytt vindu +Name[ne_NP]=नयाँ सञ्झ्याल Name[nl]=Nieuw venster -Name[nn-NO]=Nytt vindauge +Name[nn_NO]=Nytt vindauge Name[or]=ନୂତନ ୱିଣ୍ଡୋ -Name[pa-IN]=ਨਵੀਂ ਵਿੰਡੋ +Name[pa_IN]=ਨਵੀਂ ਵਿੰਡੋ Name[pl]=Nowe okno -Name[pt-BR]=Nova janela -Name[pt-PT]=Nova janela +Name[pt_BR]=Nova janela +Name[pt_PT]=Nova janela Name[rm]=Nova fanestra Name[ro]=Fereastră nouă Name[ru]=Новое окно @@ -105,7 +105,7 @@ Name[sl]=Novo okno Name[son]=Zanfun taaga Name[sq]=Dritare e Re Name[sr]=Нови прозор -Name[sv-SE]=Nytt fönster +Name[sv_SE]=Nytt fönster Name[ta]=புதிய சாளரம் Name[te]=కొత్త విండో Name[th]=หน้าต่างใหม่ @@ -117,8 +117,8 @@ Name[uz]=Yangi oyna Name[vi]=Cửa sổ mới Name[wo]=Palanteer bu bees Name[xh]=Ifestile entsha -Name[zh-CN]=新建窗口 -Name[zh-TW]=開新視窗 +Name[zh_CN]=新建窗口 +Name[zh_TW]=開新視窗 Exec=firefox-wayland --name firefox-wayland --new-window %u [Desktop Action new-private-window] @@ -132,8 +132,8 @@ Name[ast]=Ventana privada nueva Name[az]=Yeni Məxfi Pəncərə Name[be]=Новае акно адасаблення Name[bg]=Нов прозорец за поверително сърфиране -Name[bn-BD]=নতুন ব্যক্তিগত উইন্ডো -Name[bn-IN]=নতুন ব্যক্তিগত উইন্ডো +Name[bn_BD]=নতুন ব্যক্তিগত উইন্ডো +Name[bn_IN]=নতুন ব্যক্তিগত উইন্ডো Name[br]=Prenestr merdeiñ prevez nevez Name[brx]=गोदान प्राइभेट उइन्ड' Name[bs]=Novi privatni prozor @@ -145,37 +145,37 @@ Name[da]=Nyt privat vindue Name[de]=Neues privates Fenster Name[dsb]=Nowe priwatne wokno Name[el]=Νέο παράθυρο ιδιωτικής περιήγησης -Name[en-GB]=New Private Window -Name[en-US]=New Private Window -Name[en-ZA]=New Private Window +Name[en_GB]=New Private Window +Name[en_US]=New Private Window +Name[en_ZA]=New Private Window Name[eo]=Nova privata fenestro -Name[es-AR]=Nueva ventana privada -Name[es-CL]=Nueva ventana privada -Name[es-ES]=Nueva ventana privada -Name[es-MX]=Nueva ventana privada +Name[es_AR]=Nueva ventana privada +Name[es_CL]=Nueva ventana privada +Name[es_ES]=Nueva ventana privada +Name[es_MX]=Nueva ventana privada Name[et]=Uus privaatne aken Name[eu]=Leiho pribatu berria Name[fa]=پنجره ناشناس جدید Name[ff]=Henorde Suturo Hesere Name[fi]=Uusi yksityinen ikkuna Name[fr]=Nouvelle fenêtre de navigation privée -Name[fy-NL]=Nij priveefinster -Name[ga-IE]=Fuinneog Nua Phríobháideach +Name[fy_NL]=Nij priveefinster +Name[ga_IE]=Fuinneog Nua Phríobháideach Name[gd]=Uinneag phrìobhaideach ùr Name[gl]=Nova xanela privada Name[gn]=Ovetã ñemi pyahu -Name[gu-IN]=નવી ખાનગી વિન્ડો +Name[gu_IN]=નવી ખાનગી વિન્ડો Name[he]=חלון פרטי חדש -Name[hi-IN]=नयी निजी विंडो +Name[hi_IN]=नयी निजी विंडो Name[hr]=Novi privatni prozor Name[hsb]=Nowe priwatne wokno Name[hu]=Új privát ablak -Name[hy-AM]=Սկսել Գաղտնի դիտարկում +Name[hy_AM]=Սկսել Գաղտնի դիտարկում Name[id]=Jendela Mode Pribadi Baru Name[is]=Nýr huliðsgluggi Name[it]=Nuova finestra anonima Name[ja]=新しいプライベートウィンドウ -Name[ja-JP-mac]=新規プライベートウインドウ +Name[ja_JP-mac]=新規プライベートウインドウ Name[ka]=ახალი პირადი ფანჯარა Name[kk]=Жаңа жекелік терезе Name[km]=បង្អួច​ឯកជន​ថ្មី @@ -194,15 +194,15 @@ Name[ml]=പുതിയ സ്വകാര്യ ജാലകം Name[mr]=नवीन वैयक्तिक पटल Name[ms]=Tetingkap Persendirian Baharu Name[my]=New Private Window -Name[nb-NO]=Nytt privat vindu -Name[ne-NP]=नयाँ निजी सञ्झ्याल +Name[nb_NO]=Nytt privat vindu +Name[ne_NP]=नयाँ निजी सञ्झ्याल Name[nl]=Nieuw privévenster -Name[nn-NO]=Nytt privat vindauge +Name[nn_NO]=Nytt privat vindauge Name[or]=ନୂତନ ବ୍ୟକ୍ତିଗତ ୱିଣ୍ଡୋ -Name[pa-IN]=ਨਵੀਂ ਪ੍ਰਾਈਵੇਟ ਵਿੰਡੋ +Name[pa_IN]=ਨਵੀਂ ਪ੍ਰਾਈਵੇਟ ਵਿੰਡੋ Name[pl]=Nowe okno prywatne -Name[pt-BR]=Nova janela privativa -Name[pt-PT]=Nova janela privada +Name[pt_BR]=Nova janela privativa +Name[pt_PT]=Nova janela privada Name[rm]=Nova fanestra privata Name[ro]=Fereastră privată nouă Name[ru]=Новое приватное окно @@ -213,7 +213,7 @@ Name[sl]=Novo zasebno okno Name[son]=Sutura zanfun taaga Name[sq]=Dritare e Re Private Name[sr]=Нови приватан прозор -Name[sv-SE]=Nytt privat fönster +Name[sv_SE]=Nytt privat fönster Name[ta]=புதிய தனிப்பட்ட சாளரம் Name[te]=కొత్త ఆంతరంగిక విండో Name[th]=หน้าต่างส่วนตัวใหม่ @@ -225,7 +225,11 @@ Name[uz]=Yangi maxfiy oyna Name[vi]=Cửa sổ riêng tư mới Name[wo]=Panlanteeru biir bu bees Name[xh]=Ifestile yangasese entsha -Name[zh-CN]=新建隐私浏览窗口 -Name[zh-TW]=新增隱私視窗 +Name[zh_CN]=新建隐私浏览窗口 +Name[zh_TW]=新增隱私視窗 Exec=firefox-wayland --private-window --name firefox-wayland %u +[Desktop Action profile-manager-window] +Name=Open the Profile Manager +Name[cs]=Správa profilů +Exec=firefox-wayland --name firefox-wayland --ProfileManager diff --git a/firefox-wayland.sh.in b/firefox-wayland.sh.in index ec0923d..bd68068 100644 --- a/firefox-wayland.sh.in +++ b/firefox-wayland.sh.in @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/bash # # Run Firefox under Wayland # diff --git a/firefox-x11.desktop b/firefox-x11.desktop index 4d1dca5..4124891 100644 --- a/firefox-x11.desktop +++ b/firefox-x11.desktop @@ -11,7 +11,7 @@ MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xm StartupNotify=true Categories=Network;WebBrowser; Keywords=web;browser;internet; -Actions=new-window;new-private-window; +Actions=new-window;new-private-window;profile-manager-window; [Desktop Action new-window] Name=Open a New Window @@ -24,8 +24,8 @@ Name[ast]=Ventana nueva Name[az]=Yeni Pəncərə Name[be]=Новае акно Name[bg]=Нов прозорец -Name[bn-BD]=নতুন উইন্ডো (N) -Name[bn-IN]=নতুন উইন্ডো +Name[bn_BD]=নতুন উইন্ডো (N) +Name[bn_IN]=নতুন উইন্ডো Name[br]=Prenestr nevez Name[brx]=गोदान उइन्ड'(N) Name[bs]=Novi prozor @@ -37,37 +37,37 @@ Name[da]=Nyt vindue Name[de]=Neues Fenster Name[dsb]=Nowe wokno Name[el]=Νέο παράθυρο -Name[en-GB]=New Window -Name[en-US]=New Window -Name[en-ZA]=New Window +Name[en_GB]=New Window +Name[en_US]=New Window +Name[en_ZA]=New Window Name[eo]=Nova fenestro -Name[es-AR]=Nueva ventana -Name[es-CL]=Nueva ventana -Name[es-ES]=Nueva ventana -Name[es-MX]=Nueva ventana +Name[es_AR]=Nueva ventana +Name[es_CL]=Nueva ventana +Name[es_ES]=Nueva ventana +Name[es_MX]=Nueva ventana Name[et]=Uus aken Name[eu]=Leiho berria Name[fa]=پنجره جدید‌ Name[ff]=Henorde Hesere Name[fi]=Uusi ikkuna Name[fr]=Nouvelle fenêtre -Name[fy-NL]=Nij finster -Name[ga-IE]=Fuinneog Nua +Name[fy_NL]=Nij finster +Name[ga_IE]=Fuinneog Nua Name[gd]=Uinneag ùr Name[gl]=Nova xanela Name[gn]=Ovetã pyahu -Name[gu-IN]=નવી વિન્ડો +Name[gu_IN]=નવી વિન્ડો Name[he]=חלון חדש -Name[hi-IN]=नया विंडो +Name[hi_IN]=नया विंडो Name[hr]=Novi prozor Name[hsb]=Nowe wokno Name[hu]=Új ablak -Name[hy-AM]=Նոր Պատուհան +Name[hy_AM]=Նոր Պատուհան Name[id]=Jendela Baru Name[is]=Nýr gluggi Name[it]=Nuova finestra Name[ja]=新しいウィンドウ -Name[ja-JP-mac]=新規ウインドウ +Name[ja_JP-mac]=新規ウインドウ Name[ka]=ახალი ფანჯარა Name[kk]=Жаңа терезе Name[km]=បង្អួច​​​ថ្មី @@ -86,15 +86,15 @@ Name[ml]=പുതിയ ജാലകം Name[mr]=नवीन पटल Name[ms]=Tetingkap Baru Name[my]=ဝင်းဒိုးအသစ် -Name[nb-NO]=Nytt vindu -Name[ne-NP]=नयाँ सञ्झ्याल +Name[nb_NO]=Nytt vindu +Name[ne_NP]=नयाँ सञ्झ्याल Name[nl]=Nieuw venster -Name[nn-NO]=Nytt vindauge +Name[nn_NO]=Nytt vindauge Name[or]=ନୂତନ ୱିଣ୍ଡୋ -Name[pa-IN]=ਨਵੀਂ ਵਿੰਡੋ +Name[pa_IN]=ਨਵੀਂ ਵਿੰਡੋ Name[pl]=Nowe okno -Name[pt-BR]=Nova janela -Name[pt-PT]=Nova janela +Name[pt_BR]=Nova janela +Name[pt_PT]=Nova janela Name[rm]=Nova fanestra Name[ro]=Fereastră nouă Name[ru]=Новое окно @@ -105,7 +105,7 @@ Name[sl]=Novo okno Name[son]=Zanfun taaga Name[sq]=Dritare e Re Name[sr]=Нови прозор -Name[sv-SE]=Nytt fönster +Name[sv_SE]=Nytt fönster Name[ta]=புதிய சாளரம் Name[te]=కొత్త విండో Name[th]=หน้าต่างใหม่ @@ -117,8 +117,8 @@ Name[uz]=Yangi oyna Name[vi]=Cửa sổ mới Name[wo]=Palanteer bu bees Name[xh]=Ifestile entsha -Name[zh-CN]=新建窗口 -Name[zh-TW]=開新視窗 +Name[zh_CN]=新建窗口 +Name[zh_TW]=開新視窗 Exec=firefox-x11 --name firefox-x11 --new-window %u [Desktop Action new-private-window] @@ -132,8 +132,8 @@ Name[ast]=Ventana privada nueva Name[az]=Yeni Məxfi Pəncərə Name[be]=Новае акно адасаблення Name[bg]=Нов прозорец за поверително сърфиране -Name[bn-BD]=নতুন ব্যক্তিগত উইন্ডো -Name[bn-IN]=নতুন ব্যক্তিগত উইন্ডো +Name[bn_BD]=নতুন ব্যক্তিগত উইন্ডো +Name[bn_IN]=নতুন ব্যক্তিগত উইন্ডো Name[br]=Prenestr merdeiñ prevez nevez Name[brx]=गोदान प्राइभेट उइन्ड' Name[bs]=Novi privatni prozor @@ -145,37 +145,37 @@ Name[da]=Nyt privat vindue Name[de]=Neues privates Fenster Name[dsb]=Nowe priwatne wokno Name[el]=Νέο παράθυρο ιδιωτικής περιήγησης -Name[en-GB]=New Private Window -Name[en-US]=New Private Window -Name[en-ZA]=New Private Window +Name[en_GB]=New Private Window +Name[en_US]=New Private Window +Name[en_ZA]=New Private Window Name[eo]=Nova privata fenestro -Name[es-AR]=Nueva ventana privada -Name[es-CL]=Nueva ventana privada -Name[es-ES]=Nueva ventana privada -Name[es-MX]=Nueva ventana privada +Name[es_AR]=Nueva ventana privada +Name[es_CL]=Nueva ventana privada +Name[es_ES]=Nueva ventana privada +Name[es_MX]=Nueva ventana privada Name[et]=Uus privaatne aken Name[eu]=Leiho pribatu berria Name[fa]=پنجره ناشناس جدید Name[ff]=Henorde Suturo Hesere Name[fi]=Uusi yksityinen ikkuna Name[fr]=Nouvelle fenêtre de navigation privée -Name[fy-NL]=Nij priveefinster -Name[ga-IE]=Fuinneog Nua Phríobháideach +Name[fy_NL]=Nij priveefinster +Name[ga_IE]=Fuinneog Nua Phríobháideach Name[gd]=Uinneag phrìobhaideach ùr Name[gl]=Nova xanela privada Name[gn]=Ovetã ñemi pyahu -Name[gu-IN]=નવી ખાનગી વિન્ડો +Name[gu_IN]=નવી ખાનગી વિન્ડો Name[he]=חלון פרטי חדש -Name[hi-IN]=नयी निजी विंडो +Name[hi_IN]=नयी निजी विंडो Name[hr]=Novi privatni prozor Name[hsb]=Nowe priwatne wokno Name[hu]=Új privát ablak -Name[hy-AM]=Սկսել Գաղտնի դիտարկում +Name[hy_AM]=Սկսել Գաղտնի դիտարկում Name[id]=Jendela Mode Pribadi Baru Name[is]=Nýr huliðsgluggi Name[it]=Nuova finestra anonima Name[ja]=新しいプライベートウィンドウ -Name[ja-JP-mac]=新規プライベートウインドウ +Name[ja_JP-mac]=新規プライベートウインドウ Name[ka]=ახალი პირადი ფანჯარა Name[kk]=Жаңа жекелік терезе Name[km]=បង្អួច​ឯកជន​ថ្មី @@ -194,15 +194,15 @@ Name[ml]=പുതിയ സ്വകാര്യ ജാലകം Name[mr]=नवीन वैयक्तिक पटल Name[ms]=Tetingkap Persendirian Baharu Name[my]=New Private Window -Name[nb-NO]=Nytt privat vindu -Name[ne-NP]=नयाँ निजी सञ्झ्याल +Name[nb_NO]=Nytt privat vindu +Name[ne_NP]=नयाँ निजी सञ्झ्याल Name[nl]=Nieuw privévenster -Name[nn-NO]=Nytt privat vindauge +Name[nn_NO]=Nytt privat vindauge Name[or]=ନୂତନ ବ୍ୟକ୍ତିଗତ ୱିଣ୍ଡୋ -Name[pa-IN]=ਨਵੀਂ ਪ੍ਰਾਈਵੇਟ ਵਿੰਡੋ +Name[pa_IN]=ਨਵੀਂ ਪ੍ਰਾਈਵੇਟ ਵਿੰਡੋ Name[pl]=Nowe okno prywatne -Name[pt-BR]=Nova janela privativa -Name[pt-PT]=Nova janela privada +Name[pt_BR]=Nova janela privativa +Name[pt_PT]=Nova janela privada Name[rm]=Nova fanestra privata Name[ro]=Fereastră privată nouă Name[ru]=Новое приватное окно @@ -213,7 +213,7 @@ Name[sl]=Novo zasebno okno Name[son]=Sutura zanfun taaga Name[sq]=Dritare e Re Private Name[sr]=Нови приватан прозор -Name[sv-SE]=Nytt privat fönster +Name[sv_SE]=Nytt privat fönster Name[ta]=புதிய தனிப்பட்ட சாளரம் Name[te]=కొత్త ఆంతరంగిక విండో Name[th]=หน้าต่างส่วนตัวใหม่ @@ -225,7 +225,11 @@ Name[uz]=Yangi maxfiy oyna Name[vi]=Cửa sổ riêng tư mới Name[wo]=Panlanteeru biir bu bees Name[xh]=Ifestile yangasese entsha -Name[zh-CN]=新建隐私浏览窗口 -Name[zh-TW]=新增隱私視窗 +Name[zh_CN]=新建隐私浏览窗口 +Name[zh_TW]=新增隱私視窗 Exec=firefox-x11 --private-window --name firefox-x11 %u +[Desktop Action profile-manager-window] +Name=Open the Profile Manager +Name[cs]=Správa profilů +Exec=firefox-x11 --name firefox-x11 --ProfileManager diff --git a/firefox-x11.sh.in b/firefox-x11.sh.in index 6f9f760..94045c9 100644 --- a/firefox-x11.sh.in +++ b/firefox-x11.sh.in @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/bash # # Run Firefox on X11 backend # diff --git a/firefox.1 b/firefox.1 index 556cf07..318f2af 100644 --- a/firefox.1 +++ b/firefox.1 @@ -1,4 +1,4 @@ -.TH FIREFOX 1 "November 30, 2017" firefox "Linux User's Manual" +.TH FIREFOX 1 "July 10, 2019" firefox "Linux User's Manual" .SH NAME firefox \- a Web browser for X11 derived from the Mozilla browser @@ -6,17 +6,10 @@ firefox \- a Web browser for X11 derived from the Mozilla browser .B firefox [\fIOPTIONS\fR ...] [\fIURL\fR] -.B firefox-bin -[\fIOPTIONS\fR] [\fIURL\fR] - .SH DESCRIPTION \fBMozilla Firefox\fR is an open-source web browser, designed for standards compliance, performance and portability. -.SH USAGE -\fBfirefox\fR is a simple shell script that will set up the -environment for the actual executable, \fBfirefox-bin\fR. - .SH OPTIONS A summary of the options supported by \fBfirefox\fR is included below. @@ -33,10 +26,10 @@ Make all warnings fatal .SS "Firefox options" .TP -.B \-h, \-help +.B \-h, \--help Show summary of options. .TP -.B \-v, \-version +.B \-v, \--version Print Firefox version. .TP \fB\-P\fR \fIprofile\fR @@ -63,11 +56,22 @@ Start with \fIlocale\fR resources as UI Locale. \fB\-\-safe\-mode\fR Disables extensions and themes for this session. .TP +\fB\--allow-downgrade\fR +Allows downgrading a profile. +.TP +\fB\--MOZ_LOG\fR=\fImodules\fR +Treated as \fBMOZ_LOG\fR=\fImodules\fR environment variable, overrides it. +.TP +\fB\--MOZ_LOG_FILE\fR=\fIfile\fR +Treated as \fBMOZ_LOG_FILE\fR=\fIfile\fR environment variable, overrides it. If +MOZ_LOG_FILE is not specified as an argument or as an environment variable, +logging will be written to stdout. +.TP \fB\-\-headless\fR Run without a GUI. .TP -\fB\-\-marionette\fR -Enable remote control server. +\fB\-\-save-recordings\fR +Save recordings for all content processes to a directory. .TP \fB\-\-browser\fR Open a browser window. @@ -93,8 +97,9 @@ Width and optionally height of screenshot. \fB\-\-search\fR \fIterm\fR Search \fIterm\fR with your default search engine. .TP - - +\fB\-\-setDefaultBrowser\fR +Set this app as the default browser. +.TP \fB\-\-jsconsole\fR Open the Browser Console. .TP @@ -115,19 +120,16 @@ Record drawing for a given URL. .TP \fB\-\-recording-output\fR \fIfile\fR Specify destination file for a drawing recording. -.TP -\fB\-\-setDefaultBrowser\fR -Set this app as the default browser. .SH FILES \fI/usr/bin/firefox\fR - shell script wrapping \fBfirefox\fR .br -\fI/usr/lib64/firefox/firefox-bin\fR - \fBfirefox\fR +\fI/usr/lib64/firefox/firefox\fR - \fBfirefox\fR executable .SH VERSION -57.0 +68.0 .SH BUGS To report a bug, please visit \fIhttp://bugzilla.mozilla.org/\fR diff --git a/firefox.appdata.xml.in b/firefox.appdata.xml.in new file mode 100644 index 0000000..bfa9afc --- /dev/null +++ b/firefox.appdata.xml.in @@ -0,0 +1,59 @@ + + + + firefox.desktop + CC0-1.0 + Firefox + Web Browser + Navegador web + Webový prohlížeč + Navegador web + مرورگر اینترنتی + WWW-selain + Navigateur Web + Webböngésző + Browser Web + ウェブ・ブラウザ + 웹 브라우저 + Nettleser + Webbrowser + Nettlesar + Nettleser + Przeglądarka WWW + Navegador Web + Navegador Web + Internetový prehliadač + Webbläsare + +

+ Bringing together all kinds of awesomeness to make browsing better for you. + Get to your favorite sites quickly – even if you don’t remember the URLs. + Type your term into the location bar (aka the Awesome Bar) and the autocomplete + function will include possible matches from your browsing history, bookmarked + sites and open tabs. +

+ + https://www.mozilla.org + stransky@redhat.com + + ModernToolkit + SearchProvider + + Mozilla + GPL-3.0+ + Mozilla Corporation + https://bugzilla.mozilla.org/ + https://support.mozilla.org/ + firefox + + firefox.desktop + + + https://raw.githubusercontent.com/hughsie/fedora-appstream/master/screenshots-extra/firefox/a.png + https://raw.githubusercontent.com/hughsie/fedora-appstream/master/screenshots-extra/firefox/b.png + https://raw.githubusercontent.com/hughsie/fedora-appstream/master/screenshots-extra/firefox/c.png + + + + + diff --git a/firefox.desktop b/firefox.desktop index 89fa082..bd09aa8 100644 --- a/firefox.desktop +++ b/firefox.desktop @@ -1,47 +1,520 @@ [Desktop Entry] Version=1.0 Name=Firefox -GenericName=Web Browser -GenericName[ca]=Navegador web -GenericName[cs]=Webový prohlížeč -GenericName[es]=Navegador web -GenericName[fa]=مرورگر اینترنتی -GenericName[fi]=WWW-selain -GenericName[fr]=Navigateur Web -GenericName[hu]=Webböngésző -GenericName[it]=Browser Web -GenericName[ja]=ウェブ・ブラウザ -GenericName[ko]=웹 브라우저 -GenericName[nb]=Nettleser -GenericName[nl]=Webbrowser -GenericName[nn]=Nettlesar -GenericName[no]=Nettleser -GenericName[pl]=Przeglądarka WWW -GenericName[pt]=Navegador Web -GenericName[pt_BR]=Navegador Web -GenericName[sk]=Internetový prehliadač -GenericName[sv]=Webbläsare -Comment=Browse the Web -Comment[ca]=Navegueu per el web +Name[ach]=Firefox +Name[af]=Firefox +Name[an]=Firefox +Name[ar]=Firefox +Name[ast]=Firefox +Name[az]=Firefox +Name[be]=Firefox +Name[bg]=Firefox +Name[bn]=Firefox +Name[br]=Firefox +Name[bs]=Firefox +Name[ca]=Firefox +Name[ca_valencia]=Firefox +Name[cak]=Firefox +Name[cs]=Firefox +Name[cy]=Firefox +Name[da]=Firefox +Name[de]=Firefox +Name[dsb]=Firefox +Name[el]=Firefox +Name[en_CA]=Firefox +Name[en_GB]=Firefox +Name[eo]=Firefox +Name[es_AR]=Firefox +Name[es_CL]=Firefox +Name[es_ES]=Firefox +Name[es_MX]=Firefox +Name[et]=Firefox +Name[eu]=Firefox +Name[fa]=Firefox +Name[ff]=Firefox +Name[fi]=Firefox +Name[fr]=Firefox +Name[fur]=Firefox +Name[fy_NL]=Firefox +Name[ga_IE]=Firefox +Name[gd]=Firefox +Name[gl]=Firefox +Name[gn]=Firefox +Name[gu_IN]=Firefox +Name[he]=Firefox +Name[hi_IN]=Firefox +Name[hr]=Firefox +Name[hsb]=Firefox +Name[hu]=Firefox +Name[hy_AM]=Firefox +Name[ia]=Firefox +Name[id]=Firefox +Name[is]=Firefox +Name[it]=Firefox +Name[ja]=Firefox +Name[ka]=Firefox +Name[kab]=Firefox +Name[kk]=Firefox +Name[km]=Firefox +Name[kn]=Firefox +Name[ko]=Firefox +Name[lij]=Firefox +Name[lt]=Firefox +Name[lv]=Firefox +Name[mk]=Firefox +Name[mr]=Firefox +Name[ms]=Firefox +Name[my]=Firefox +Name[nb_NO]=Firefox +Name[ne_NP]=Firefox +Name[nl]=Firefox +Name[nn_NO]=Firefox +Name[oc]=Firefox +Name[pa_IN]=Firefox +Name[pl]=Firefox +Name[pt_BR]=Firefox +Name[pt_PT]=Firefox +Name[rm]=Firefox +Name[ro]=Firefox +Name[ru]=Firefox +Name[sat]=Firefox +Name[sc]=Firefox +Name[sco]=Firefox +Name[si]=Firefox +Name[sk]=Firefox +Name[skr]=Firefox +Name[sl]=Firefox +Name[son]=Firefox +Name[sq]=Firefox +Name[sr]=Firefox +Name[sv_SE]=Firefox +Name[szl]=Firefox +Name[ta]=Firefox +Name[te]=Firefox +Name[tg]=Firefox +Name[th]=Firefox +Name[tl]=Firefox +Name[tr]=Firefox +Name[trs]=Firefox +Name[uk]=Firefox +Name[ur]=Firefox +Name[uz]=Firefox +Name[vi]=Firefox +Name[xh]=Firefox +Name[zh_CN]=Firefox +Name[zh_TW]=Firefox +Comment=Browse the World Wide Web +Comment[ach]=Browse the World Wide Web +Comment[af]=Browse the World Wide Web +Comment[an]=Browse the World Wide Web +Comment[ar]=تصفح شبكة الوِب العالمية +Comment[ast]=Browse the World Wide Web +Comment[az]=Browse the World Wide Web +Comment[be]=Аглядайце Сеціва +Comment[bg]=Разгледайте световната мрежа +Comment[bn]=ওয়ার্ল্ড ওয়াইড ওয়েব ব্রাউজ করুন +Comment[br]=Ergerzhout ar World Wide Web +Comment[bs]=Pretražujte World Wide Web +Comment[ca]=Navegeu pel Web +Comment[ca_valencia]=Browse the World Wide Web +Comment[cak]=Tok chupam Word Wide Web Comment[cs]=Prohlížení stránek World Wide Webu +Comment[cy]=Pori'r We Fyd Eang +Comment[da]=Brug internettet Comment[de]=Im Internet surfen -Comment[es]=Navegue por la web -Comment[fa]=صفحات شبکه جهانی اینترنت را مرور نمایید -Comment[fi]=Selaa Internetin WWW-sivuja -Comment[fr]=Navigue sur Internet -Comment[hu]=A világháló böngészése -Comment[it]=Esplora il web -Comment[ja]=ウェブを閲覧します -Comment[ko]=웹을 돌아 다닙니다 -Comment[nb]=Surf på nettet -Comment[nl]=Verken het internet -Comment[nn]=Surf på nettet -Comment[no]=Surf på nettet -Comment[pl]=Przeglądanie stron WWW -Comment[pt]=Navegue na Internet -Comment[pt_BR]=Navegue na Internet -Comment[sk]=Prehliadanie internetu -Comment[sv]=Surfa på webben +Comment[dsb]=Pśeglědajśo World Wide Web +Comment[el]=Περιηγηθείτε στον παγκόσμιο ιστό +Comment[en_CA]=Browse the World Wide Web +Comment[en_GB]=Browse the World Wide Web +Comment[eo]=Retumi en la reto +Comment[es_AR]=Navegar la World Wide Web +Comment[es_CL]=Navegar por la World Wide Web +Comment[es_ES]=Navegar por la web +Comment[es_MX]=Navegar por la web +Comment[et]=Browse the World Wide Web +Comment[eu]=Arakatu World Wide Web-a +Comment[fa]=Browse the World Wide Web +Comment[ff]=Browse the World Wide Web +Comment[fi]=Selaa Internetiä +Comment[fr]=Naviguer sur le Web +Comment[fur]=Navighe sul Web +Comment[fy_NL]=Navigearje op it wrâldwide web +Comment[ga_IE]=Browse the World Wide Web +Comment[gd]=Rùraich lìon na cruinne +Comment[gl]=Navegar pola World Wide Web +Comment[gn]=Eikundaha World Wide Web rupi +Comment[gu_IN]=Browse the World Wide Web +Comment[he]=גלישה באינטרנט +Comment[hi_IN]=Browse the World Wide Web +Comment[hr]=Pregledaj World Wide Web +Comment[hsb]=Přehladajće World Wide Web +Comment[hu]=Böngésszen a világhálón +Comment[hy_AM]=Զննի՛ր համաշխարհային սարդոստայնը +Comment[ia]=Navigar sur le Web +Comment[id]=Jelajahi World Wide Web +Comment[is]=Vafraðu um veraldarvefinn +Comment[it]=Naviga sul Web +Comment[ja]=World Wide Web をブラウジング +Comment[ka]=მსოფლიო ქსელთან წვდომა +Comment[kab]=Inig deg Web +Comment[kk]=Ғаламторды шолу +Comment[km]=Browse the World Wide Web +Comment[kn]=Browse the World Wide Web +Comment[ko]=월드 와이드 웹 탐색 +Comment[lij]=Browse the World Wide Web +Comment[lt]=Browse the World Wide Web +Comment[lv]=Pārlūkojiet globālo tīmekli +Comment[mk]=Browse the World Wide Web +Comment[mr]=Browse the World Wide Web +Comment[ms]=Browse the World Wide Web +Comment[my]=Browse the World Wide Web +Comment[nb_NO]=Surf på nettet +Comment[ne_NP]=वर्ल्ड वाइड वेब ब्राउज गर्नुहोस् +Comment[nl]=Navigeren op het wereldwijde web +Comment[nn_NO]=Surf på nettet +Comment[oc]=Navegar pel Web +Comment[pa_IN]=ਵਰਲਡ ਵਾਈਡ ਵੈੱਬ ਬਰਾਊਜ਼ਰ ਕਰੋ +Comment[pl]=Przeglądaj Internet +Comment[pt_BR]=Navegue na World Wide Web +Comment[pt_PT]=Navegar na Internet +Comment[rm]=Navigar en il web +Comment[ro]=Browse the World Wide Web +Comment[ru]=Доступ в Интернет +Comment[sat]=World Wide Web ᱠᱷᱩᱞᱟᱹᱭ ᱢᱮ +Comment[sc]=Nàviga su Web +Comment[sco]=Browse the World Wide Web +Comment[si]=ලෝක ව්‍යාප්ත වියමන පිරික්සන්න +Comment[sk]=Prehľadávať web (www) +Comment[skr]=ورلڈ وائیڈ ویب براؤز کرو +Comment[sl]=Brskanje po svetovnem spletu +Comment[son]=Browse the World Wide Web +Comment[sq]=Shfletoni në World Wide Web +Comment[sr]=Истражите интернет +Comment[sv_SE]=Surfa på webben +Comment[szl]=Browse the World Wide Web +Comment[ta]=Browse the World Wide Web +Comment[te]=ప్రపంచ వ్యాప్త జాలంలో విహరించండి +Comment[tg]=Ба шабакаи ҷаҳонии Интернет дастрасӣ пайдо намоед +Comment[th]=เรียกดูเวิลด์ไวด์เว็บ +Comment[tl]=Browse the World Wide Web +Comment[tr]=Web’de gezin +Comment[trs]=Gāchē nu ngà World Wide Web +Comment[uk]=Переглядайте всесвітню мережу +Comment[ur]=Browse the World Wide Web +Comment[uz]=Browse the World Wide Web +Comment[vi]=Duyệt web trên toàn thế giới +Comment[xh]=Browse the World Wide Web +Comment[zh_CN]=浏览万维网 +Comment[zh_TW]=瀏覽全球資訊網 +GenericName=Web Browser +GenericName[ach]=Web Browser +GenericName[af]=Web Browser +GenericName[an]=Web Browser +GenericName[ar]=متصفح الإنترنت +GenericName[ast]=Web Browser +GenericName[az]=Web Browser +GenericName[be]=Вэб-браўзер +GenericName[bg]=Уеб браузър +GenericName[bn]=ওয়েব ব্রাউজার +GenericName[br]=Merdeer Web +GenericName[bs]=Web pretraživač +GenericName[ca]=Navegador web +GenericName[ca_valencia]=Web Browser +GenericName[cak]=Web Okik'amaya'l +GenericName[cs]=Webový prohlížeč +GenericName[cy]=Porwr Gwe +GenericName[da]=Webbrowser +GenericName[de]=Internet-Browser +GenericName[dsb]=Webwobglědowak +GenericName[el]=Πρόγραμμα περιήγησης +GenericName[en_CA]=Web Browser +GenericName[en_GB]=Web Browser +GenericName[eo]=Retumilo +GenericName[es_AR]=Navegador web +GenericName[es_CL]=Navegador Web +GenericName[es_ES]=Navegador web +GenericName[es_MX]=Navegador Web +GenericName[et]=Web Browser +GenericName[eu]=Web nabigatzailea +GenericName[fa]=Web Browser +GenericName[ff]=Web Browser +GenericName[fi]=Verkkoselain +GenericName[fr]=Navigateur web +GenericName[fur]=Navigadôr Web +GenericName[fy_NL]=Webbrowser +GenericName[ga_IE]=Web Browser +GenericName[gd]=Brabhsair-lìn +GenericName[gl]=Navegador web +GenericName[gn]=Ñanduti Kundahára +GenericName[gu_IN]=Web Browser +GenericName[he]=דפדפן אינטרנט +GenericName[hi_IN]=Web Browser +GenericName[hr]=Web preglednik +GenericName[hsb]=Webwobhladowak +GenericName[hu]=Webböngésző +GenericName[hy_AM]=Վեբ դիտարկիչ +GenericName[ia]=Navigator web +GenericName[id]=Peramban Web +GenericName[is]=Vafri +GenericName[it]=Browser web +GenericName[ja]=ウェブブラウザー +GenericName[ka]=ბრაუზერი +GenericName[kab]=Iminig web +GenericName[kk]=Веб-браузері +GenericName[km]=Web Browser +GenericName[kn]=Web Browser +GenericName[ko]=웹 브라우저 +GenericName[lij]=Navegatô Web +GenericName[lt]=Web Browser +GenericName[lv]=Tīmekļa pārlūks +GenericName[mk]=Web Browser +GenericName[mr]=Web Browser +GenericName[ms]=Web Browser +GenericName[my]=Web Browser +GenericName[nb_NO]=Nettleser +GenericName[ne_NP]=वेब ब्राउजर +GenericName[nl]=Webbrowser +GenericName[nn_NO]=Nettlesar +GenericName[oc]=Navegador Web +GenericName[pa_IN]=ਵੈੱਬ ਬਰਾਊਜ਼ਰ +GenericName[pl]=Przeglądarka internetowa +GenericName[pt_BR]=Navegador web +GenericName[pt_PT]=Navegador Web +GenericName[rm]=Navigatur web +GenericName[ro]=Web Browser +GenericName[ru]=Веб-браузер +GenericName[sat]=ᱣᱮᱵᱽ ᱵᱽᱨᱟᱣᱡᱚᱨ +GenericName[sc]=Navigadore web +GenericName[sco]=Web Browser +GenericName[si]=වියමන අතිරික්සුව +GenericName[sk]=Webový prehliadač +GenericName[skr]=ویب براؤزر +GenericName[sl]=Spletni brskalnik +GenericName[son]=Web Browser +GenericName[sq]=Shfletues +GenericName[sr]=Веб прегледач +GenericName[sv_SE]=Webbläsare +GenericName[szl]=Web Browser +GenericName[ta]=Web Browser +GenericName[te]=జాల విహారిణి +GenericName[tg]=Браузери веб +GenericName[th]=เว็บเบราว์เซอร์ +GenericName[tl]=Web Browser +GenericName[tr]=Web Tarayıcısı +GenericName[trs]=Web riña gāchē nu’ +GenericName[uk]=Браузер +GenericName[ur]=Web Browser +GenericName[uz]=Web Browser +GenericName[vi]=Trình duyệt web +GenericName[xh]=Web Browser +GenericName[zh_CN]=Web 浏览器 +GenericName[zh_TW]=網頁瀏覽器 +Keywords=Internet;WWW;Browser;Web;Explorer; +Keywords[ach]=Internet;WWW;Browser;Web;Explorer; +Keywords[af]=Internet;WWW;Browser;Web;Explorer; +Keywords[an]=Internet;WWW;Browser;Web;Explorer; +Keywords[ar]=إنترنت;WWW;متصفح;ويب;مستكشف; +Keywords[ast]=Internet;WWW;Browser;Web;Explorer; +Keywords[az]=Internet;WWW;Browser;Web;Explorer; +Keywords[be]=Internet;WWW;Browser;Web;Explorer; +Keywords[bg]=Internet;WWW;Browser;Web;Explorer; +Keywords[bn]=ইন্টারনেট;WWW;ব্রাউজার;ওয়েব;এক্সপ্লোরার; +Keywords[br]=Internet;WWW;Merdeer;Web;Ergerzhout; +Keywords[bs]=Internet;WWW;Pretraživač;Web;Istraživač; +Keywords[ca]=Internet;WWW;Browser;Web;Explorador;Navegador; +Keywords[ca_valencia]=Internet;WWW;Browser;Web;Explorer; +Keywords[cak]=K'amaya'l;WWW;Okik'amaya'l;Kanob'äl; +Keywords[cs]=internet;WWW;prohlížeč;web; +Keywords[cy]=Rhyngrwyd;WWW;Porwr;Gwe;Archwiliwr; +Keywords[da]=Internet;WWW;Browser;Nettet;Explorer; +Keywords[de]=Internet;WWW;Browser;Web;Explorer; +Keywords[dsb]=Internet;WWW;wobglědowak;Web;Explorer; +Keywords[el]=Internet;WWW;Browser;Web;Explorer;Διαδίκτυο;Ιστός;Ίντερνετ; +Keywords[en_CA]=Internet;WWW;Browser;Web;Explorer; +Keywords[en_GB]=Internet;WWW;Browser;Web;Explorer; +Keywords[eo]=Interreto;Retumilo;TTT;Teksaĵo;Reto;Internet;WWW;Browser;Web;Explorer; +Keywords[es_AR]=Internet;WWW;Navegador;Web;Explorador; +Keywords[es_CL]=Internet;WWW;Navegador;Web;Explorador; +Keywords[es_ES]=Internet;WWW;Navegador;Web;Explorador; +Keywords[es_MX]=Internet;WWW;Navegador;Web;Explorador; +Keywords[et]=Internet;WWW;Browser;Web;Explorer; +Keywords[eu]=Internet;WWW;Nabigatzailea;Web;Arakatzailea; +Keywords[fa]=Internet;WWW;Browser;Web;Explorer; +Keywords[ff]=Internet;WWW;Browser;Web;Explorer; +Keywords[fi]=Internet;WWW;Browser;Web;Explorer;netti;webbi;selain; +Keywords[fr]=Internet;WWW;Navigateur;Web;Explorer; +Keywords[fur]=Internet;WWW;Browser;Navigadôr;Web;Esploradôr;Explorer; +Keywords[fy_NL]=Ynternet;WWW;Browser;Web;Ferkenner; +Keywords[ga_IE]=Internet;WWW;Browser;Web;Explorer; +Keywords[gd]=Internet;WWW;Browser;Web;Explorer;eadar-lìon;brabhsair;brobhsair;lìon;taisgealaiche; +Keywords[gl]=Internet;WWW;Navegador;Web;Explorador; +Keywords[gn]=Internet;WWW;Browser;Web;Explorer; +Keywords[gu_IN]=Internet;WWW;Browser;Web;Explorer; +Keywords[he]=אינטרנט;WWW;דפדפן;רשת;סייר;מרשתת; +Keywords[hi_IN]=Internet;WWW;Browser;Web;Explorer; +Keywords[hr]=Internet;WWW;Preglednik;Web;Istraživač; +Keywords[hsb]=Internet;WWW;wobhladowak;Web;Explorer; +Keywords[hu]=Internet;WWW;Böngésző;Web;Világháló; +Keywords[hy_AM]=Համացանց,WWW,Զննիչ,Վեբ,Ցանցախույզ: +Keywords[ia]=Internet;WWW;Navigator;Web;Explorator; +Keywords[id]=Internet;WWW;Browser;Web;Explorer; +Keywords[is]=Internet;WWW; Vafri; Vefur; Explorer; +Keywords[it]=Internet;WWW;Browser;Web;Explorer;Navigatore; +Keywords[ja]=Internet;WWW;Browser;Web;Explorer;インターネット;ブラウザー;ウェブ; +Keywords[ka]=ინტერნეტი;WWW;ბრაუზერი;ქსელი;ქსელთან წვდომა; +Keywords[kab]=Internet;WWW;Browser;Web;Explorer; +Keywords[kk]=Internet;WWW;Browser;Web;Explorer;Интернет;Ғаламтор;Браузер;Желі;Шолғыш; +Keywords[km]=Internet;WWW;Browser;Web;Explorer; +Keywords[kn]=Internet;WWW;Browser;Web;Explorer; +Keywords[ko]=인터넷;브라우저;웹;탐색기;Internet;WWW;Browser;Web;Explorer; +Keywords[lij]=Internet;WWW;Browser;Web;Explorer;Navegatô; +Keywords[lt]=Internet;WWW;Browser;Web;Explorer; +Keywords[lv]=Internets;WWW;Pārlūkprogramma;Tīmeklis; +Keywords[mk]=Internet;WWW;Browser;Web;Explorer; +Keywords[mr]=Internet;WWW;Browser;Web;Explorer; +Keywords[ms]=Internet;WWW;Browser;Web;Explorer; +Keywords[my]=Internet;WWW;Browser;Web;Explorer; +Keywords[nb_NO]=Internett;WWW;Nettleser;Web;Utforsker; +Keywords[ne_NP]=Internet;WWW;Browser;Web;Explorer; +Keywords[nl]=Internet;WWW;Browser;Web;Verkenner; +Keywords[nn_NO]=Internett;WWW;Nettlesar;Web;Utforskar; +Keywords[oc]=Internet;WWW;Navegador;Navigador;Navegator;Navigator;Web;Explorer; +Keywords[pa_IN]=ਇੰਟਰਨੈੱਟ;WWW;ਬਰਾਊਜ਼ਰ;ਵੈੱਬ;ਐਕਸਪਲਰੋਰ;ਵੈਬ;ਇੰਟਰਨੈਟ; +Keywords[pl]=Internet;WWW;Przeglądarka;Browser;Wyszukiwarka;Web;Sieć;Explorer;Eksplorer;Strony;Witryny;internetowe; +Keywords[pt_BR]=Internet;WWW;Browser;Web;Explorer;Navegador; +Keywords[pt_PT]=Internet;WWW;Navegador;Web;Explorador; +Keywords[rm]=Internet;WWW;Browser;Web;Explorer;navigatur; +Keywords[ro]=Internet;WWW;Browser;Web;Explorer; +Keywords[ru]=Сеть;Интернет;Браузер;Доступ в Интернет; +Keywords[sat]=Internet;WWW;Browser;Web;Explorer; +Keywords[sc]=Internet;WWW;Navigadore;Web;Explorer; +Keywords[sco]=Internet;WWW;Browser;Web;Explorer; +Keywords[si]=අන්තර්ජාලය;අතිරික්සුව;පිරික්සන්න;ගවේශකය;Internet;WWW;Browser;Web;Explorer; +Keywords[sk]=Internet;WWW;Prehliadač;Web;Prieskumník; +Keywords[skr]=Internet;WWW;Browser;Web;Explorer; +Keywords[sl]=internet;www;brskalnik;splet; +Keywords[son]=Internet;WWW;Browser;Web;Explorer; +Keywords[sq]=Internet;WWW;Shfletues;Web;Eksplorues; +Keywords[sr]=Internet;WWW;Browser;Web;Explorer;интернет;прегледач;веб;мрежа;прегледач; +Keywords[sv_SE]=Internet;WWW;Webbläsare;Webb;Utforskare; +Keywords[szl]=Internet;WWW;Browser;Web;Explorer; +Keywords[ta]=Internet;WWW;Browser;Web;Explorer; +Keywords[te]=Internet;WWW;Browser;Web;Explorer; +Keywords[tg]=Интернет;WWW;Браузер;Сомона;Ҷустуҷӯгар; +Keywords[th]=อินเทอร์เน็ต;เบราว์เซอร์;เว็บ;Internet;WWW;Browser;Web;Explorer; +Keywords[tl]=Internet;WWW;Browser;Web;Explorer; +Keywords[tr]=Internet;WWW;Browser;Web;Explorer;İnternet;Tarayıcı; +Keywords[trs]=Internet;WWW;Browser;Web;Explorer; +Keywords[uk]=Інтернет;WWW;Браузер;Веб;Переглядач; +Keywords[ur]=Internet;WWW;Browser;Web;Explorer; +Keywords[uz]=Internet;WWW;Browser;Web;Explorer; +Keywords[vi]=Internet;WWW;Trình duyệt;Web;Duyệt web; +Keywords[xh]=Internet;WWW;Browser;Web;Explorer; +Keywords[zh_CN]=Internet;WWW;Browser;Web;Explorer; +Keywords[zh_TW]=網際網路;網路;瀏覽器;網頁;上網;Internet;WWW;Browser;Web;Explorer; +X-GNOME-FullName=Firefox Web Browser +X-GNOME-FullName[ach]=Firefox Web Browser +X-GNOME-FullName[af]=Firefox Web Browser +X-GNOME-FullName[an]=Firefox Web Browser +X-GNOME-FullName[ar]=متصفح Firefox +X-GNOME-FullName[ast]=Firefox Web Browser +X-GNOME-FullName[az]=Firefox Web Browser +X-GNOME-FullName[be]=Вэб-браўзер Firefox +X-GNOME-FullName[bg]=Firefox Уеб браузър +X-GNOME-FullName[bn]=Firefox Web Browser +X-GNOME-FullName[br]=Merdeer Web Firefox +X-GNOME-FullName[bs]=Firefox web pretraživač +X-GNOME-FullName[ca]=Navegador web Firefox +X-GNOME-FullName[ca_valencia]=Firefox Web Browser +X-GNOME-FullName[cak]=Firefox Web Browser +X-GNOME-FullName[cs]=Webový prohlížeč Firefox +X-GNOME-FullName[cy]=Porwr Gwe Firefox +X-GNOME-FullName[da]=Firefox-browser +X-GNOME-FullName[de]=Firefox-Web-Browser +X-GNOME-FullName[dsb]=Webwobglědowak Firefox +X-GNOME-FullName[el]=Πρόγραμμα περιήγησης Firefox +X-GNOME-FullName[en_CA]=Firefox Web Browser +X-GNOME-FullName[en_GB]=Firefox Web Browser +X-GNOME-FullName[eo]=Retumilo Firefox +X-GNOME-FullName[es_AR]=Navegador web Firefox +X-GNOME-FullName[es_CL]=Navegador web Firefox +X-GNOME-FullName[es_ES]=Navegador web Firefox +X-GNOME-FullName[es_MX]=Navegador web Firefox +X-GNOME-FullName[et]=Firefox Web Browser +X-GNOME-FullName[eu]=Firefox web nabigatzailea +X-GNOME-FullName[fa]=Firefox Web Browser +X-GNOME-FullName[ff]=Firefox Web Browser +X-GNOME-FullName[fi]=Firefox-verkkoselain +X-GNOME-FullName[fr]=Navigateur web Firefox +X-GNOME-FullName[fur]=Navigadôr web Firefox +X-GNOME-FullName[fy_NL]=Firefox-webbrowser +X-GNOME-FullName[ga_IE]=Firefox Web Browser +X-GNOME-FullName[gd]=Brabhsair-lìn Firefox +X-GNOME-FullName[gl]=Navegador web Firefox +X-GNOME-FullName[gn]=Firefox Ñanduti Kundahára +X-GNOME-FullName[gu_IN]=Firefox Web Browser +X-GNOME-FullName[he]=דפדפן אינטרנט Firefox +X-GNOME-FullName[hi_IN]=Firefox वेब ब्राउज़र +X-GNOME-FullName[hr]=Firefox web preglednik +X-GNOME-FullName[hsb]=Webwobhladowak Firefox +X-GNOME-FullName[hu]=Firefox webböngésző +X-GNOME-FullName[hy_AM]=Firefox վեբ դիտարկիչ +X-GNOME-FullName[ia]=Navigator web Firefox +X-GNOME-FullName[id]=Firefox Peramban Web +X-GNOME-FullName[is]=Firefox-vafri +X-GNOME-FullName[it]=Browser web Firefox +X-GNOME-FullName[ja]=Firefox ウェブブラウザー +X-GNOME-FullName[ka]=Firefox-ბრაუზერი +X-GNOME-FullName[kab]=Iminig web Firefox +X-GNOME-FullName[kk]=Firefox веб-браузері +X-GNOME-FullName[km]=Firefox Web Browser +X-GNOME-FullName[kn]=Firefox Web Browser +X-GNOME-FullName[ko]=Firefox 웹 브라우저 +X-GNOME-FullName[lij]=Firefox Navegatô Web +X-GNOME-FullName[lt]=Firefox Web Browser +X-GNOME-FullName[lv]=Firefox tīmekļa pārlūks +X-GNOME-FullName[mk]=Firefox Web Browser +X-GNOME-FullName[mr]=Firefox Web Browser +X-GNOME-FullName[ms]=Firefox Web Browser +X-GNOME-FullName[my]=Firefox Web Browser +X-GNOME-FullName[nb_NO]=Firefox-nettleser +X-GNOME-FullName[ne_NP]=Firefox वेब ब्राउजर +X-GNOME-FullName[nl]=Firefox-webbrowser +X-GNOME-FullName[nn_NO]=Firefox-nettlesar +X-GNOME-FullName[oc]=Navegador web Firefox +X-GNOME-FullName[pa_IN]=Firefox ਵੈੱਬ ਬਰਾਊਜ਼ਰ +X-GNOME-FullName[pl]=Przeglądarka Firefox +X-GNOME-FullName[pt_BR]=Navegador web Firefox +X-GNOME-FullName[pt_PT]=Navegador Web Firefox +X-GNOME-FullName[rm]=Navigatur-web Firefox +X-GNOME-FullName[ro]=Firefox Web Browser +X-GNOME-FullName[ru]=Веб-браузер Firefox +X-GNOME-FullName[sat]=Firefox ᱣᱮᱵᱽ ᱵᱽᱨᱟᱣᱡᱚᱨ +X-GNOME-FullName[sc]=Navigadore web Firefox +X-GNOME-FullName[sco]=Firefox Web Browser +X-GNOME-FullName[si]=Firefox අතිරික්සුව +X-GNOME-FullName[sk]=Webový prehliadač Firefox +X-GNOME-FullName[skr]=Firefox ویب براؤزر +X-GNOME-FullName[sl]=Spletni brskalnik Firefox +X-GNOME-FullName[son]=Firefox Web Browser +X-GNOME-FullName[sq]=Shfletuesi Firefox +X-GNOME-FullName[sr]=Firefox веб прегледач +X-GNOME-FullName[sv_SE]=Firefox webbläsare +X-GNOME-FullName[szl]=Firefox Web Browser +X-GNOME-FullName[ta]=Firefox Web Browser +X-GNOME-FullName[te]=Firefox Web Browser +X-GNOME-FullName[tg]=Браузери интернетии «Firefox» +X-GNOME-FullName[th]=เว็บเบราว์เซอร์ Firefox +X-GNOME-FullName[tl]=Firefox Web Browser +X-GNOME-FullName[tr]=Firefox Web Tarayıcısı +X-GNOME-FullName[trs]=Firefox Web riña gāchē nu’ +X-GNOME-FullName[uk]=Браузер Firefox +X-GNOME-FullName[ur]=Firefox Web Browser +X-GNOME-FullName[uz]=Firefox Web Browser +X-GNOME-FullName[vi]=Trình duyệt Web Firefox +X-GNOME-FullName[xh]=Firefox Web Browser +X-GNOME-FullName[zh_CN]=Firefox 浏览器 +X-GNOME-FullName[zh_TW]=Firefox 網頁瀏覽器 Exec=firefox %u Icon=firefox Terminal=false @@ -49,224 +522,324 @@ Type=Application MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https; StartupNotify=true Categories=Network;WebBrowser; -Keywords=web;browser;internet; -Actions=new-window;new-private-window; +Actions=new-window;new-private-window;profile-manager-window; +# Activable desktop file crashes KDE so remove it for now +# DBusActivatable=true [Desktop Action new-window] -Name=Open a New Window -Name[ach]=Dirica manyen -Name[af]=Nuwe venster -Name[an]=Nueva finestra +Name=New Window +Name[ach]=New Window +Name[af]=New Window +Name[an]=New Window Name[ar]=نافذة جديدة -Name[as]=নতুন উইন্ডো -Name[ast]=Ventana nueva -Name[az]=Yeni Pəncərə +Name[ast]=New Window +Name[az]=New Window Name[be]=Новае акно Name[bg]=Нов прозорец -Name[bn-BD]=নতুন উইন্ডো (N) -Name[bn-IN]=নতুন উইন্ডো +Name[bn]=নতুন উইন্ডো Name[br]=Prenestr nevez -Name[brx]=गोदान उइन्ड'(N) Name[bs]=Novi prozor Name[ca]=Finestra nova -Name[cak]=K'ak'a' tzuwäch +Name[ca_valencia]=New Window +Name[cak]=K'ak'a' Tzuwäch Name[cs]=Nové okno Name[cy]=Ffenestr Newydd Name[da]=Nyt vindue Name[de]=Neues Fenster Name[dsb]=Nowe wokno Name[el]=Νέο παράθυρο -Name[en-GB]=New Window -Name[en-US]=New Window -Name[en-ZA]=New Window +Name[en_CA]=New Window +Name[en_GB]=New Window Name[eo]=Nova fenestro -Name[es-AR]=Nueva ventana -Name[es-CL]=Nueva ventana -Name[es-ES]=Nueva ventana -Name[es-MX]=Nueva ventana -Name[et]=Uus aken +Name[es_AR]=Nueva ventana +Name[es_CL]=Nueva ventana +Name[es_ES]=Nueva ventana +Name[es_MX]=Nueva ventana +Name[et]=New Window Name[eu]=Leiho berria Name[fa]=پنجره جدید‌ -Name[ff]=Henorde Hesere +Name[ff]=New Window Name[fi]=Uusi ikkuna Name[fr]=Nouvelle fenêtre -Name[fy-NL]=Nij finster -Name[ga-IE]=Fuinneog Nua +Name[fur]=Gnûf barcon +Name[fy_NL]=Nij finster +Name[ga_IE]=New Window Name[gd]=Uinneag ùr Name[gl]=Nova xanela Name[gn]=Ovetã pyahu -Name[gu-IN]=નવી વિન્ડો +Name[gu_IN]=New Window Name[he]=חלון חדש -Name[hi-IN]=नया विंडो +Name[hi_IN]=New Window Name[hr]=Novi prozor Name[hsb]=Nowe wokno Name[hu]=Új ablak -Name[hy-AM]=Նոր Պատուհան +Name[hy_AM]=Նոր պատուհան +Name[ia]=Nove fenestra Name[id]=Jendela Baru Name[is]=Nýr gluggi Name[it]=Nuova finestra Name[ja]=新しいウィンドウ -Name[ja-JP-mac]=新規ウインドウ Name[ka]=ახალი ფანჯარა +Name[kab]=Asfaylu amaynut Name[kk]=Жаңа терезе -Name[km]=បង្អួច​​​ថ្មី -Name[kn]=ಹೊಸ ಕಿಟಕಿ +Name[km]=New Window +Name[kn]=New Window Name[ko]=새 창 -Name[kok]=नवें जनेल -Name[ks]=نئئ وِنڈو -Name[lij]=Neuvo barcon -Name[lo]=ຫນ້າຕ່າງໃຫມ່ -Name[lt]=Naujas langas -Name[ltg]=Jauns lūgs +Name[lij]=Neuvo Barcon +Name[lt]=New Window Name[lv]=Jauns logs -Name[mai]=नव विंडो -Name[mk]=Нов прозорец -Name[ml]=പുതിയ ജാലകം -Name[mr]=नवीन पटल -Name[ms]=Tetingkap Baru -Name[my]=ဝင်းဒိုးအသစ် -Name[nb-NO]=Nytt vindu -Name[ne-NP]=नयाँ सञ्झ्याल +Name[mk]=New Window +Name[mr]=New Window +Name[ms]=New Window +Name[my]=New Window +Name[nb_NO]=Nytt vindu +Name[ne_NP]=नयाँ सञ्झ्याल Name[nl]=Nieuw venster -Name[nn-NO]=Nytt vindauge -Name[or]=ନୂତନ ୱିଣ୍ଡୋ -Name[pa-IN]=ਨਵੀਂ ਵਿੰਡੋ +Name[nn_NO]=Nytt vindauge +Name[oc]=Fenèstra novèla +Name[pa_IN]=ਨਵੀਂ ਵਿੰਡੋ Name[pl]=Nowe okno -Name[pt-BR]=Nova janela -Name[pt-PT]=Nova janela +Name[pt_BR]=Nova janela +Name[pt_PT]=Nova janela Name[rm]=Nova fanestra -Name[ro]=Fereastră nouă +Name[ro]=New Window Name[ru]=Новое окно -Name[sat]=नावा विंडो (N) -Name[si]=නව කවුළුවක් +Name[sat]=ᱱᱟᱶᱟ ᱣᱤᱱᱰᱳ +Name[sc]=Ventana noa +Name[sco]=New Window +Name[si]=නව කවුළුව Name[sk]=Nové okno +Name[skr]=نویں ونڈو Name[sl]=Novo okno -Name[son]=Zanfun taaga +Name[son]=New Window Name[sq]=Dritare e Re Name[sr]=Нови прозор -Name[sv-SE]=Nytt fönster -Name[ta]=புதிய சாளரம் -Name[te]=కొత్త విండో +Name[sv_SE]=Nytt fönster +Name[szl]=New Window +Name[ta]=New Window +Name[te]=కొత్త కిటికీ +Name[tg]=Равзанаи нав Name[th]=หน้าต่างใหม่ +Name[tl]=New Window Name[tr]=Yeni pencere -Name[tsz]=Eraatarakua jimpani +Name[trs]=Bēntanâ nākàa Name[uk]=Нове вікно -Name[ur]=نیا دریچہ -Name[uz]=Yangi oyna +Name[ur]=New Window +Name[uz]=New Window Name[vi]=Cửa sổ mới -Name[wo]=Palanteer bu bees -Name[xh]=Ifestile entsha -Name[zh-CN]=新建窗口 -Name[zh-TW]=開新視窗 - - +Name[xh]=New Window +Name[zh_CN]=新建窗口 +Name[zh_TW]=開新視窗 Exec=firefox --new-window %u [Desktop Action new-private-window] -Name=Open a New Private Window -Name[ach]=Dirica manyen me mung -Name[af]=Nuwe privaatvenster -Name[an]=Nueva finestra privada +Name=New Private Window +Name[ach]=New Private Window +Name[af]=New Private Window +Name[an]=New Private Window Name[ar]=نافذة خاصة جديدة -Name[as]=নতুন ব্যক্তিগত উইন্ডো -Name[ast]=Ventana privada nueva -Name[az]=Yeni Məxfi Pəncərə -Name[be]=Новае акно адасаблення -Name[bg]=Нов прозорец за поверително сърфиране -Name[bn-BD]=নতুন ব্যক্তিগত উইন্ডো -Name[bn-IN]=নতুন ব্যক্তিগত উইন্ডো -Name[br]=Prenestr merdeiñ prevez nevez -Name[brx]=गोदान प्राइभेट उइन्ड' +Name[ast]=New Private Window +Name[az]=New Private Window +Name[be]=Новае прыватнае акно +Name[bg]=Нов личен прозорец +Name[bn]=নতুন ব্যক্তিগত উইন্ডো +Name[br]=Prenestr prevez nevez Name[bs]=Novi privatni prozor Name[ca]=Finestra privada nova -Name[cak]=K'ak'a' ichinan tzuwäch +Name[ca_valencia]=New Private Window +Name[cak]=K'ak'a' Ichinan Tzuwäch Name[cs]=Nové anonymní okno Name[cy]=Ffenestr Breifat Newydd Name[da]=Nyt privat vindue Name[de]=Neues privates Fenster Name[dsb]=Nowe priwatne wokno -Name[el]=Νέο παράθυρο ιδιωτικής περιήγησης -Name[en-GB]=New Private Window -Name[en-US]=New Private Window -Name[en-ZA]=New Private Window +Name[el]=Νέο ιδιωτικό παράθυρο +Name[en_CA]=New Private Window +Name[en_GB]=New Private Window Name[eo]=Nova privata fenestro -Name[es-AR]=Nueva ventana privada -Name[es-CL]=Nueva ventana privada -Name[es-ES]=Nueva ventana privada -Name[es-MX]=Nueva ventana privada -Name[et]=Uus privaatne aken +Name[es_AR]=Nueva ventana privada +Name[es_CL]=Nueva ventana privada +Name[es_ES]=Nueva ventana privada +Name[es_MX]=Nueva ventana privada +Name[et]=New Private Window Name[eu]=Leiho pribatu berria Name[fa]=پنجره ناشناس جدید -Name[ff]=Henorde Suturo Hesere +Name[ff]=New Private Window Name[fi]=Uusi yksityinen ikkuna -Name[fr]=Nouvelle fenêtre de navigation privée -Name[fy-NL]=Nij priveefinster -Name[ga-IE]=Fuinneog Nua Phríobháideach +Name[fr]=Nouvelle fenêtre privée +Name[fur]=Gnûf barcon privât +Name[fy_NL]=Nij priveefinster +Name[ga_IE]=New Private Window Name[gd]=Uinneag phrìobhaideach ùr Name[gl]=Nova xanela privada Name[gn]=Ovetã ñemi pyahu -Name[gu-IN]=નવી ખાનગી વિન્ડો +Name[gu_IN]=New Private Window Name[he]=חלון פרטי חדש -Name[hi-IN]=नयी निजी विंडो +Name[hi_IN]=New Private Window Name[hr]=Novi privatni prozor Name[hsb]=Nowe priwatne wokno Name[hu]=Új privát ablak -Name[hy-AM]=Սկսել Գաղտնի դիտարկում +Name[hy_AM]=Նոր գաղտնի պատուհան +Name[ia]=Nove fenestra private Name[id]=Jendela Mode Pribadi Baru Name[is]=Nýr huliðsgluggi Name[it]=Nuova finestra anonima Name[ja]=新しいプライベートウィンドウ -Name[ja-JP-mac]=新規プライベートウインドウ Name[ka]=ახალი პირადი ფანჯარა +Name[kab]=Asfaylu amaynut n tunigin tusligt Name[kk]=Жаңа жекелік терезе -Name[km]=បង្អួច​ឯកជន​ថ្មី -Name[kn]=ಹೊಸ ಖಾಸಗಿ ಕಿಟಕಿ -Name[ko]=새 사생활 보호 모드 -Name[kok]=नवो खाजगी विंडो -Name[ks]=نْو پرایوٹ وینڈو& -Name[lij]=Neuvo barcon privou -Name[lo]=ເປີດຫນ້າຕ່າງສວນຕົວຂື້ນມາໃຫມ່ -Name[lt]=Naujas privataus naršymo langas -Name[ltg]=Jauns privatais lūgs +Name[km]=New Private Window +Name[kn]=New Private Window +Name[ko]=새 사생활 보호 창 +Name[lij]=Neuvo Barcon Privòu +Name[lt]=New Private Window Name[lv]=Jauns privātais logs -Name[mai]=नया निज विंडो (W) -Name[mk]=Нов приватен прозорец -Name[ml]=പുതിയ സ്വകാര്യ ജാലകം -Name[mr]=नवीन वैयक्तिक पटल -Name[ms]=Tetingkap Persendirian Baharu +Name[mk]=New Private Window +Name[mr]=New Private Window +Name[ms]=New Private Window Name[my]=New Private Window -Name[nb-NO]=Nytt privat vindu -Name[ne-NP]=नयाँ निजी सञ्झ्याल +Name[nb_NO]=Nytt privat vindu +Name[ne_NP]=नयाँ निजी सञ्झ्याल Name[nl]=Nieuw privévenster -Name[nn-NO]=Nytt privat vindauge -Name[or]=ନୂତନ ବ୍ୟକ୍ତିଗତ ୱିଣ୍ଡୋ -Name[pa-IN]=ਨਵੀਂ ਪ੍ਰਾਈਵੇਟ ਵਿੰਡੋ +Name[nn_NO]=Nytt privat vindauge +Name[oc]=Fenèstra privada novèla +Name[pa_IN]=ਨਵੀਂ ਪ੍ਰਾਈਵੇਟ ਵਿੰਡੋ Name[pl]=Nowe okno prywatne -Name[pt-BR]=Nova janela privativa -Name[pt-PT]=Nova janela privada +Name[pt_BR]=Nova janela privativa +Name[pt_PT]=Nova janela privada Name[rm]=Nova fanestra privata -Name[ro]=Fereastră privată nouă +Name[ro]=New Private Window Name[ru]=Новое приватное окно -Name[sat]=नावा निजेराक् विंडो (W ) -Name[si]=නව පුද්ගලික කවුළුව (W) -Name[sk]=Nové okno v režime Súkromné prehliadanie +Name[sat]=ᱱᱟᱶᱟ ᱱᱤᱡᱮᱨᱟᱜ ᱣᱤᱱᱰᱳ +Name[sc]=Ventana privada noa +Name[sco]=New Private Window +Name[si]=නව පෞද්. කවුළුව +Name[sk]=Nové súkromné okno +Name[skr]=نویں نجی ونڈو Name[sl]=Novo zasebno okno -Name[son]=Sutura zanfun taaga +Name[son]=New Private Window Name[sq]=Dritare e Re Private -Name[sr]=Нови приватан прозор -Name[sv-SE]=Nytt privat fönster -Name[ta]=புதிய தனிப்பட்ட சாளரம் -Name[te]=కొత్త ఆంతరంగిక విండో +Name[sr]=Нови приватни прозор +Name[sv_SE]=Nytt privat fönster +Name[szl]=New Private Window +Name[ta]=New Private Window +Name[te]=కొత్త ఆంతరంగిక కిటికీ +Name[tg]=Равзанаи хусусии нав Name[th]=หน้าต่างส่วนตัวใหม่ +Name[tl]=New Private Window Name[tr]=Yeni gizli pencere -Name[tsz]=Juchiiti eraatarakua jimpani +Name[trs]=Bēntanâ huì nākàa Name[uk]=Приватне вікно -Name[ur]=نیا نجی دریچہ -Name[uz]=Yangi maxfiy oyna +Name[ur]=New Private Window +Name[uz]=New Private Window Name[vi]=Cửa sổ riêng tư mới -Name[wo]=Panlanteeru biir bu bees -Name[xh]=Ifestile yangasese entsha -Name[zh-CN]=新建隐私浏览窗口 -Name[zh-TW]=新增隱私視窗 +Name[xh]=New Private Window +Name[zh_CN]=新建隐私窗口 +Name[zh_TW]=開新隱私視窗 Exec=firefox --private-window %u +[Desktop Action open-profile-manager] +Name=Open Profile Manager +Name[ach]=Open Profile Manager +Name[af]=Open Profile Manager +Name[an]=Open Profile Manager +Name[ar]=افتح مدير الملف الشخصي +Name[ast]=Open Profile Manager +Name[az]=Open Profile Manager +Name[be]=Адкрыць менеджар профіляў +Name[bg]=Отваряне на мениджъра на профили +Name[bn]=Open Profile Manager +Name[br]=Digeriñ an ardoer aeladoù +Name[bs]=Otvori Menadžera profila +Name[ca]=Obre el gestor de perfils +Name[ca_valencia]=Open Profile Manager +Name[cak]=Open Profile Manager +Name[cs]=Otevřete Správce profilů +Name[cy]=Agorwch y Rheolwr Proffil +Name[da]=Åbn profilhåndtering +Name[de]=Profilverwaltung öffnen +Name[dsb]=Profilowy zastojnik wócyniś +Name[el]=Άνοιγμα Διαχείρισης προφίλ +Name[en_CA]=Open Profile Manager +Name[en_GB]=Open Profile Manager +Name[eo]=Malfermi administranton de profiloj +Name[es_AR]=Abrir administrador de perfiles +Name[es_CL]=Abrir administrador de perfiles +Name[es_ES]=Abrir administrador de perfiles +Name[es_MX]=Abrir administrador de perfiles +Name[et]=Open Profile Manager +Name[eu]=Ireki profilen kudeatzailea +Name[fa]=Open Profile Manager +Name[ff]=Open Profile Manager +Name[fi]=Avaa profiilien hallinta +Name[fr]=Ouvrir le gestionnaire de profils +Name[fur]=Vierç gjestôr profîi +Name[fy_NL]=Profylbehearder iepenje +Name[ga_IE]=Open Profile Manager +Name[gd]=Fosgail manaidsear nam pròifilean +Name[gl]=Abrir o xestor de perfís +Name[gn]=Embojuruja mba’ete ñangarekoha +Name[gu_IN]=Open Profile Manager +Name[he]=פתיחת מנהל הפרופילים +Name[hi_IN]=Open Profile Manager +Name[hr]=Otvori upravljač profila +Name[hsb]=Zrjadowak profilow wočinić +Name[hu]=Profilkezelő megnyitása +Name[hy_AM]=Բացեք պրոֆիլի կառավարիչը +Name[ia]=Aperir le gestor de profilo +Name[id]=Buka Pengelola Profil +Name[is]=Opna umsýslu notandasniða +Name[it]=Apri gestore profili +Name[ja]=プロファイルマネージャーを開く +Name[ka]=პროფილის მმართველის გახსნა +Name[kab]=Ldi amsefrak n umaɣnu +Name[kk]=Профильдер бақарушысын ашу +Name[km]=Open Profile Manager +Name[kn]=Open Profile Manager +Name[ko]=프로필 관리자 열기 +Name[lij]=Open Profile Manager +Name[lt]=Open Profile Manager +Name[lv]=Atvērt profilu pārvaldnieku +Name[mk]=Open Profile Manager +Name[mr]=Open Profile Manager +Name[ms]=Open Profile Manager +Name[my]=Open Profile Manager +Name[nb_NO]=Åpne profilbehandler +Name[ne_NP]=Open Profile Manager +Name[nl]=Profielbeheerder openen +Name[nn_NO]=Opne profilhandsaming +Name[oc]=Dobrir lo gestionari de perfils +Name[pa_IN]=ਪਰੋਫ਼ਾਈਲ ਮੈਨੇਜਰ ਖੋਲ੍ਹੋ +Name[pl]=Menedżer profili +Name[pt_BR]=Abrir gerenciador de perfis +Name[pt_PT]=Abrir o Gestor de Perfis +Name[rm]=Avrir l'administraziun da profils +Name[ro]=Open Profile Manager +Name[ru]=Открыть менеджер профилей +Name[sat]=ᱢᱮᱫᱦᱟᱸ ᱢᱮᱱᱮᱡᱚᱨ ᱠᱷᱩᱞᱟᱹᱭ ᱢᱮ +Name[sc]=Aberi su gestore de profilos +Name[sco]=Open Profile Manager +Name[si]=පැතිකඩ කළමනාකරු අරින්න +Name[sk]=Otvoriť Správcu profilov +Name[skr]=پروفائل منیجر کھولو +Name[sl]=Odpri upravitelja profilov +Name[son]=Open Profile Manager +Name[sq]=Hapni Përgjegjës Profilesh +Name[sr]=Отворите управљач профила +Name[sv_SE]=Öppna Profilhanteraren +Name[szl]=Open Profile Manager +Name[ta]=Open Profile Manager +Name[te]=Open Profile Manager +Name[tg]=Кушодани мудири профилҳо +Name[th]=เปิดตัวจัดการโปรไฟล์ +Name[tl]=Open Profile Manager +Name[tr]=Profil yöneticisini aç +Name[trs]=Sa nīkāj ñu’ūnj nej perfî huā nì’nï̀nj ïn +Name[uk]=Відкрити менеджер профілів +Name[ur]=Open Profile Manager +Name[uz]=Open Profile Manager +Name[vi]=Mở trình quản lý hồ sơ +Name[xh]=Open Profile Manager +Name[zh_CN]=打开配置文件管理器 +Name[zh_TW]=開啟設定檔管理員 +Exec=firefox --ProfileManager diff --git a/firefox.sh.in b/firefox.sh.in index 5cd169d..7d3faed 100644 --- a/firefox.sh.in +++ b/firefox.sh.in @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/bash # # The contents of this file are subject to the Netscape Public # License Version 1.1 (the "License"); you may not use this file @@ -64,15 +64,13 @@ MOZ_DIST_BIN="$MOZ_LIB_DIR/firefox" MOZ_LANGPACKS_DIR="$MOZ_DIST_BIN/langpacks" MOZ_EXTENSIONS_PROFILE_DIR="$HOME/.mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}" MOZ_PROGRAM="$MOZ_DIST_BIN/$MOZ_FIREFOX_FILE" -MOZ_LAUNCHER="$MOZ_DIST_BIN/run-mozilla.sh" +GETENFORCE_FILE="/usr/sbin/getenforce" ## -## Enable Wayland backend? +## Use D-Bus remote exclusively when there's Wayland display. ## -if __DEFAULT_WAYLAND__ && ! [ $MOZ_DISABLE_WAYLAND ]; then - if [ "$XDG_CURRENT_DESKTOP" == "GNOME" ]; then - export MOZ_ENABLE_WAYLAND=1 - fi +if [ "$WAYLAND_DISPLAY" ]; then + export MOZ_DBUS_REMOTE=1 fi ## @@ -110,10 +108,14 @@ export MOZ_PLUGIN_PATH export MOZ_APP_LAUNCHER="/__PREFIX__/bin/firefox" ## -## Set FONTCONFIG_PATH for Xft/fontconfig +## We want Firefox to use Openh264 provided by Fedora. +## +## We used to configure it here but It's set by /etc/profile.d/gmpopenh264.sh +## script from mozilla-openh264 package now. Let's keep it here just +## for the record. +## +## export MOZ_GMP_PATH=$MOZ_LIB_DIR/mozilla/plugins/gmp-gmpopenh264/system-installed ## -FONTCONFIG_PATH="/etc/fonts:${MOZILLA_FIVE_HOME}/res/Xft" -export FONTCONFIG_PATH ## ## In order to better support certain scripts (such as Indic and some CJK @@ -128,21 +130,10 @@ export FONTCONFIG_PATH # export MOZ_DISABLE_PANGO # -## -## Disable the GNOME crash dialog, Moz has it's own -## -GNOME_DISABLE_CRASH_DIALOG=1 -export GNOME_DISABLE_CRASH_DIALOG - -## -## Disable the SLICE allocator (rhbz#1014858) -## -export G_SLICE=always-malloc - ## ## Enable Xinput2 (mozbz#1207973) ## -export MOZ_USE_XINPUT2=1 +export MOZ_USE_XINPUT2=${MOZ_USE_XINPUT2-1} # OK, here's where all the real work gets done @@ -167,11 +158,19 @@ MOZILLA_DOWN=0 if ! [ $MOZ_DISABLE_LANGPACKS ] || [ $MOZ_DISABLE_LANGPACKS -eq 0 ]; then if [ -x $MOZ_DIST_BIN/$MOZ_FIREFOX_FILE ]; then # Is firefox running? - /__PREFIX__/bin/pidof firefox > /dev/null 2>&1 + /__PREFIX__/bin/pidof $MOZ_PROGRAM > /dev/null 2>&1 MOZILLA_DOWN=$? fi fi +# When Firefox is not running, restore SELinux labels for profile files +# (rhbz#1731371) +if [ $MOZILLA_DOWN -ne 0 ]; then + if [ -x $GETENFORCE_FILE ] && [ `$GETENFORCE_FILE` != "Disabled" ]; then + (restorecon -vr ~/.mozilla/firefox/*/gmp-widevinecdm/* &) + fi +fi + # Modify language pack configuration only when firefox is not running # and language packs are not disabled if [ $MOZILLA_DOWN -ne 0 ]; then @@ -204,8 +203,17 @@ if [ $MOZILLA_DOWN -ne 0 ]; then if [ -h $MOZ_LANGPACKS_DIR/$langpack ]; then langpack=`readlink $MOZ_LANGPACKS_DIR/$langpack` fi - ln -s $MOZ_LANGPACKS_DIR/$langpack \ - $MOZ_EXTENSIONS_PROFILE_DIR/$langpack + if [ -e "/run/ostree-booted" ]; then + # Files on Silverblue has file create time set to 0, + # so in case the langpack is updated Firefox does not + # check for changes because it compares the file + # creation date to do so. + cp -f $MOZ_LANGPACKS_DIR/$langpack \ + $MOZ_EXTENSIONS_PROFILE_DIR/$langpack + else + ln -s $MOZ_LANGPACKS_DIR/$langpack \ + $MOZ_EXTENSIONS_PROFILE_DIR/$langpack + fi echo $MOZ_EXTENSIONS_PROFILE_DIR/$langpack > $FEDORA_LANGPACK_CONFIG return 0 fi @@ -219,40 +227,23 @@ fi NSS_SSL_CBC_RANDOM_IV=${NSS_SSL_CBC_RANDOM_IV-1} export NSS_SSL_CBC_RANDOM_IV -# Prepare command line arguments -script_args="" -pass_arg_count=0 -while [ $# -gt $pass_arg_count ] -do - case "$1" in - -g | --debug) - script_args="$script_args -g" - debugging=1 - shift - ;; - -d | --debugger) - if [ $# -gt 1 ]; then - script_args="$script_args -d $2" - shift 2 - else - shift - fi - ;; - *) - # Move the unrecognized argument to the end of the list. - arg="$1" - shift - set -- "$@" "$arg" - pass_arg_count=`expr $pass_arg_count + 1` - ;; - esac -done +# MOZ_APP_REMOTINGNAME links Firefox with desktop file name +if [ -z "$MOZ_APP_REMOTINGNAME" ] +then + export MOZ_APP_REMOTINGNAME=__APP_NAME__ +fi + +# Flatpak specific environment variables +%FLATPAK_ENV_VARS% + +# Don't throw "old profile" dialog box. +export MOZ_ALLOW_DOWNGRADE=1 # Run the browser debugging=0 if [ $debugging = 1 ] then - echo $MOZ_LAUNCHER $script_args $MOZ_PROGRAM "$@" + echo $MOZ_PROGRAM "$@" fi -exec $MOZ_LAUNCHER $script_args $MOZ_PROGRAM "$@" +exec $MOZ_PROGRAM "$@" diff --git a/firefox.spec b/firefox.spec index c4c847c..b91a17e 100644 --- a/firefox.spec +++ b/firefox.spec @@ -1,80 +1,167 @@ -# Set to true if it's going to be submitted as update. +# Produce a build suitable for release, i.e. use PGO/LTO. You can turn it off +# when building locally to reduce build time. %global release_build 1 -# Disabled arm due to rhbz#1658940 -ExcludeArch: armv7hl -# Disabled due to https://pagure.io/fedora-infrastructure/issue/7581 -ExcludeArch: s390x +# Excluded due to https://bugzilla.mozilla.org/show_bug.cgi?id=1792159 +# https://bugzilla.redhat.com/show_bug.cgi?id=2129720 +ExcludeArch: i686 + +# Run Mozilla test suite as a part of compile rpm section. Turn off when +# building locally and don't want to spend 24 hours waiting for results. +%global run_firefox_tests 0 +%ifarch x86_64 %{ix86} +%global run_firefox_tests 0 +%endif + +# Don't create debuginfo rpm packages. It reduces build time as +# exctracting debuginfo takes long time. +%global create_debuginfo 1 + +# Produce debug (non-optimized) package build. Suitable for debugging only +# as the build is *very* slow. +%global debug_build 0 + +# See rhbz#2134527 - Use portal Gtk file dialog +# Disabled due to various issues now. +%global use_xdg_file_portal 0 + +# PipeWire camera is needed for IPU6 camera support in Fedora 41+ +# https://fedoraproject.org/wiki/Changes/IPU6_Camera_support +%if 0%{?fedora} >= 41 +%global use_pipewire_camera 1 +%else +%global use_pipewire_camera 0 +%endif %global system_nss 1 -%global system_ffi 1 -# libvpx is too new for Firefox 65 -%if 0%{?fedora} < 30 -%global system_libvpx 1 +%global system_libevent 1 +%global build_with_asan 0 +%ifarch x86_64 %{ix86} +%global enable_replace_malloc 1 %else -%global system_libvpx 0 +%global enable_replace_malloc 0 %endif -%global hardened_build 1 -%global system_jpeg 1 -%global run_tests 0 -%global disable_elfhack 1 -%global build_with_clang 0 -%global use_bundled_cbindgen 1 -%ifnarch %{ix86} ppc64 s390x -%if %{release_build} -%global build_with_pgo 1 + +# wasi_sdk 25 is not compatible with llvm 18 +%if 0%{?fedora} <= 40 + %bcond wasi_sdk 0 %else -%global build_with_pgo 0 + %ifarch s390x + %bcond wasi_sdk 0 + %else + %bcond wasi_sdk 1 + %endif %endif + +%bcond build_with_clang 0 +%if %{with build_with_clang} +%global toolchain clang +%else +%global toolchain gcc +%endif + +%global gnome_shell_search_provider 0 +%if 0%{?fedora} >= 40 +%global gnome_shell_search_provider 1 +%endif + +# Temporary disabled due to +# https://bugzilla.redhat.com/show_bug.cgi?id=1951606 +%global enable_mozilla_crashreporter 0 +%ifarch x86_64 %{ix86} +%global enable_mozilla_crashreporter 1 +%endif +%if %{build_with_asan} +%global enable_mozilla_crashreporter 0 +%endif +%if 0%{?flatpak} +%global enable_mozilla_crashreporter 0 +%endif +%if !%{create_debuginfo} +%define _unpackaged_files_terminate_build 0 +%global debug_package %{nil} +%global enable_mozilla_crashreporter 0 +%endif + +%global system_ffi 1 +%global system_av1 0 +%global system_libvpx 1 +%global system_jpeg 1 +%global system_pixman 1 +%global system_webp 1 +%global system_drm 1 +%global system_gbm 1 +%global system_pipewire 1 +# Bundled cbindgen makes build slow. +# Enable only if system cbindgen is not available. +%if 0%{?rhel} +%global use_bundled_cbindgen 1 +%else +%global use_bundled_cbindgen 1 +%endif +%if %{debug_build} +%global release_build 0 +%endif +# Build PGO+LTO on x86_64 only due to build issues +# on other arches. +%global build_with_pgo 0 +%ifarch x86_64 +%if %{release_build} +%global build_with_pgo 1 %endif -%if 0%{?fedora} > 30 -%global wayland_backend_default 1 %endif %if 0%{?flatpak} -%global wayland_backend_default 1 %global build_with_pgo 0 %endif # Big endian platforms -%ifarch ppc64 s390x +%ifarch s390x %global big_endian 1 %endif -%bcond_without debug_build -%if %{with debug_build} -%else -%global debug_build 1 -%else -%global debug_build 0 -%endif %if 0%{?build_with_pgo} -%global use_xvfb 1 +%global use_xvfb 0 %global build_tests 1 %endif -%if !0%{?run_tests} -%global use_xvfb 1 +%if 0%{?run_firefox_tests} +%global use_xvfb 0 %global build_tests 1 %endif +%global launch_wayland_compositor 0 +%if %{build_with_pgo} +%global launch_wayland_compositor 1 +%endif +%if %{run_firefox_tests} +%global launch_wayland_compositor 1 +%endif + %global default_bookmarks_file %{_datadir}/bookmarks/default-bookmarks.html %global firefox_app_id \{ec8030f7-c20a-464f-9b0e-13a3a9e97384\} # Minimal required versions %global cairo_version 1.13.1 %global freetype_version 2.1.9 %global libnotify_version 0.7.0 +%if %{?system_av1} +%global aom_version 1.0.0 +%global dav1d_version 1.0.0 +%endif %if %{?system_libvpx} -%global libvpx_version 1.4.0 +%global libvpx_version 1.10.0 +%endif +%if %{?system_webp} +%global libwebp_version 1.1.0 %endif %if %{?system_nss} -%global nspr_version 4.19 +%global nspr_version 4.37 %global nspr_build_version %{nspr_version} -%global nss_version 3.40.1 +%global nss_version 3.119 %global nss_build_version %{nss_version} %endif -%global mozappdir %{_libdir}/%{name} -%global mozappdirdev %{_libdir}/%{name}-devel-%{version} +%global mozappdir %{_libdir}/firefox +%global mozappdirdev %{_libdir}/firefox-devel-%{version} %global langpackdir %{mozappdir}/langpacks %global tarballdir firefox-%{version} @@ -82,31 +169,49 @@ ExcludeArch: s390x %bcond_without langpacks -%global enable_mozilla_crashreporter 0 -%if !%{debug_build} -%ifarch %{ix86} x86_64 -# Disable crashreporter sa we want to collect Wayland crashes. -%if 0%{?fedora} < 28 -%global enable_mozilla_crashreporter 1 -%endif -%endif +%if %{with langpacks} +%bcond_without langpacks_subpkg %endif %if !%{release_build} -%global pre_tag .test +%global pre_tag .npgo %endif +%if %{with build_with_clang} +%global pre_tag .clang +%endif +%if %{build_with_asan} +%global pre_tag .asan +%global build_with_pgo 0 +%endif +%if !%{system_nss} +%global nss_tag .nss +%endif +%if %{debug_build} +%global pre_tag .debug +%endif + +# Exclude private libraries from autogenerated provides and requires +%global __provides_exclude_from ^%{mozappdir} +%global __requires_exclude ^(%%(find %{buildroot}%{mozappdir} -name '*.so' | xargs -n1 basename | sort -u | paste -s -d '|' -)) + +%undefine _package_note_flags +# for https://bugzilla.redhat.com/show_bug.cgi?id=2184553 +%global _package_note_status 0 Summary: Mozilla Firefox Web browser Name: firefox -Version: 67.0 -Release: 4%{?pre_tag}%{?dist} +Version: 147.0 +Release: 1%{?pre_tag}%{?dist} URL: https://www.mozilla.org/firefox/ -License: MPLv1.1 or GPLv2+ or LGPLv2+ +# Automatically converted from old format: MPLv1.1 or GPLv2+ or LGPLv2+ - review is highly recommended. +License: LicenseRef-Callaway-MPLv1.1 OR GPL-2.0-or-later OR LicenseRef-Callaway-LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz %if %{with langpacks} -Source1: firefox-langpacks-%{version}%{?pre_version}-20190517.tar.xz +Source1: firefox-langpacks-%{version}%{?pre_version}-20260106.tar.xz %endif Source2: cbindgen-vendor.tar.xz +Source3: dump_syms-vendor.tar.xz +Source4: wasm-component-ld-vendor.tar.xz Source10: firefox-mozconfig Source12: firefox-redhat-default-prefs.js Source20: firefox.desktop @@ -114,62 +219,67 @@ Source21: firefox.sh.in Source23: firefox.1 Source24: mozilla-api-key Source25: firefox-symbolic.svg -Source26: distribution.ini +Source26: distribution.ini.in Source27: google-api-key Source28: firefox-wayland.sh.in Source29: firefox-wayland.desktop Source30: firefox-x11.sh.in Source31: firefox-x11.desktop +Source32: node-stdout-nonblocking-wrapper +Source33: firefox.appdata.xml.in +Source34: org.mozilla.firefox.search-provider.ini +Source35: google-loc-api-key +Source37: mochitest-python.tar.gz +Source38: print_results +Source39: print-errors +Source40: run-tests-x11 +Source41: run-tests-wayland +Source42: psummary +Source43: print_failures +Source44: print-error-reftest +Source45: run-wayland-compositor +Source46: org.mozilla.firefox.SearchProvider.service +Source47: org.mozilla.firefox.desktop +Source48: org.mozilla.firefox.appdata.xml.in +Source49: wasi.patch.template +# Created by: +# git clone --recursive https://github.com/WebAssembly/wasi-sdk.git +# cd wasi-sdk && git-archive-all --force-submodules wasi-sdk-25.tar.gz +Source50: wasi-sdk-25.tar.gz # Build patches -Patch3: mozilla-build-arm.patch -Patch25: rhbz-1219542-s390-build.patch -Patch26: build-icu-big-endian.patch -Patch32: build-rust-ppc64le.patch -Patch35: build-ppc-jit.patch -# Always feel lucky for unsupported platforms: -# https://bugzilla.mozilla.org/show_bug.cgi?id=1347128 -Patch37: build-jit-atomic-always-lucky.patch -# Fixing missing cacheFlush when JS_CODEGEN_NONE is used (s390x) -Patch38: build-cacheFlush-missing.patch Patch40: build-aarch64-skia.patch -Patch41: build-disable-elfhack.patch Patch44: build-arm-libopus.patch +Patch53: firefox-gcc-build.patch +Patch71: 0001-GLIBCXX-fix-for-GCC-12.patch +Patch78: firefox-i686-build.patch +Patch79: firefox-gcc-13-build.patch +Patch80: wasi.patch +Patch81: firefox-gcc-15.0-s390.patch +Patch82: build-c11-threads-avail.patch +Patch83: build-seccomp.patch + # Fedora specific patches Patch215: firefox-enable-addons.patch Patch219: rhbz-1173156.patch -Patch221: firefox-fedora-ua.patch -Patch224: mozilla-1170092.patch #ARM run-time patch Patch226: rhbz-1354671.patch -Patch227: firefox-locale-debug.patch +Patch228: disable-openh264-download.patch +Patch229: firefox-nss-addon-hack.patch +Patch231: fedora-customization.patch +Patch241: 0025-Add-KDE-integration-to-Firefox-toolkit-parts.patch +Patch242: 0026-Add-KDE-integration-to-Firefox.patch # Upstream patches -Patch402: mozilla-1196777.patch -Patch412: mozilla-1337988.patch -Patch413: mozilla-1353817.patch -Patch415: Bug-1238661---fix-mozillaSignalTrampoline-to-work-.patch -Patch417: bug1375074-save-restore-x28.patch -Patch418: mozilla-1526243.patch -Patch419: mozilla-1540145.patch - -# Wayland specific upstream patches -Patch574: firefox-pipewire.patch -Patch575: mozilla-1423598-popup.patch -Patch576: mozilla-1532643-popup.patch -Patch577: mozilla-1535567.patch -Patch579: mozilla-1468911.patch -Patch580: mozilla-1539471.patch -Patch581: mozilla-1517205.patch -Patch582: mozilla-1508378.patch -Patch583: mozilla-1467127.patch -Patch584: mozilla-1552590.patch +Patch400: mozilla-1196777.patch +Patch401: mozilla-1667096.patch # PGO/LTO patches Patch600: pgo.patch -Patch601: mozilla-1516081.patch Patch602: mozilla-1516803.patch +Patch603: firefox-gcc-always-inline.patch + %if %{?system_nss} BuildRequires: pkgconfig(nspr) >= %{nspr_version} @@ -180,12 +290,13 @@ BuildRequires: pkgconfig(libpng) %if %{?system_jpeg} BuildRequires: libjpeg-devel %endif +%if %{?system_pixman} +BuildRequires: pixman-devel +%endif BuildRequires: zip BuildRequires: bzip2-devel BuildRequires: pkgconfig(zlib) -BuildRequires: pkgconfig(libIDL-2.0) BuildRequires: pkgconfig(gtk+-3.0) -BuildRequires: pkgconfig(gtk+-2.0) BuildRequires: pkgconfig(krb5) BuildRequires: pkgconfig(pango) BuildRequires: pkgconfig(freetype2) >= %{freetype_version} @@ -195,60 +306,78 @@ BuildRequires: pkgconfig(libstartup-notification-1.0) BuildRequires: pkgconfig(libnotify) >= %{libnotify_version} BuildRequires: pkgconfig(dri) BuildRequires: pkgconfig(libcurl) +BuildRequires: pkgconfig(alsa) BuildRequires: dbus-glib-devel +%if %{?system_av1} +BuildRequires: pkgconfig(aom) >= %{aom_version} +BuildRequires: pkgconfig(dav1d) >= %{dav1d_version} +%endif %if %{?system_libvpx} BuildRequires: libvpx-devel >= %{libvpx_version} %endif +%if %{?system_webp} +BuildRequires: pkgconfig(libwebp) >= %{libwebp_version} +BuildRequires: pkgconfig(libwebpdemux) >= %{libwebp_version} +%endif BuildRequires: autoconf213 BuildRequires: pkgconfig(libpulse) -BuildRequires: pkgconfig(gconf-2.0) -BuildRequires: yasm BuildRequires: llvm BuildRequires: llvm-devel BuildRequires: clang BuildRequires: clang-libs -%if 0%{?build_with_clang} +%if %{with build_with_clang} || %{with wasi_sdk} BuildRequires: lld %endif -%if 0%{?fedora} > 28 + +%if %{?system_drm} +BuildRequires: libdrm-devel +%endif + +%if %{?system_gbm} +BuildRequires: mesa-libgbm-devel +%endif + +%if %{?system_pipewire} BuildRequires: pipewire-devel %endif + %if !0%{?use_bundled_cbindgen} BuildRequires: cbindgen %endif BuildRequires: nodejs BuildRequires: nasm >= 1.13 +BuildRequires: libappstream-glib + +%if 0%{?big_endian} +BuildRequires: icu +%endif Requires: mozilla-filesystem +Requires: (mozilla-openh264 >= 2.1.1 if openh264) +%if %{with langpacks_subpkg} +Recommends: firefox-langpacks = %{version}-%{release} +%else +Obsoletes: firefox-langpacks < %{version}-%{release} +%endif +Recommends: ffmpeg-free +Recommends: libva Requires: p11-kit-trust +Requires: pciutils-libs %if %{?system_nss} Requires: nspr >= %{nspr_build_version} Requires: nss >= %{nss_build_version} %endif -BuildRequires: python2-devel +%if %{?system_libevent} +BuildRequires: pkgconfig(libevent) +%endif +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3.11-devel %if !0%{?flatpak} Requires: u2f-hidraw-policy %endif - -%if 0%{?fedora} > 25 -# For early testing of rhbz#1400293 mozbz#1324096 on F26 and Rawhide, -# temporarily require the specific NSS build with the backports. -# Can be removed after firefox is changed to require NSS 3.30. -BuildRequires: nss-devel >= 3.29.1-2.1 -Requires: nss >= 3.29.1-2.1 -%endif - -%if 0%{?fedora} < 26 -# Using Conflicts for p11-kit, not Requires, because on multi-arch -# systems p11-kit isn't yet available for secondary arches like -# p11-kit.i686 (fallback to libnssckbi.so from NSS). -# This build contains backports from p11-kit 0.23.4 -Conflicts: p11-kit < 0.23.2-3 -# Requires build with CKA_NSS_MOZILLA_CA_POLICY attribute -Requires: ca-certificates >= 2017.2.11-1.1 -# Requires NSS build with backports from NSS 3.30 -BuildRequires: nss-devel >= 3.29.3-1.1 -Requires: nss >= 3.29.3-1.1 +%if %{?use_xdg_file_portal} +Requires: xdg-desktop-portal %endif BuildRequires: desktop-file-utils @@ -265,21 +394,116 @@ BuildRequires: xorg-x11-server-Xvfb BuildRequires: rust BuildRequires: cargo BuildRequires: clang-devel +%if %{build_with_asan} +BuildRequires: libasan +BuildRequires: libasan-static +%endif +BuildRequires: perl-interpreter +BuildRequires: fdk-aac-free-devel +%if 0%{?launch_wayland_compositor} +BuildRequires: mutter +BuildRequires: gsettings-desktop-schemas +BuildRequires: gnome-settings-daemon +BuildRequires: mesa-dri-drivers +BuildRequires: xorg-x11-server-Xwayland +BuildRequires: dbus-x11 +BuildRequires: gnome-keyring +%endif +%if 0%{?run_firefox_tests} +BuildRequires: procps-ng +BuildRequires: nss-tools +BuildRequires: python2.7 +BuildRequires: dejavu-sans-mono-fonts +BuildRequires: dejavu-sans-fonts +BuildRequires: dejavu-serif-fonts +BuildRequires: dbus-x11 +BuildRequires: gnome-keyring +BuildRequires: mesa-dri-drivers +# ---------------------------------------- +BuildRequires: liberation-fonts-common +BuildRequires: liberation-mono-fonts +BuildRequires: liberation-sans-fonts +BuildRequires: liberation-serif-fonts +# ---------------------------------- +BuildRequires: google-carlito-fonts +BuildRequires: google-droid-sans-fonts +BuildRequires: google-noto-fonts-common +BuildRequires: google-noto-cjk-fonts-common +BuildRequires: google-noto-sans-cjk-ttc-fonts +BuildRequires: google-noto-sans-gurmukhi-fonts +BuildRequires: google-noto-sans-fonts +BuildRequires: google-noto-emoji-color-fonts +BuildRequires: google-noto-sans-sinhala-vf-fonts +# ----------------------------------- +BuildRequires: thai-scalable-fonts-common +BuildRequires: thai-scalable-waree-fonts +BuildRequires: khmeros-base-fonts +BuildRequires: jomolhari-fonts +# ---------------------------------- +BuildRequires: lohit-tamil-fonts +BuildRequires: lohit-telugu-fonts +# ---------------------------------- +BuildRequires: paktype-naskh-basic-fonts +BuildRequires: pt-sans-fonts +BuildRequires: smc-meera-fonts +BuildRequires: stix-fonts +BuildRequires: abattis-cantarell-fonts +BuildRequires: xorg-x11-fonts-ISO8859-1-100dpi +BuildRequires: xorg-x11-fonts-misc +%endif +BuildRequires: make +BuildRequires: pciutils-libs +BuildRequires: mesa-libgbm-devel +BuildRequires: libproxy-devel +# Required for --enable-replace-malloc +%if %{enable_replace_malloc} +BuildRequires: libstdc++-static +%endif +%if %{with wasi_sdk} +BuildRequires: clang cmake ninja-build +%endif +Recommends: speech-dispatcher +Recommends: speech-dispatcher-utils + +%if %{with build_with_clang} +BuildRequires: compiler-rt +%endif Obsoletes: mozilla <= 37:1.7.13 Provides: webclient +# Don't ship firefox-x11 and firefox-wayland on Fedora 40. +# Wayland backend is considered as mature enough now. +# We need to use v-r in Obsoletes because new versions of this +# package keep being built in older releases, and we want to +# obsolete all of them when the user updates to F40+. +%if 0%{?fedora} >= 40 +Obsoletes: firefox-wayland < %{version}-%{release} +Obsoletes: firefox-x11 < %{version}-%{release} +%endif + %description Mozilla Firefox is an open-source web browser, designed for standards compliance, performance and portability. +%if %{with langpacks_subpkg} +%package langpacks +Summary: Firefox langpacks +Requires: %{name} = %{version}-%{release} +%description langpacks +The firefox-langpacks package contains all the localization +and translations langpack add-ons. +%files langpacks -f %{name}.lang +%dir %{langpackdir} +%endif + %if %{enable_mozilla_crashreporter} %global moz_debug_prefix %{_prefix}/lib/debug %global moz_debug_dir %{moz_debug_prefix}%{mozappdir} %global uname_m %(uname -m) %global symbols_file_name %{name}-%{version}.en-US.%{_os}-%{uname_m}.crashreporter-symbols.zip %global symbols_file_path %{moz_debug_dir}/%{symbols_file_name} -%global _find_debuginfo_opts -p %{symbols_file_path} -o debugcrashreporter.list +%global _find_debuginfo_opts %{limit_build -m 32768} -p %{symbols_file_path} -o debugcrashreporter.list %global crashreporter_pkg_name mozilla-crashreporter-%{name}-debuginfo %package -n %{crashreporter_pkg_name} Summary: Debugging symbols used by Mozilla's crash reporter servers @@ -288,113 +512,109 @@ This package provides debug information for Firefox, for use by Mozilla's crash reporter servers. If you are trying to locally debug %{name}, you want to install %{name}-debuginfo instead. %files -n %{crashreporter_pkg_name} -f debugcrashreporter.list +%else +%global _find_debuginfo_opts %{limit_build -m 32768} %endif -%if 0%{?wayland_backend_default} +%if 0%{?fedora} < 40 %package x11 Summary: Firefox X11 launcher. Requires: %{name} %description x11 The firefox-x11 package contains launcher and desktop file -to run Firefox natively on X11. +to run Firefox explicitly on X11. %files x11 %{_bindir}/firefox-x11 %{_datadir}/applications/firefox-x11.desktop -%else + %package wayland Summary: Firefox Wayland launcher. Requires: %{name} %description wayland The firefox-wayland package contains launcher and desktop file -to run Firefox natively on Wayland. +to run Firefox explicitly on Wayland. %files wayland %{_bindir}/firefox-wayland %{_datadir}/applications/firefox-wayland.desktop %endif - -%if %{run_tests} -%global testsuite_pkg_name mozilla-%{name}-testresults +%if 0%{?run_firefox_tests} +%global testsuite_pkg_name %{name}-testresults %package -n %{testsuite_pkg_name} Summary: Results of testsuite %description -n %{testsuite_pkg_name} This package contains results of tests executed during build. %files -n %{testsuite_pkg_name} -/test_results +/%{version}-%{release}/test_results +/%{version}-%{release}/test_summary.txt +/%{version}-%{release}/failures-* %endif #--------------------------------------------------------------------- %prep %setup -q -n %{tarballdir} +%if %{with wasi_sdk} +%setup -q -T -D -a 50 +%endif # Build patches, can't change backup suffix from default because during build # there is a compare of config and js/config directories and .orig suffix is # ignored during this compare. +%patch -P40 -p1 -b .aarch64-skia +%patch -P44 -p1 -b .build-arm-libopus +%patch -P53 -p1 -b .firefox-gcc-build +%patch -P71 -p1 -b .0001-GLIBCXX-fix-for-GCC-12 +%patch -P78 -p1 -b .firefox-i686 +%patch -P79 -p1 -b .firefox-gcc-13-build +%patch -P81 -p1 -b .firefox-gcc-15.0-s390 +%if 0%{?fedora} >= 44 +%patch -P82 -p1 -b .build-c11-threads-avail +%patch -P83 -p1 -b .build-seccomp +%endif -%ifarch s390 -%patch25 -p1 -b .rhbz-1219542-s390 +# We need to create the wasi.patch with the correct path to the wasm libclang_rt. +%if %{with wasi_sdk} +cat %{SOURCE49} | sed -e "s|LIBCLANG_RT_PLACEHOLDER|`pwd`/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a|" > %{_sourcedir}/wasi.patch +%patch -P80 -p1 -b .wasi %endif -#%patch37 -p1 -b .jit-atomic-lucky -# TODO Fix later -#%patch40 -p1 -b .aarch64-skia -%if 0%{?disable_elfhack} -%patch41 -p1 -b .disable-elfhack -%endif -%patch3 -p1 -b .arm -%patch44 -p1 -b .build-arm-libopus # Fedora patches -%patch215 -p1 -b .addons -%patch219 -p1 -b .rhbz-1173156 -%patch221 -p1 -b .fedora-ua -%patch224 -p1 -b .1170092 +%patch -P215 -p1 -b .addons +%patch -P219 -p1 -b .rhbz-1173156 #ARM run-time patch %ifarch aarch64 -%patch226 -p1 -b .1354671 +%patch -P226 -p1 -b .1354671 %endif -%patch227 -p1 -b .locale-debug +%patch -P228 -p1 -b .disable-openh264-download +%patch -P229 -p1 -b .firefox-nss-addon-hack +%patch -P231 -p1 -b .fedora-customization -%patch402 -p1 -b .1196777 -%patch413 -p1 -b .1353817 -%ifarch %{arm} -%patch415 -p1 -b .1238661 -%endif -# Patch for big endian platforms only -%if 0%{?big_endian} -%patch26 -p1 -b .icu -%endif -%patch418 -p1 -b .mozilla-1526243 -%patch419 -p1 -b .mozilla-1540145 - -# Wayland specific upstream patches -%if 0%{?fedora} > 28 -%patch574 -p1 -b .firefox-pipewire -%endif -%patch575 -p1 -b .mozilla-1423598-popup -%patch576 -p1 -b .mozilla-1532643-popup -%patch577 -p1 -b .mozilla-1535567 -%patch579 -p1 -b .mozilla-1468911 -%patch580 -p1 -b .mozilla-1539471 -%patch581 -p1 -b .mozilla-1517205 -%patch582 -p1 -b .mozilla-1508378 -#%patch583 -p1 -b .mozilla-1467127 -#%patch584 -p1 -b .mozilla-1552590 +%patch -P400 -p1 -b .1196777 +%patch -P401 -p1 -b .1667096 # PGO patches -%patch600 -p1 -b .pgo -%patch601 -p1 -b .1516081 -%patch602 -p1 -b .1516803 +%if %{build_with_pgo} +%if !%{with build_with_clang} +%patch -P600 -p1 -b .pgo +%patch -P602 -p1 -b .1516803 +%endif +%endif +%patch -P603 -p1 -b .inline -%{__rm} -f .mozconfig -%{__cp} %{SOURCE10} .mozconfig +rm -f .mozconfig +cp %{SOURCE10} .mozconfig echo "ac_add_options --enable-default-toolkit=cairo-gtk3-wayland" >> .mozconfig %if %{official_branding} echo "ac_add_options --enable-official-branding" >> .mozconfig %endif -%{__cp} %{SOURCE24} mozilla-api-key -%{__cp} %{SOURCE27} google-api-key +cp %{SOURCE24} mozilla-api-key +cp %{SOURCE27} google-api-key +cp %{SOURCE35} google-loc-api-key + +echo "ac_add_options --prefix=\"%{_prefix}\"" >> .mozconfig +echo "ac_add_options --libdir=\"%{_libdir}\"" >> .mozconfig %if %{?system_nss} echo "ac_add_options --with-system-nspr" >> .mozconfig @@ -404,25 +624,26 @@ echo "ac_add_options --without-system-nspr" >> .mozconfig echo "ac_add_options --without-system-nss" >> .mozconfig %endif +%if %{?system_libevent} +echo "ac_add_options --with-system-libevent" >> .mozconfig +%endif + %if %{?system_ffi} echo "ac_add_options --enable-system-ffi" >> .mozconfig %endif -%ifarch %{arm} +%ifarch aarch64 echo "ac_add_options --disable-elf-hack" >> .mozconfig %endif +%ifarch ppc64le +echo "ac_add_options --disable-webrtc" >> .mozconfig +%endif %if %{?debug_build} echo "ac_add_options --enable-debug" >> .mozconfig echo "ac_add_options --disable-optimize" >> .mozconfig %else %global optimize_flags "none" -%ifarch armv7hl -# ARMv7 needs that (rhbz#1426850) -%global optimize_flags "-g -O2 -fno-schedule-insns" -# Disable libaom due to rhbz#1641623 -echo "ac_add_options --disable-av1" >> .mozconfig -%endif %ifarch ppc64le aarch64 %global optimize_flags "-g -O2" %endif @@ -439,16 +660,14 @@ echo "ac_add_options --disable-debug" >> .mozconfig echo "ac_add_options --disable-jemalloc" >> .mozconfig %endif -%ifnarch %{ix86} x86_64 -echo "ac_add_options --disable-webrtc" >> .mozconfig -%endif - %if !%{enable_mozilla_crashreporter} echo "ac_add_options --disable-crashreporter" >> .mozconfig %endif %if 0%{?build_tests} echo "ac_add_options --enable-tests" >> .mozconfig +%else +echo "ac_add_options --disable-tests" >> .mozconfig %endif %if !%{?system_jpeg} @@ -457,289 +676,368 @@ echo "ac_add_options --without-system-jpeg" >> .mozconfig echo "ac_add_options --with-system-jpeg" >> .mozconfig %endif +%if %{?system_pixman} +echo "ac_add_options --enable-system-pixman" >> .mozconfig +%endif + +%if %{?system_av1} +#echo "ac_add_options --with-system-av1" >> .mozconfig +%else +#echo "ac_add_options --without-system-av1" >> .mozconfig +%endif + %if %{?system_libvpx} echo "ac_add_options --with-system-libvpx" >> .mozconfig %else echo "ac_add_options --without-system-libvpx" >> .mozconfig %endif -%ifarch s390 s390x -echo "ac_add_options --disable-ion" >> .mozconfig +%if %{?system_webp} +echo "ac_add_options --with-system-webp" >> .mozconfig +%else +echo "ac_add_options --without-system-webp" >> .mozconfig %endif +%if %{?system_drm} +echo "ac_add_options --with-system-libdrm" >> .mozconfig +%else +echo "ac_add_options --without-system-libdrm" >> .mozconfig +%endif + +%if %{?system_gbm} +echo "ac_add_options --with-system-gbm" >> .mozconfig +%else +echo "ac_add_options --without-system-gbm" >> .mozconfig +%endif + +%if %{?system_pipewire} +echo "ac_add_options --with-system-pipewire" >> .mozconfig +%else +echo "ac_add_options --without-system-pipewire" >> .mozconfig +%endif + +%ifarch s390x +echo "ac_add_options --disable-jit" >> .mozconfig +%endif + +%if %{build_with_asan} +echo "ac_add_options --enable-address-sanitizer" >> .mozconfig +echo "ac_add_options --disable-jemalloc" >> .mozconfig +%endif + +# api keys full path +echo "ac_add_options --with-mozilla-api-keyfile=`pwd`/mozilla-api-key" >> .mozconfig +# It seems that the api key we have is for the safe browsing only +echo "ac_add_options --with-google-location-service-api-keyfile=`pwd`/google-loc-api-key" >> .mozconfig +echo "ac_add_options --with-google-safebrowsing-api-keyfile=`pwd`/google-api-key" >> .mozconfig + +# https://bugzilla.redhat.com/show_bug.cgi?id=2239046 +# with clang 17 upstream's detection fails, so let's just tell it +# where to look +echo "ac_add_options --with-libclang-path=`llvm-config --libdir`" >> .mozconfig + +%if %{enable_replace_malloc} +echo "ac_add_options --enable-replace-malloc" >> .mozconfig +%endif + +echo 'export NODEJS="%{_buildrootdir}/bin/node-stdout-nonblocking-wrapper"' >> .mozconfig + # Remove executable bit to make brp-mangle-shebangs happy. chmod -x third_party/rust/itertools/src/lib.rs +chmod a-x third_party/rust/ash/src/extensions/ext/*.rs +chmod a-x third_party/rust/ash/src/extensions/khr/*.rs +chmod a-x third_party/rust/ash/src/extensions/nv/*.rs #--------------------------------------------------------------------- %build -%if 0%{?use_bundled_cbindgen} +# Disable LTO to work around rhbz#1883904 +# Is that already fixed? +%define _lto_cflags %{nil} + +#WASI SDK +%if %{with wasi_sdk} +pushd wasi-sdk-25 mkdir -p my_rust_vendor cd my_rust_vendor -%{__tar} xf %{SOURCE2} -cd - +tar xf %{SOURCE4} mkdir -p .cargo cat > .cargo/config < .cargo/config < .cargo/config < 30 +MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | sed -e 's/-Werror=format-security//') +# More Fedora specific build flags MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -fpermissive" -%endif -%if %{?hardened_build} -MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -fPIC -Wl,-z,relro -Wl,-z,now" -%endif %if %{?debug_build} -MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | %{__sed} -e 's/-O2//') +MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | sed -e 's/-O2//') %endif -%ifarch s390 -MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | %{__sed} -e 's/-g/-g1/') # If MOZ_DEBUG_FLAGS is empty, firefox's build will default it to "-g" which # overrides the -g1 from line above and breaks building on s390/arm # (OOM when linking, rhbz#1238225) +%ifarch %{ix86} ppc64le +MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | sed -e 's/-g/-g0/') +%else +# this reduces backtrace quality substantially, but seems to be needed +# to prevent various OOM conditions during build +# https://bugzilla.redhat.com/show_bug.cgi?id=2241690 +MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | sed -e 's/-g/-g1/') +%endif export MOZ_DEBUG_FLAGS=" " -%endif -%ifarch %{arm} %{ix86} -MOZ_OPT_FLAGS=$(echo "$MOZ_OPT_FLAGS" | %{__sed} -e 's/-g/-g0/') -export MOZ_DEBUG_FLAGS=" " -%endif -%if !0%{?build_with_clang} -%ifarch s390 ppc aarch64 %{ix86} -MOZ_LINK_FLAGS="-Wl,--no-keep-memory -Wl,--reduce-memory-overheads" -%endif -%ifarch %{arm} -MOZ_LINK_FLAGS="-Wl,--no-keep-memory" -echo "ac_add_options --enable-linker=gold" >> .mozconfig +MOZ_LINK_FLAGS="%{build_ldflags}" +%if !%{with build_with_clang} +%ifarch aarch64 %{ix86} ppc64le x86_64 +MOZ_LINK_FLAGS="$MOZ_LINK_FLAGS -Wl,--no-keep-memory" %endif %endif -%ifarch %{arm} %{ix86} +%ifarch %{ix86} s390x ppc64le export RUSTFLAGS="-Cdebuginfo=0" %endif -export CFLAGS=$MOZ_OPT_FLAGS -export CXXFLAGS=$MOZ_OPT_FLAGS -export LDFLAGS=$MOZ_LINK_FLAGS +%if %{build_with_asan} +MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -fsanitize=address -Dxmalloc=myxmalloc" +MOZ_LINK_FLAGS="$MOZ_LINK_FLAGS -fsanitize=address -ldl" +%endif -export PREFIX='%{_prefix}' -export LIBDIR='%{_libdir}' +# We don't wantfirefox to use CK_GCM_PARAMS_V3 in nss +MOZ_OPT_FLAGS="$MOZ_OPT_FLAGS -DNSS_PKCS11_3_0_STRICT" -%if 0%{?build_with_clang} -export LLVM_PROFDATA="llvm-profdata" -export AR="llvm-ar" -export NM="llvm-nm" -export RANLIB="llvm-ranlib" +echo "export CFLAGS=\"$MOZ_OPT_FLAGS\"" >> .mozconfig +echo "export CXXFLAGS=\"$MOZ_OPT_FLAGS\"" >> .mozconfig +echo "export LDFLAGS=\"$MOZ_LINK_FLAGS\"" >> .mozconfig + +%if %{with build_with_clang} +echo "export LLVM_PROFDATA=\"llvm-profdata\"" >> .mozconfig +echo "export AR=\"llvm-ar\"" >> .mozconfig +echo "export NM=\"llvm-nm\"" >> .mozconfig +echo "export RANLIB=\"llvm-ranlib\"" >> .mozconfig echo "ac_add_options --enable-linker=lld" >> .mozconfig %else -export CC=gcc -export CXX=g++ -export AR="gcc-ar" -export NM="gcc-nm" -export RANLIB="gcc-ranlib" +echo "export CC=gcc" >> .mozconfig +echo "export CXX=g++" >> .mozconfig +echo "export AR=\"gcc-ar\"" >> .mozconfig +echo "export NM=\"gcc-nm\"" >> .mozconfig +echo "export RANLIB=\"gcc-ranlib\"" >> .mozconfig %endif %if 0%{?build_with_pgo} -echo "ac_add_options MOZ_PGO=1" >> .mozconfig +# PGO build doesn't work with ccache +export CCACHE_DISABLE=1 +export GCOV_PREFIX=`pwd -P`/objdir +export GCOV_PREFIX_STRIP=$(( $(echo `pwd -P`|tr -c -d '/' |wc -c )+2 )) +env | grep GCOV echo "ac_add_options --enable-lto" >> .mozconfig +echo "ac_add_options MOZ_PGO=1" >> .mozconfig %endif -MOZ_SMP_FLAGS=-j1 -# On x86_64 architectures, Mozilla can build up to 4 jobs at once in parallel, -# however builds tend to fail on other arches when building in parallel. -%ifarch %{ix86} -[ -z "$RPM_BUILD_NCPUS" ] && \ - RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`" -[ "$RPM_BUILD_NCPUS" -ge 2 ] && MOZ_SMP_FLAGS=-j2 -%endif -%ifarch x86_64 ppc ppc64 ppc64le aarch64 -[ -z "$RPM_BUILD_NCPUS" ] && \ - RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`" -[ "$RPM_BUILD_NCPUS" -ge 2 ] && MOZ_SMP_FLAGS=-j2 -[ "$RPM_BUILD_NCPUS" -ge 4 ] && MOZ_SMP_FLAGS=-j4 -[ "$RPM_BUILD_NCPUS" -ge 8 ] && MOZ_SMP_FLAGS=-j8 -%endif - -export MOZ_MAKE_FLAGS="$MOZ_SMP_FLAGS" -export MOZ_SERVICES_SYNC="1" -export STRIP=/bin/true -%if 0%{?build_with_pgo} -GDK_BACKEND=x11 xvfb-run ./mach build +%if %{with wasi_sdk} +echo "ac_add_options --with-wasi-sysroot=`pwd`/wasi-sdk-25/build/sysroot/install/share/wasi-sysroot" >> .mozconfig %else -./mach build +echo "ac_add_options --without-sysroot" >> .mozconfig +echo "ac_add_options --without-wasm-sandboxed-libraries" >> .mozconfig %endif -# create debuginfo for crash-stats.mozilla.com -%if %{enable_mozilla_crashreporter} -make -C objdir buildsymbols +# Require 4 GB of RAM per CPU core +%constrain_build -m 4096 +echo "mk_add_options MOZ_MAKE_FLAGS=\"-j%{_smp_build_ncpus}\"" >> .mozconfig + +echo "mk_add_options MOZ_SERVICES_SYNC=1" >> .mozconfig +echo "export STRIP=/bin/true" >> .mozconfig + +%if %{build_with_pgo} +cp %{SOURCE45} . +. ./run-wayland-compositor %endif -%if %{?run_tests} -%if %{?system_nss} -ln -s %{_prefix}/bin/certutil objdir/dist/bin/certutil -ln -s %{_prefix}/bin/pk12util objdir/dist/bin/pk12util +mkdir -p objdir/_virtualenvs/init_py3 +cat > objdir/_virtualenvs/init_py3/pip.conf << EOF +[global] +find-links=`pwd`/mochitest-python +no-index=true +EOF +tar xf %{SOURCE37} -%endif -mkdir test_results -./mach --log-no-times check-spidermonkey &> test_results/check-spidermonkey || true -./mach --log-no-times check-spidermonkey &> test_results/check-spidermonkey-2nd-run || true -./mach --log-no-times cppunittest &> test_results/cppunittest || true -xvfb-run ./mach --log-no-times crashtest &> test_results/crashtest || true -./mach --log-no-times gtest &> test_results/gtest || true -xvfb-run ./mach --log-no-times jetpack-test &> test_results/jetpack-test || true -# not working right now ./mach marionette-test &> test_results/marionette-test || true -xvfb-run ./mach --log-no-times mochitest-a11y &> test_results/mochitest-a11y || true -xvfb-run ./mach --log-no-times mochitest-browser &> test_results/mochitest-browser || true -xvfb-run ./mach --log-no-times mochitest-chrome &> test_results/mochitest-chrome || true -xvfb-run ./mach --log-no-times mochitest-devtools &> test_results/mochitest-devtools || true -xvfb-run ./mach --log-no-times mochitest-plain &> test_results/mochitest-plain || true -xvfb-run ./mach --log-no-times reftest &> test_results/reftest || true -xvfb-run ./mach --log-no-times webapprt-test-chrome &> test_results/webapprt-test-chrome || true -xvfb-run ./mach --log-no-times webapprt-test-content &> test_results/webapprt-test-content || true -./mach --log-no-times webidl-parser-test &> test_results/webidl-parser-test || true -xvfb-run ./mach --log-no-times xpcshell-test &> test_results/xpcshell-test || true -%if %{?system_nss} -rm -f objdir/dist/bin/certutil -rm -f objdir/dist/bin/pk12util +#Use python 3.11 for mach +sed -i -e 's|#!/usr/bin/env python3|#!/usr/bin/env python3.11|' mach + +./mach build -v 2>&1 | cat - || exit 1 + +%if %{build_with_pgo} +kill $MUTTER_PID %endif -%endif #--------------------------------------------------------------------- - %install +# run Firefox test suite +# Do we need it? +# export MACH_NATIVE_PACKAGE_SOURCE=system +%if %{run_firefox_tests} +cp %{SOURCE45} . +. ./run-wayland-compositor + +cp %{SOURCE40} %{SOURCE41} %{SOURCE42} %{SOURCE38} %{SOURCE39} %{SOURCE43} %{SOURCE44} . +mkdir -p test_results +./run-tests-wayland || true +./print_results > test_summary.txt 2>&1 || true +./print_failures || true + +kill $MUTTER_PID +%endif # set up our default bookmarks %if !0%{?flatpak} -%{__cp} -p %{default_bookmarks_file} objdir/dist/bin/browser/chrome/en-US/locale/browser/bookmarks.html +cp -p %{default_bookmarks_file} objdir/dist/bin/browser/chrome/browser/content/browser/default-bookmarks.html %endif # Make sure locale works for langpacks -%{__cat} > objdir/dist/bin/browser/defaults/preferences/firefox-l10n.js << EOF +cat > objdir/dist/bin/browser/defaults/preferences/firefox-l10n.js << EOF pref("general.useragent.locale", "chrome://global/locale/intl.properties"); EOF DESTDIR=%{buildroot} make -C objdir install -%{__mkdir_p} %{buildroot}{%{_libdir},%{_bindir},%{_datadir}/applications} +mkdir -p %{buildroot}{%{_libdir},%{_bindir},%{_datadir}/applications} -desktop-file-install --dir %{buildroot}%{_datadir}/applications %{SOURCE20} -%if 0%{?wayland_backend_default} -desktop-file-install --dir %{buildroot}%{_datadir}/applications %{SOURCE31} +%if %{gnome_shell_search_provider} +# Install Gnome search provider files +mkdir -p %{buildroot}%{_datadir}/gnome-shell/search-providers +cp %{SOURCE34} %{buildroot}%{_datadir}/gnome-shell/search-providers +mkdir -p %{buildroot}%{_datadir}/dbus-1/services +cp %{SOURCE46} %{buildroot}%{_datadir}/dbus-1/services +%endif + +%if 0%{?fedora} >= 40 +desktop-file-install --dir %{buildroot}%{_datadir}/applications %{SOURCE47} %else +# We can't use desktop-file-install as it refuses to install firefox.desktop file. +cp %{SOURCE20} %{buildroot}%{_datadir}/applications +%endif + +%if 0%{?fedora} < 40 +desktop-file-install --dir %{buildroot}%{_datadir}/applications %{SOURCE31} desktop-file-install --dir %{buildroot}%{_datadir}/applications %{SOURCE29} %endif # set up the firefox start script -%if 0%{?wayland_backend_default} -%global wayland_default true +rm -rf %{buildroot}%{_bindir}/firefox +%if 0%{?fedora} < 40 +sed -e 's,/__PREFIX__,%{_prefix},g' -e 's,__APP_NAME__,firefox,g' %{SOURCE21} > %{buildroot}%{_bindir}/firefox %else -%global wayland_default false +sed -e 's,/__PREFIX__,%{_prefix},g' -e 's,__APP_NAME__,org.mozilla.firefox,g' %{SOURCE21} > %{buildroot}%{_bindir}/firefox %endif -%{__rm} -rf %{buildroot}%{_bindir}/firefox -%{__sed} -e 's/__DEFAULT_WAYLAND__/%{wayland_default}/' \ - -e 's,/__PREFIX__,%{_prefix},g' %{SOURCE21} > %{buildroot}%{_bindir}/firefox -%{__chmod} 755 %{buildroot}%{_bindir}/firefox +chmod 755 %{buildroot}%{_bindir}/firefox -%if 0%{?wayland_backend_default} -%{__sed} -e 's,/__PREFIX__,%{_prefix},g' %{SOURCE30} > %{buildroot}%{_bindir}/firefox-x11 -%{__chmod} 755 %{buildroot}%{_bindir}/firefox-x11 +%if 0%{?flatpak} +sed -i -e 's|%FLATPAK_ENV_VARS%|export TMPDIR="$XDG_CACHE_HOME/tmp"|' %{buildroot}%{_bindir}/firefox %else -%{__sed} -e 's,/__PREFIX__,%{_prefix},g' %{SOURCE28} > %{buildroot}%{_bindir}/firefox-wayland -%{__chmod} 755 %{buildroot}%{_bindir}/firefox-wayland +sed -i -e 's|%FLATPAK_ENV_VARS%||' %{buildroot}%{_bindir}/firefox %endif -%{__install} -p -D -m 644 %{SOURCE23} %{buildroot}%{_mandir}/man1/firefox.1 +%if 0%{?fedora} < 40 +sed -e 's,/__PREFIX__,%{_prefix},g' %{SOURCE30} > %{buildroot}%{_bindir}/firefox-x11 +chmod 755 %{buildroot}%{_bindir}/firefox-x11 +sed -e 's,/__PREFIX__,%{_prefix},g' %{SOURCE28} > %{buildroot}%{_bindir}/firefox-wayland +chmod 755 %{buildroot}%{_bindir}/firefox-wayland +%endif -%{__rm} -f %{buildroot}/%{mozappdir}/firefox-config -%{__rm} -f %{buildroot}/%{mozappdir}/update-settings.ini +install -p -D -m 644 %{SOURCE23} %{buildroot}%{_mandir}/man1/firefox.1 + +rm -f %{buildroot}/%{mozappdir}/firefox-config +rm -f %{buildroot}/%{mozappdir}/update-settings.ini +rm -f %{buildroot}/%{mozappdir}/firefox-bin for s in 16 22 24 32 48 256; do - %{__mkdir_p} %{buildroot}%{_datadir}/icons/hicolor/${s}x${s}/apps - %{__cp} -p browser/branding/official/default${s}.png \ - %{buildroot}%{_datadir}/icons/hicolor/${s}x${s}/apps/firefox.png + mkdir -p %{buildroot}%{_datadir}/icons/hicolor/${s}x${s}/apps + cp -p browser/branding/official/default${s}.png \ + %{buildroot}%{_datadir}/icons/hicolor/${s}x${s}/apps/firefox.png done # Install hight contrast icon -%{__mkdir_p} %{buildroot}%{_datadir}/icons/hicolor/symbolic/apps -%{__cp} -p %{SOURCE25} \ - %{buildroot}%{_datadir}/icons/hicolor/symbolic/apps - -# Register as an application to be visible in the software center -# -# NOTE: It would be *awesome* if this file was maintained by the upstream -# project, translated and installed into the right place during `make install`. -# -# See http://www.freedesktop.org/software/appstream/docs/ for more details. -# -mkdir -p %{buildroot}%{_datadir}/appdata -cat > %{buildroot}%{_datadir}/appdata/%{name}.appdata.xml < - - - - firefox.desktop - CC0-1.0 - -

- Bringing together all kinds of awesomeness to make browsing better for you. - Get to your favorite sites quickly – even if you don’t remember the URLs. - Type your term into the location bar (aka the Awesome Bar) and the autocomplete - function will include possible matches from your browsing history, bookmarked - sites and open tabs. -

- -
- http://www.mozilla.org/ - - https://raw.githubusercontent.com/hughsie/fedora-appstream/master/screenshots-extra/firefox/a.png - https://raw.githubusercontent.com/hughsie/fedora-appstream/master/screenshots-extra/firefox/b.png - https://raw.githubusercontent.com/hughsie/fedora-appstream/master/screenshots-extra/firefox/c.png - - -
-EOF +mkdir -p %{buildroot}%{_datadir}/icons/hicolor/symbolic/apps +cp -p %{SOURCE25} \ + %{buildroot}%{_datadir}/icons/hicolor/symbolic/apps echo > %{name}.lang %if %{with langpacks} # Extract langpacks, make any mods needed, repack the langpack, and install it. -%{__mkdir_p} %{buildroot}%{langpackdir} -%{__tar} xf %{SOURCE1} +mkdir -p %{buildroot}%{langpackdir} +tar xf %{SOURCE1} for langpack in `ls firefox-langpacks/*.xpi`; do language=`basename $langpack .xpi` extensionID=langpack-$language@firefox.mozilla.org - %{__mkdir_p} $extensionID + mkdir -p $extensionID unzip -qq $langpack -d $extensionID find $extensionID -type f | xargs chmod 644 @@ -747,7 +1045,7 @@ for langpack in `ls firefox-langpacks/*.xpi`; do zip -qq -r9mX ../${extensionID}.xpi * cd - - %{__install} -m 644 ${extensionID}.xpi %{buildroot}%{langpackdir} + install -m 644 ${extensionID}.xpi %{buildroot}%{langpackdir} language=`echo $language | sed -e 's/-/_/g'` %if 0%{?flatpak} echo "%{langpackdir}/${extensionID}.xpi" >> %{name}.lang @@ -755,7 +1053,7 @@ for langpack in `ls firefox-langpacks/*.xpi`; do echo "%%lang($language) %{langpackdir}/${extensionID}.xpi" >> %{name}.lang %endif done -%{__rm} -rf firefox-langpacks +rm -rf firefox-langpacks # Install langpack workaround (see #707100, #821169) function create_default_langpack() { @@ -769,7 +1067,7 @@ echo "%%lang($language_short) %{langpackdir}/langpack-$language_short@firefox.mo # Table of fallbacks for each language # please file a bug at bugzilla.redhat.com if the assignment is incorrect -create_default_langpack "bn-IN" "bn" +#create_default_langpack "bn-IN" "bn" create_default_langpack "es-AR" "es" create_default_langpack "fy-NL" "fy" create_default_langpack "ga-IE" "ga" @@ -782,53 +1080,85 @@ create_default_langpack "pa-IN" "pa" create_default_langpack "pt-PT" "pt" create_default_langpack "sv-SE" "sv" create_default_langpack "zh-TW" "zh" -%endif # with langpacks +%endif - -%{__mkdir_p} %{buildroot}/%{mozappdir}/browser/defaults/preferences +mkdir -p %{buildroot}/%{mozappdir}/browser/defaults/preferences # System config dir -%{__mkdir_p} %{buildroot}/%{_sysconfdir}/%{name}/pref +mkdir -p %{buildroot}/%{_sysconfdir}/%{name}/pref # System extensions -%{__mkdir_p} %{buildroot}%{_datadir}/mozilla/extensions/%{firefox_app_id} -%{__mkdir_p} %{buildroot}%{_libdir}/mozilla/extensions/%{firefox_app_id} +mkdir -p %{buildroot}%{_datadir}/mozilla/extensions/%{firefox_app_id} +mkdir -p %{buildroot}%{_libdir}/mozilla/extensions/%{firefox_app_id} # Copy over the LICENSE -%{__install} -p -c -m 644 LICENSE %{buildroot}/%{mozappdir} +install -p -c -m 644 LICENSE %{buildroot}/%{mozappdir} # Use the system hunspell dictionaries -%{__rm} -rf %{buildroot}%{mozappdir}/dictionaries -ln -s %{_datadir}/myspell %{buildroot}%{mozappdir}/dictionaries +rm -rf %{buildroot}%{mozappdir}/dictionaries +ln -s %{_datadir}/hunspell %{buildroot}%{mozappdir}/dictionaries # Enable crash reporter for Firefox application %if %{enable_mozilla_crashreporter} +./mach buildsymbols sed -i -e "s/\[Crash Reporter\]/[Crash Reporter]\nEnabled=1/" %{buildroot}/%{mozappdir}/application.ini # Add debuginfo for crash-stats.mozilla.com -%{__mkdir_p} %{buildroot}/%{moz_debug_dir} -%{__cp} objdir/dist/%{symbols_file_name} %{buildroot}/%{moz_debug_dir} +mkdir -p %{buildroot}/%{moz_debug_dir} +cp objdir/dist/%{symbols_file_name} %{buildroot}/%{moz_debug_dir} %endif -%if %{run_tests} -# Add debuginfo for crash-stats.mozilla.com -%{__mkdir_p} %{buildroot}/test_results -%{__cp} test_results/* %{buildroot}/test_results +%if 0%{?run_firefox_tests} +mkdir -p %{buildroot}/%{version}-%{release}/test_results +cp test_results/* %{buildroot}/%{version}-%{release}/test_results +cp test_summary.txt %{buildroot}/%{version}-%{release}/ +cp failures-* %{buildroot}/%{version}-%{release}/ || true %endif # Default -%{__cp} %{SOURCE12} %{buildroot}%{mozappdir}/browser/defaults/preferences +cp %{SOURCE12} %{buildroot}%{mozappdir}/browser/defaults/preferences +%if %{?use_xdg_file_portal} +echo 'pref("widget.use-xdg-desktop-portal.file-picker", 1);' >> %{buildroot}%{mozappdir}/browser/defaults/preferences/firefox-redhat-default-prefs.js +%endif -# Copy over run-mozilla.sh -%{__cp} build/unix/run-mozilla.sh %{buildroot}%{mozappdir} +%if %{?use_pipewire_camera} +echo 'pref("media.webrtc.camera.allow-pipewire", true);' >> %{buildroot}%{mozappdir}/browser/defaults/preferences/firefox-redhat-default-prefs.js +%endif # Add distribution.ini -%{__mkdir_p} %{buildroot}%{mozappdir}/distribution -%{__cp} %{SOURCE26} %{buildroot}%{mozappdir}/distribution +mkdir -p %{buildroot}%{mozappdir}/distribution +sed -e "s/__NAME__/%(source /etc/os-release; echo ${NAME})/" \ + -e "s/__ID__/%(source /etc/os-release; echo ${ID})/" \ + -e "s/rhel/redhat/" \ + -e "s/Fedora.*/Fedora/" \ + %{SOURCE26} > %{buildroot}%{mozappdir}/distribution/distribution.ini + +# Install appdata file +mkdir -p %{buildroot}%{_datadir}/metainfo +%if 0%{?fedora} >= 40 +sed -e "s/__VERSION__/%{version}/" \ + -e "s/__DATE__/$(date '+%F')/" \ + %{SOURCE48} > %{buildroot}%{_datadir}/metainfo/org.mozilla.firefox.appdata.xml +%else +sed -e "s/__VERSION__/%{version}/" \ + -e "s/__DATE__/$(date '+%F')/" \ + %{SOURCE33} > %{buildroot}%{_datadir}/metainfo/firefox.appdata.xml +%endif # Remove copied libraries to speed up build rm -f %{buildroot}%{mozappdirdev}/sdk/lib/libmozjs.so rm -f %{buildroot}%{mozappdirdev}/sdk/lib/libmozalloc.so rm -f %{buildroot}%{mozappdirdev}/sdk/lib/libxul.so + +# Create a symlink to replace libnssckbi.so with p11-kit-client.so +# instead of p11-kit-trust.so, so that Firefox can see the system +# trust store on the host through the p11-kit RPC protocol. A symlink +# to libnss3.so is also needed, because Firefox tries to load +# libnssckbi.so from the same directory where libnss3.so is loaded (as +# of Firefox 89). +%if 0%{?flatpak} +ln -sf /usr/lib64/libnss3.so %{buildroot}%{_libdir}/libnss3.so +ln -sf /usr/lib64/pkcs11/p11-kit-client.so %{buildroot}%{_libdir}/libnssckbi.so +%endif #--------------------------------------------------------------------- # Moves defaults/preferences to browser/defaults/preferences @@ -850,60 +1180,59 @@ if (posix.stat("%{mozappdir}/browser/defaults/preferences", "type") == "link") t end end +%check +appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/*.appdata.xml %preun # is it a final removal? if [ $1 -eq 0 ]; then - %{__rm} -rf %{mozappdir}/components - %{__rm} -rf %{mozappdir}/extensions - %{__rm} -rf %{mozappdir}/plugins - %{__rm} -rf %{langpackdir} + rm -rf %{mozappdir}/components + rm -rf %{mozappdir}/extensions + rm -rf %{mozappdir}/plugins + rm -rf %{langpackdir} fi -%post -update-desktop-database &> /dev/null || : -touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : - -%postun -update-desktop-database &> /dev/null || : -if [ $1 -eq 0 ] ; then - touch --no-create %{_datadir}/icons/hicolor &>/dev/null - gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : -fi - -%posttrans -gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : - +%if %{with langpacks_subpkg} +%files +%else %files -f %{name}.lang +%endif %{_bindir}/firefox %{mozappdir}/firefox -%{mozappdir}/firefox-bin +%{mozappdir}/glxtest %doc %{_mandir}/man1/* %dir %{_sysconfdir}/%{name} %dir %{_sysconfdir}/%{name}/* %dir %{_datadir}/mozilla/extensions/* %dir %{_libdir}/mozilla/extensions/* -%{_datadir}/appdata/*.appdata.xml -%{_datadir}/applications/%{name}.desktop +%if 0%{?fedora} >= 40 +%{_datadir}/applications/org.mozilla.firefox.desktop +%else +%{_datadir}/applications/firefox.desktop +%endif +%if %{gnome_shell_search_provider} +%{_datadir}/dbus-1/services/* +%{_datadir}/gnome-shell/search-providers/*.ini +%endif +%{_datadir}/metainfo/*.appdata.xml %dir %{mozappdir} %license %{mozappdir}/LICENSE -%{mozappdir}/browser/chrome -%{mozappdir}/browser/chrome.manifest -%{mozappdir}/browser/defaults/preferences/firefox-redhat-default-prefs.js -%{mozappdir}/browser/features/*.xpi -%{mozappdir}/distribution/distribution.ini +%{mozappdir}/browser +%{mozappdir}/distribution # That's Windows only %ghost %{mozappdir}/browser/features/aushelper@mozilla.org.xpi -%attr(644, root, root) %{mozappdir}/browser/blocklist.xml +%if %{without langpacks_subpkg} %if %{with langpacks} %dir %{langpackdir} %endif -%{mozappdir}/browser/omni.ja -%{mozappdir}/chrome.manifest -%{mozappdir}/run-mozilla.sh +%endif %{mozappdir}/application.ini %{mozappdir}/pingsender %exclude %{mozappdir}/removed-files +%if 0%{?flatpak} +%{_libdir}/libnss3.so +%{_libdir}/libnssckbi.so +%endif %{_datadir}/icons/hicolor/16x16/apps/firefox.png %{_datadir}/icons/hicolor/22x22/apps/firefox.png %{_datadir}/icons/hicolor/24x24/apps/firefox.png @@ -913,322 +1242,1625 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %{_datadir}/icons/hicolor/symbolic/apps/firefox-symbolic.svg %if %{enable_mozilla_crashreporter} %{mozappdir}/crashreporter -%{mozappdir}/crashreporter.ini -%{mozappdir}/minidump-analyzer -%{mozappdir}/Throbber-small.gif -%{mozappdir}/browser/crashreporter-override.ini +%{mozappdir}/crashhelper %endif %{mozappdir}/*.so -%{mozappdir}/gtk2/*.so %{mozappdir}/defaults/pref/channel-prefs.js %{mozappdir}/dependentlibs.list %{mozappdir}/dictionaries %{mozappdir}/omni.ja %{mozappdir}/platform.ini -%{mozappdir}/plugin-container %{mozappdir}/gmp-clearkey -%{mozappdir}/fonts/TwemojiMozilla.ttf +%{mozappdir}/fonts +%ifarch aarch64 riscv64 +%{mozappdir}/v4l2test +%endif +%{mozappdir}/vaapitest %if !%{?system_nss} -%{mozappdir}/libfreeblpriv3.chk -%{mozappdir}/libnssdbm3.chk -%{mozappdir}/libsoftokn3.chk %exclude %{mozappdir}/libnssckbi.so %endif +%if %{build_with_asan} +%{mozappdir}/llvm-symbolizer +%endif #--------------------------------------------------------------------- %changelog -* Thu May 23 2019 Martin Stransky - 67.0-4 -- Added wayland buffer optimization (mozilla#1553747). +* Tue Jan 06 2026 Martin Stransky - 147.0-1 +- Updated to 147.0 -* Fri May 17 2019 Martin Stransky - 67.0-3 -- Use %lang() in regular builds. -- Updated to 67.0 Build 2 +* Fri Dec 19 2025 Martin Stransky - 146.0.1-1 +- Updated to 146.0.1 -* Thu May 16 2019 Jan Horak - 67.0-2 -- Removed %lang() prefix from langpacks file list due to flatpak +* Wed Dec 17 2025 Martin Stransky - 146.0-6 +- Added upstream patch IWYU (libwebrtc IWYU fixes for PipeWire) +- Claude AI assisted editing (failed to do whole work, but it was close!) -* Wed May 15 2019 Martin Stransky - 67.0-1 -- Updated to 67.0 +* Wed Dec 17 2025 Martin Stransky - 146.0-5 +- Removed firefox-bin from man pages -* Wed May 8 2019 Martin Stransky - 66.0.5-1 -- Updated to 66.0.5 +* Thu Dec 11 2025 Martin Stransky - 146.0-4 +- Removed firefox-bin -* Sun May 5 2019 Martin Stransky - 66.0.4-1 -- Updated to 66.0.4 +* Thu Dec 11 2025 Martin Stransky - 146.0-3 +- Added aarch64 crash fix +- Fixed rawhide gcc build (kudos to jhorak who hacked it! He's just awesome.) -* Thu May 2 2019 Martin Stransky - 66.0.3-2 -- Removed fix for mozbz#526293 as it's broken and does not - bring any new functionality. +* Mon Dec 08 2025 Martin Stransky - 146.0-2 +- Updated to 146.0 build 2 -* Thu Apr 11 2019 Martin Stransky - 66.0.3-1 -- Updated to 66.0.3 (Build 1) +* Wed Dec 03 2025 Martin Stransky - 146.0-1 +- Updated to 146.0 -* Mon Apr 1 2019 Martin Stransky - 66.0.2-1 -- Updated to 66.0.2 (Build 1) -- Added fixes for mozbz#1526243, mozbz#1540145 +* Wed Nov 19 2025 Martin Stransky - 145.0.1-1 +- Updated to 145.0.1 -* Thu Mar 28 2019 Martin Stransky - 66.0.1-4 -- Added fix for mozbz#1539471 - wayland popups/tooltips +* Tue Nov 11 2025 Martin Stransky - 145.0-2 +- Updated to 145.0 B2 -* Wed Mar 27 2019 Martin Stransky - 66.0.1-3 -- Added fix for mozbz#526293 - show remote locations at - file chooser dialog +* Wed Nov 05 2025 Martin Stransky - 145.0-1 +- Updated to 145.0 -* Fri Mar 22 2019 Martin Stransky - 66.0.1-1 -- Updated to 66.0.1 (Build 1) +* Thu Oct 30 2025 Martin Stransky - 144.0.2-1 +- Updated to 144.0.2 -* Thu Mar 21 2019 Martin Stransky - 66.0-10.test -- Test module build, use flatpak global define -- Added fix for F31 (mozbz#1533969) +* Thu Oct 16 2025 Martin Stransky - 144.0-3 +- Add fix for mzbz#1990430 -* Thu Mar 21 2019 Martin Stransky - 66.0-9 -- Release build +* Mon Oct 13 2025 Martin Stransky - 144.0-2 +- Updated to 144.0 (b2) -* Thu Mar 21 2019 Martin Stransky - 66.0-8.test -- Added module specific build config -- Fixed mozbz#1423598 for multi-monitor setup +* Thu Oct 09 2025 Martin Stransky - 144.0-1 +- Updated to 144.0 -* Wed Mar 20 2019 Martin Stransky - 66.0-7.test -- Switched to test builds -- Updated mozbz#1468911 patch +* Mon Oct 06 2025 Martin Stransky - 143.0.4-1 +- Updated to 143.0.4 -* Mon Mar 18 2019 Martin Stransky - 66.0-6 -- Build release candidate -- Disabled default Wayland backend for Fedora 30 +* Tue Sep 30 2025 Martin Stransky - 143.0.3-1 +- Updated to 143.0.3 -* Mon Mar 18 2019 Martin Stransky - 66.0-5 -- Added fix for mozbz#1468911 +* Fri Sep 26 2025 Martin Stransky - 143.0.1-3 +- Added fix for mzbz#1990162 -* Mon Mar 18 2019 Martin Stransky - 66.0-4 -- Release build +* Thu Sep 25 2025 Martin Stransky - 143.0.1-2 +- Added fix for mzbz#1984368 -* Fri Mar 15 2019 Martin Stransky - 66.0-3 -- Updated to 66.0 (Build 3) -- Re-enable s390x arches -- Fixed Wayland specific bugs mozbz#1535567, mozbz#1431399 +* Fri Sep 19 2025 Martin Stransky - 143.0.1-1 +- Updated to 143.0.1 -* Tue Mar 12 2019 Martin Stransky - 66.0-1 -- Updated to 66.0 (Build 1) +* Wed Sep 10 2025 Martin Stransky - 143.0-1 +- Updated to 143.0 -* Fri Mar 1 2019 Martin Stransky - 65.0.2-1 -- Updated to 65.0.2 -- Disabled PGO+LTO for Fedora 30 -- Disabled Mozilla Crashreporter to get Wayland crashes by ABRT -- Disabled s390x builds due to - https://pagure.io/fedora-infrastructure/issue/7581 +* Wed Aug 27 2025 Martin Stransky - 142.0.1-1 +- Updated to 142.0.1 +* Mon Aug 25 2025 Tom Stellard - 142.0-3 +- Fix build with llvm-21 -* Thu Feb 28 2019 Martin Stransky - 65.0.1-2 -- Enable ARBT for Fedora 29 and later to catch wayland crashes. -- Disable system libvpx for Fedora 30 and later. +* Sat Aug 23 2025 Dominik Mierzejewski - 142.0-2 +- Drop unused yasm build dependency, part of: + https://fedoraproject.org/wiki/Changes/DeprecateYASM -* Wed Feb 20 2019 Martin Stransky - 65.0.1-1 -- Disabled s390x/f28 builds due to - https://pagure.io/fedora-infrastructure/issue/7581 +* Tue Aug 12 2025 Martin Stransky - 142.0-1 +- Updated to 142.0 -* Fri Feb 15 2019 Jan Horak - 65.0.1-1 -- Update to 65.0.1 +* Mon Aug 11 2025 Martin Stransky - 141.0.3-1 +- Updated to 141.0.3 -* Mon Feb 4 2019 Martin Stransky - 65.0-4 -- Added fix for mozbz#1522780 +* Wed Aug 6 2025 Martin Stransky - 141.0.2-1 +- Updated to 141.0.2 -* Thu Jan 31 2019 Fedora Release Engineering - 65.0-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild +* Wed Jul 23 2025 Fedora Release Engineering - 141.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild -* Thu Jan 31 2019 Jan Grulich - 65.0-2 -- Re-enable PipeWire support +* Fri Jul 18 2025 Martin Stransky - 141.0-2 +- Respin 141.0 build 2 -* Mon Jan 28 2019 Martin Stransky - 65.0-1 -- Update to 65.0 build 2 +* Thu Jul 17 2025 Martin Stransky - 141.0-1 +- Update to latest upstream (141.0) -* Wed Jan 16 2019 Martin Stransky - 64.0.2-2 +* Wed Jul 09 2025 Martin Stransky - 140.0.4-1 +- Update to latest upstream (140.0.4) + +* Fri Jun 27 2025 Martin Stransky - 140.0.1-1 +- Update to latest upstream (140.0.1) + +* Tue Jun 17 2025 Martin Stransky - 140.0-1 +- Update to latest upstream (140.0) + +* Wed Jun 11 2025 Martin Stransky - 139.0.4-2 +- Use headless Mutter to run PGO builds + +* Wed Jun 11 2025 Martin Stransky - 139.0.4-1 +- Updated to latest upstream (139.0.4) + +* Fri Jun 6 2025 Martin Stransky - 139.0-3 +- Updated desktop file translation (rhbz#2362155) + +* Fri May 30 2025 Jan Grulich - 139.0-2 +- Use system libraries for drm/gbm/pipewire + +* Tue May 27 2025 Martin Stransky - 139.0-1 +- Updated to 139.0 + +* Mon May 19 2025 Martin Stransky - 138.0.4-1 +- Updated to 138.0.4 + +* Wed May 14 2025 Martin Stransky - 138.0.3-2 +- Fixed rhbz#2283790 + +* Mon May 12 2025 Martin Stransky - 138.0.3-1 +- Updated to 138.0.3 + +* Thu May 1 2025 Martin Stransky - 138.0.1-1 +- Updated to 138.0.1 + +* Sat Apr 26 2025 Bojan Smojver - 138.0-1 +- Add fix for mzbz#1957628 +- Remove browser/features/*.xpi files, no longer shipped + +* Tue Apr 22 2025 Martin Stransky - 138.0-1 +- Updated to 138.0 + +* Tue Apr 22 2025 Martin Stransky - 137.0.2-3 +- Added fix for rhbz#2358565 + +* Wed Apr 16 2025 Martin Stransky - 137.0.2-2 +- Added fix for mzbz#1951249 + +* Wed Apr 16 2025 Martin Stransky - 137.0.2-1 +- Update 137.0.2 + +* Mon Apr 14 2025 Martin Stransky - 137.0.1-1 +- Update 137.0.1 + +* Mon Mar 31 2025 Martin Stransky - 137.0-2 +- Update 137.0 build 2 + +* Wed Mar 26 2025 Martin Stransky - 137.0-1 +- Update to latest upstream (137.0) + +* Tue Mar 25 2025 Martin Stransky - 136.0.3-1 +- Revert rhbz#2353895 as it looks broken +- Update to latest upstream (136.0.3) + +* Mon Mar 24 2025 Martin Stransky - 136.0.2-2 +- Stop overriding user settings on every update (rhbz#2353895) +- Remove browser.display.use_system_colors override (rhbz#2353953) + +* Wed Mar 19 2025 Martin Stransky - 136.0.2-1 +- Updated to 136.0.2 + +* Wed Mar 12 2025 Martin Stransky - 136.0.1-1 +- Updated to 136.0.1 + +* Fri Feb 28 2025 Martin Stransky - 136.0-2 +- Updated to 136.0 Build 3 + +* Tue Feb 25 2025 Martin Stransky - 136.0-1 +- Updated to 136.0 + +* Wed Feb 19 2025 Martin Stransky - 135.0.1-1 +- Updated to 135.0.1 + +* Tue Feb 04 2025 Martin Stransky - 135.0-1 +- Updated to 135.0 + +* Tue Jan 28 2025 Martin Stransky - 134.0.2-2 +- Call restorecon for widevine only (rhbz#2342243) + +* Wed Jan 22 2025 Martin Stransky - 134.0.2-1 +- Updated to 134.0.2 + +* Wed Jan 15 2025 Martin Stransky - 134.0.1-1 +- Updated to 134.0.1 + +* Thu Jan 02 2025 Martin Stransky - 134.0-1 +- Updated to 134.0 + +* Mon Dec 16 2024 Martin Stransky - 133.0.3-2 +- Remove MOZ_DBUS_APP_NAME from launch script as it breaks Thunderbird (rhbz#2320090) + +* Wed Dec 11 2024 Martin Stransky - 133.0.3-1 +- Updated to 133.0.3 + +* Sat Nov 30 2024 Martin Stransky - 133.0-2 +- Add fix for mzbz#1934217 + +* Fri Nov 22 2024 Martin Stransky - 133.0-1 +- Updated to latest upstream (133.0) + +* Mon Nov 18 2024 Martin Stransky - 132.0.2-2 +- Added memory saving flags to x86_64 + +* Fri Nov 15 2024 Martin Stransky - 132.0.2-1 +- Updated to 132.0.2 +- Try to reduce build mem usage on ppc64le + +* Thu Nov 07 2024 Jan Grulich - 132.0.1-2 +- PipeWire camera: use better unique device name for camera devices + +* Tue Nov 05 2024 Martin Stransky - 132.0.1-1 +- Updated to 132.0.1 + +* Fri Oct 25 2024 Martin Stransky - 132.0-2 +- Enabled PGO + +* Wed Oct 23 2024 Martin Stransky - 132.0-1 +- Updated to 132.0 + +* Mon Oct 21 2024 Martin Stransky - 131.0.3-3 +- Backported hi-res mouse scrolling and + hold touchpad gesture support for Fedora 41 + +* Tue Oct 15 2024 Martin Stransky - 131.0.3-1 +- Updated to 131.0.3 + +* Wed Oct 09 2024 Martin Stransky - 131.0.2-1 +- Updated to 131.0.2 + +* Mon Sep 30 2024 Martin Stransky - 131.0-2 +- Fix regression from mzbz#1634961 - enable Gnome Shell search in opened tabs +- Temporary disabled PGO due to build issues. + +* Wed Sep 25 2024 Martin Stransky - 131.0-1 +- Added fix for mzbz#1634961 - enable Gnome Shell search in opened tabs +- Updated to 131.0 + +* Mon Sep 23 2024 Jan Grulich - 130.0.1-3 +- Fix PipeWire camera support enablement for F41+ +- Additional WebRTC backports for PipeWire camera support + +* Fri Sep 20 2024 Songsong Zhang - 130.0.1-2 +- Add v4l2test file for RISC-V + +* Wed Sep 18 2024 Martin Stransky - 130.0.1-1 +- Updated to 130.0.1 + +* Sun Sep 08 2024 Jan Grulich - 130.0-5 +- PipeWire camera support: backport set of upstream patches + +* Fri Sep 6 2024 Martin Stransky - 130.0-4 +- Added fix for mzbz#1916038 + +* Thu Sep 5 2024 Martin Stransky - 130.0-3 +- Downgrade libyuv to fix AVIF image rendering + +* Fri Aug 30 2024 Martin Stransky - 130.0-2 +- Updated to 130.0 build 2 + +* Wed Aug 28 2024 Martin Stransky - 130.0-1 +- Update to 130.0 + +* Wed Aug 28 2024 Miroslav Suchý - 129.0.2-2 +- convert license to SPDX + +* Tue Aug 20 2024 Martin Stransky - 129.0.2-1 +- Update to 129.0.2 + +* Mon Aug 19 2024 Jan Grulich - 129.0-4 +- WebRTC backport: Filter out camera devices with no capabilities + +* Thu Aug 15 2024 Michael Catanzaro - 129.0-3 +- Add conditional hard dependency on mozilla-openh264, always required if openh264 is installed + +* Tue Aug 13 2024 Jan Grulich - 129.0-2 +- Enable PipeWire camera support for F41+ + +* Tue Jul 30 2024 Martin Stransky - 129.0-1 +- Update to 129.0 + +* Mon Jul 29 2024 Martin Stransky - 128.0.3-1 +- Update to 128.0.3 + +* Wed Jul 17 2024 Fedora Release Engineering - 128.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Fri Jul 12 2024 Martin Stransky - 128.0-2 +- Added fix for mzbz#1907511 + +* Tue Jul 2 2024 Martin Stransky - 128.0-1 +- Update to 128.0 + +* Tue Jul 2 2024 Martin Stransky - 127.0.2-2 +- Allow to override MOZ_DBUS_APP_NAME + +* Tue Jun 25 2024 Martin Stransky - 127.0.2-1 +- Update to 127.0.2 + +* Fri Jun 14 2024 Jan Grulich - 127.0-2 +- Fix duplicated camera entries with PipeWire + +* Mon Jun 10 2024 Jan Horak - 127.0-1 +- Update to 127.0 + +* Tue May 21 2024 Jan Horak - 126.0-8 +- Enabled crashreporter again + +* Mon May 20 2024 Martin Stransky - 126.0-7 +- Gnome search service tweak + +* Wed May 15 2024 Martin Stransky - 126.0-6 +- Added fix for mzbz#1896846 + +* Tue May 14 2024 Martin Stransky - 126.0-5 +- Updated upstream patches + +* Mon May 13 2024 Martin Stransky - 126.0-4 - Rebuild -* Thu Jan 10 2019 Jan Horak - 64.0.2-1 -- Update to 64.0.2 +* Mon May 13 2024 Martin Stransky - 126.0-3 +- More upstream patches for Gnome search provider. -* Mon Jan 7 2019 Jan Horak - 64.0-7 -- Pipewire patch rebased (thanks to Tomas Popela) -- Enabled PGO on some arches. +* Fri May 10 2024 Martin Stransky - 126.0-2 +- Fix Gnome search provider for Fedora 40+ -* Fri Jan 4 2019 Carmen Bianca Bakker - 64.0-6 -- Changed locale detector to handle Esperanto (rhbz#1656900) +* Fri May 10 2024 Jan Grulich - 126.0-1 +- Backport WebRTC fix for screen cast glitches in KDE -* Fri Dec 21 2018 Martin Stransky - 64.0-5 -- Test PGO build. +* Thu May 9 2024 Martin Stransky - 126.0-1 +- Updated to 126.0 -* Wed Dec 12 2018 Martin Stransky - 64.0-4 -- Use gcc on all platforms for official release. +* Tue May 7 2024 Martin Stransky - 125.0.3-2 +- Added ffmpeg-free to recommends (rhbz#2023833). -* Wed Dec 12 2018 Martin Stransky - 64.0-3 -- Updated PGO build setup. +* Mon Apr 29 2024 Martin Stransky - 125.0.3-1 +- Updated to 125.0.3 -* Tue Dec 4 2018 Martin Stransky - 64.0-2 -- Updated to Firefox 64 (Build 3) -- Built with Clang on some arches. +* Tue Apr 9 2024 Martin Stransky - 125.0-1 +- Updated to 125.0 -* Mon Nov 26 2018 Martin Stransky - 63.0.3-3 -- [Wayland] Fixed issues with Sway compositor and wl_keyboard setup - (mozbz#1507475). +* Thu Apr 4 2024 Martin Stransky - 124.0.2-2 +- Updated to 124.0.2 -* Wed Nov 21 2018 Martin Stransky - 63.0.3-2 -- [Wayland] Fixed mozbz#1507475 - crash when display changes - (rhbz#1646151). +* Thu Mar 28 2024 Jan Horak - 124.0.1-4 +- Enable rlbox sandboxing -* Thu Nov 15 2018 Martin Stransky - 63.0.3-1 -- Updated to latest upstream (63.0.3) +* Mon Mar 25 2024 Martin Stransky - 124.0-2 +- Reverted IM patch -* Tue Nov 13 2018 Martin Stransky - 63.0.1-6 -- Added an option to build with clang/llvm. -- Fixed debug builds. -- Fixed warnings at Wayland clipboard code. +* Wed Mar 13 2024 Martin Stransky - 124.0-1 +- Updated to 124.0 -* Tue Nov 6 2018 Martin Stransky - 63.0.1-5 -- Added fix for mozbz#1502457- disable Contextual Feature - Recommender/shield studies by default. +* Thu Mar 07 2024 Martin Stransky - 123.0.1-1 +- Updated to 123.0.1 -* Mon Nov 5 2018 Martin Stransky - 63.0.1-4 -- Added clipboard fix (mozbz#1504689) +* Fri Feb 23 2024 Martin Stransky - 123.0-2 +- Fixed PGO builds and enabled it again. -* Fri Nov 2 2018 Dan Horak - 63.0.1-3 -- Added fixes for ppc64le +* Wed Feb 21 2024 Daniel Rusek - 123.0-2 +- Add matching AppStream metadata for org.mozilla.firefox.desktop -* Thu Nov 1 2018 Martin Stransky - 63.0.1-2 -- Fixed typo on man page (rhbz#1643766) +* Mon Feb 19 2024 Martin Stransky - 123.0-1 +- Update to 123.0 +- disabled system AV1 due to build issues. -* Thu Nov 1 2018 Martin Stransky - 63.0.1-1 -- Updated to latest upstream (63.0.1 build 4) +* Tue Feb 13 2024 Martin Stransky - 122.0.1-1 +- Update to 122.0.1 -* Tue Oct 23 2018 Martin Stransky - 63.0-2 -- Updated to latest upstream (63.0 build 2) +* Mon Feb 12 2024 Jan Grulich - 122.0-7 +- Backport upstream fixes to PipeWire camera support -* Thu Oct 18 2018 Martin Stransky - 63.0-1 -- Updated to latest upstream (63.0) -- Updated PipeWire patch +* Mon Feb 12 2024 Martin Stransky - 122.0-6 +- Temporary removed proxy cache (rhbz#2262959) -* Tue Oct 9 2018 Martin Stransky - 62.0.3-4 -- Added fix for mozbz#1447775 - wrong dropspace sizing. +* Wed Jan 31 2024 Martin Stransky - 122.0-5 +- Disabled system libvpx due to WebRTC/camera issues (mzbz#1875201) -* Tue Oct 9 2018 Martin Stransky - 62.0.3-3 -- Added fix for mozbz#1493081 - popups incorrectly placed and sized. +* Tue Jan 30 2024 Martin Stransky - 122.0-4 +- Build with --enable-replace-malloc (rhbz#2260766) -* Mon Oct 8 2018 Martin Stransky - 62.0.3-2 -- Added pipewire patch (mozbz#1496359) -- Added Wayland patches from Firefox 63 -- Enable Wayland backed by default on Fedora 30 +* Tue Jan 30 2024 Martin Stransky - 122.0-3 +- Added version to obsolete firefox-wayland/x11 -* Tue Oct 2 2018 Martin Stransky - 62.0.3-1 -- Updated to latest upstream (62.0.3) +* Mon Jan 29 2024 Martin Stransky - 122.0-2 +- Obsolete firefox-wayland and firefox-x11 on Fedora 40+ -* Wed Sep 26 2018 Martin Stransky - 62.0.2-3 -- Enabled DBus remote for all Gtk+ backends -- Removed obsoleted patches +* Fri Jan 19 2024 Martin Stransky - 122.0-1 +- Update to 122.0 -* Tue Sep 25 2018 Martin Stransky - 62.0.2-2 -- Disable workaround for mozbz#1342344 - GFX glitches when building - with -O3/gcc 7.2 +* Fri Jan 19 2024 Fedora Release Engineering - 121.0.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild -* Mon Sep 24 2018 Jan Horak - 62.0.2-1 -- Update to 62.0.2 +* Fri Jan 12 2024 Fabio Valentini - 121.0.1-2 +- Rebuild for dav1d 1.3.0 -* Mon Sep 17 2018 Martin Stransky - 62.0-3 -- Added spellchecker.dictionary_path pref pointer to /usr/share/myspell. - Thanks to Peter Oliver (rhbz#1627837) +* Fri Jan 12 2024 Martin Stransky - 121.0.1-1 +- Update to 121.0.1 +- Fixed Firefox icon on Rawhide -* Tue Sep 4 2018 Martin Stransky - 62.0-2 -- Update to 62.0 (Build 2) +* Tue Jan 02 2024 Martin Stransky - 121.0-4 +- Really enable proxy cache -* Tue Aug 28 2018 Martin Stransky - 62.0-1 -- Update to 62.0 +* Fri Dec 22 2023 Martin Stransky - 121.0-3 +- Disabled DBus activations -* Wed Aug 15 2018 Ondrej Zoder - 61.0.2-3 -- Added patches for mozbz#1427700 and mozbz#1463809 +* Tue Dec 19 2023 Martin Stransky - 121.0-2 +- Added Wayland proxy cache (mzbz#1743144) -* Mon Aug 13 2018 Ondrej Zoder - 61.0.2-2 -- Updated symbolic icon +* Mon Dec 18 2023 Martin Stransky - 121.0-2 +- Enable Gnome Shell Search provider for Fedora 40+ +- Don't ship firefox-x11 and firefox-wayland on Fedora 40+ -* Thu Aug 9 2018 Martin Stransky - 61.0.2-1 -- Update to 61.0.2 +* Mon Dec 18 2023 Martin Stransky - 121.0-1 +- Updated to 121.0 -* Wed Aug 1 2018 Ondrej Zoder - 61.0.1-4 -- Fixed rhbz#1610428 +* Fri Dec 01 2023 Martin Stransky - 120.0.1-1 +- Updated to 120.0.1 -* Tue Jul 17 2018 Ondrej Zoder - 61.0.1-3 -- Bump release +* Mon Nov 27 2023 Martin Stransky - 120.0-3 +- Add fix for rhbz#2251202 -* Fri Jul 13 2018 Fedora Release Engineering - 61.0.1-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild +* Mon Nov 20 2023 Martin Stransky - 120.0-2 +- Updated to 120.0 Build 2 -* Tue Jul 10 2018 Ondrej Zoder - 61.0.1 -- Update to 61.0.1 +* Tue Nov 14 2023 Martin Stransky - 120.0-1 +- Updated to 120.0 -* Mon Jun 25 2018 Martin Stransky - 61.0-4 -- Disabled mozbz#1424422 as it's broken. +* Fri Nov 10 2023 Martin Stransky - 119.0.1-2 +- Updated to 119.0.1 -* Fri Jun 22 2018 Martin Stransky - 61.0-3 -- Update to 61.0 Build 3 +* Tue Nov 07 2023 Martin Stransky - 119.0-5 +- Added fix for rhbz#2247665 -* Thu Jun 21 2018 Martin Stransky - 61.0-2 -- Disabled system hunspell due to rhbz#1593494 +* Mon Nov 06 2023 Martin Stransky - 119.0-4 +- Added fix for mzbz#1762816 -* Tue Jun 19 2018 Martin Stransky - 61.0-1 -- Updated to 61.0 -- Created firefox-wayland subpackage with wayland launcher. +* Mon Oct 30 2023 Jan Horak - 119.0-3 +- Enable mozilla crash reporter -* Mon Jun 11 2018 Jan Horak - 60.0.2-1 -- Update to 60.0.2 +* Fri Oct 27 2023 Martin Stransky - 119.0-2 +- Added fix for mzbz#1861615 -* Mon Jun 4 2018 Martin Stransky - 60.0.1-6 -- Fixed mozbz#1466473, rhbz#1585300 - Fix GL detection. -- Fixed desktop file names (rhbz#1585369). +* Tue Oct 24 2023 Martin Stransky - 119.0-1 +- Updated to 119.0 -* Wed May 30 2018 Martin Stransky - 60.0.1-5 -- Added workaround for mozbz#1464823 which makes GL layer - compositor usable on Wayland. +* Tue Oct 10 2023 Martin Stransky - 118.0.2-1 +- Updated to 118.0.2 -* Tue May 29 2018 Martin Stransky - 60.0.1-4 -- Added fix for mozbz#1464808 - Set default D&D action to move - on Wayland. +* Fri Oct 06 2023 Alessandro Astone - 118.0.1-7 +- Don't include -x11 and -wayland desktop files in the main package (rhbz#2242523) -* Fri May 25 2018 Martin Stransky - 60.0.1-3 -- Added fix for mozbz#1436242 (rhbz#1577277) - Firefox IPC crashes. -- Added fix for mozbz#1462640 - Sandbox disables eglGetDisplay() - call on Wayland/EGL backend. +* Fri Oct 6 2023 Martin Stransky - 118.0.1-6 +- Removed DBusActivatable flag from desktop file as it crashes KDE (rhbz#2242454). -* Fri May 25 2018 Martin Stransky - 60.0.1-2 -- Enable Wayland backend. +* Thu Oct 05 2023 Kalev Lember - 118.0.1-5 +- Fix flatpak build -* Wed May 23 2018 Jan Horak - 60.0.1-1 -- Update to 60.0.1 +* Mon Oct 2 2023 Martin Stransky - 118.0.1-4 +- Updated man page -* Wed May 16 2018 Martin Stransky - 60.0-6 -- Added patch from rhbz#1498561 - second arch (ppc*) crashes. +* Mon Oct 2 2023 Martin Stransky - 118.0.1-3 +- Avoid to launch Firefox by gnome-shell search -* Wed May 16 2018 Martin Stransky - 60.0-5 -- Disabled jemalloc on second arches. +* Fri Sep 29 2023 Martin Stransky - 118.0.1-2 +- Use firefox.desktop again -* Thu May 3 2018 Martin Stransky - 60.0-4 -- Updated to Firefox 60 build 2 +* Fri Sep 29 2023 Martin Stransky - 118.0.1-1 +- Updated to 118.0.1 -* Thu May 3 2018 Martin Stransky - 60.0-3 -- Added patch from mozbz#1375074 - fixes aarch64 baseline JIT crashes +* Wed Sep 27 2023 Neal Gompa - 118.0.1-1 +- Use system libraries for AV1, VP8, VP9, and WebP -* Thu May 3 2018 Martin Stransky - 60.0-2 -- Make Wayland backend optional and disable it by default due to WebGL issues. +* Wed Sep 27 2023 Martin Stransky - 118.0-2 +- Fixed Gnome search provider -* Wed May 2 2018 Martin Stransky - 60.0-1 -- Update to Firefox 60 build 1 -- Ship firefox-wayland launch script +* Mon Sep 25 2023 Martin Stransky - 118.0-1 +- Updated to 118.0 -* Mon Apr 30 2018 Martin Stransky - 60.0-0.5 -- Build with Wayland backend enabled. +* Thu Sep 14 2023 Adam Williamson - 117.0.1-2 +- Pass --with-clang-path to fix build with clang 17 (rhbz#2239047) -* Mon Apr 30 2018 Martin Stransky - 60.0-0.4 -- Added patches for correct popups position at CSD mode (mozilla-1457691). +* Wed Sep 13 2023 Martin Stransky - 117.0.1-1 +- Updated to 117.0.1 -* Fri Apr 27 2018 Martin Stransky - 60.0-0.2 -- Update to 60.0 Beta 16 +* Wed Aug 30 2023 Martin Stransky - 117.0-2 +- Added fix for rhbz#2235654 -* Tue Apr 24 2018 Martin Stransky - 60.0-0.1 -- Update to 60.0 Beta 15 +* Mon Aug 28 2023 Martin Stransky - 117.0-1 +- Updated to 117.0 + +* Thu Aug 17 2023 Martin Stransky - 116.0.3-1 +- Updated to 116.0.3 + +* Wed Aug 16 2023 Martin Stransky - 116.0.2-2 +- Added Fedora customization patch + +* Mon Aug 7 2023 Martin Stransky - 116.0.2-1 +- Updated to 116.0.2 + +* Fri Aug 4 2023 Martin Stransky - 116.0.1-1 +- Updated to 116.0.1 + +* Wed Aug 2 2023 Martin Stransky - 116.0-3 +- Added Canvas/WebGL VA-API playback patch (D167159 / mzbz#1769747) + +* Mon Jul 31 2023 Martin Stransky - 116.0-2 +- Updated to 116.0 Build 2 + +* Thu Jul 27 2023 Martin Stransky - 116.0-1 +- Updated to 116.0 + +* Mon Jul 24 2023 Martin Stransky - 115.0.2-4 +- Don't set MOZ_GMP_PATH as it's configured by /etc/profile.d/gmpopenh264.sh + from mozilla-openh264 package. + +* Wed Jul 19 2023 Martin Stransky - 115.0.2-3 +- Fix the previous fix (rhbz#2221317) + +* Tue Jul 18 2023 Martin Stransky - 115.0.2-2 +- Don't overwrite MOZ_GMP_PATH (rhbz#2221317) + +* Mon Jul 17 2023 Martin Stransky - 115.0.2-1 +- Update to 115.0.2 + +* Tue Jul 11 2023 Dan Horák - 115.0-3 +- re-enable ppc64le (rhbz#2212748) + +* Thu Jun 29 2023 Martin Stransky - 115.0-2 +- Update to 115.0 +- Disabled LTO due to rhbz#2218885 + +* Thu Jun 29 2023 Martin Stransky - 114.0.2-3 +- Enable Elf-hack for PGO builds. + +* Thu Jun 22 2023 Martin Stransky - 114.0.2-2 +- Enable PGO/LTO again. + +* Tue Jun 20 2023 Martin Stransky - 114.0.2-1 +- Update to 114.0.2 + +* Mon Jun 05 2023 Martin Stransky - 114.0-1 +- Updated to 114.0 +- Disable webrtc on ppc64le +- Disabled ppc64le due t build issues (rhbz#2212748). + +* Wed May 24 2023 Martin Stransky - 113.0.1-4 +- Added patches from 113.0.2 +- Added Rust fix for Rawhide (mzbz#1831242). + +* Fri May 19 2023 Martin Stransky - 113.0.1-3 +- Disabled libproxy support due to regressions (rhbz#2207469) + +* Tue May 16 2023 Jan Grulich - 113.0.1-2 +- Backport libwebrtc commit 7b0d7f48fb + Fix fcntl call when duplicating a file descriptor + +* Mon May 15 2023 Martin Stransky - 113.0.1-1 +- Updated to 113.0.1 + +* Tue May 9 2023 Martin Stransky - 113.0-1 +- Updated to 113.0 + +* Thu Apr 27 2023 Martin Stransky - 112.0.2-1 +- Updated to 112.0.2 + +* Tue Apr 18 2023 Martin Stransky - 112.0.1-1 +- Updated to 112.0.1 +- Added fix for rhbz#2187000 +- Enabled system pixman (by G.Hojda) + +* Tue Apr 11 2023 Martin Stransky - 112.0-3 +- Added wayland window fix mzbz#1827429 + +* Thu Apr 6 2023 Martin Stransky - 112.0-2 +- Updated to 112.0 build 2 +- don't crash on wayland logging (mzbz#1826583/rhbz#2184842). + +* Wed Apr 5 2023 Martin Stransky - 112.0-1 +- Updated to 112.0 + +* Wed Apr 5 2023 Martin Stransky - 111.0.1-2 +- Don't override MOZ_USE_XINPUT2 in startup script (hrbz#2184297) by GalaxyMaster + +* Wed Mar 22 2023 Martin Stransky - 111.0.1-1 +- Updated to 111.0.1 + +* Tue Mar 21 2023 Jan Grulich - 111.0-3 +- libwebrtc: backport upstream fix/improvement for DmaBuf screen sharing + +* Tue Mar 21 2023 Martin Stransky - 111.0-2 +- Added libproxy support (rhbz#2177806) +- Added build fixes on arm + +* Mon Mar 20 2023 Martin Stransky - 111.0-1 +- Updated to 111.0 +- Disabled arm on F36 + +* Tue Feb 14 2023 Martin Stransky - 110.0-3 +- Updated to 110.0 build 3 + +* Mon Feb 13 2023 Martin Stransky - 110.0-2 +- Added fix for orca + +* Thu Feb 9 2023 Martin Stransky - 110.0-1 +- Updated to 110.0 + +* Tue Feb 7 2023 Martin Stransky - 109.0.1-2 +- Rawhide build fix + +* Wed Feb 1 2023 Martin Stransky - 109.0.1-1 +- Updated to 109.0.1 +- Added fix for rhbz#2147344 / mzbz#1813500. + +* Thu Jan 19 2023 Martin Stransky - 109.0-4 +- Removed mozbz#1809162 + +* Thu Jan 19 2023 Fedora Release Engineering - 109.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Tue Jan 17 2023 Martin Stransky - 109.0-2 +- Added VA-API fixes mozbz#1809162, mozbz#1801576 + +* Mon Jan 16 2023 Martin Stransky - 109.0-1 +- Update to 109.0 + +* Thu Jan 12 2023 Jan Horak - 108.0.2-1 +- Update to 108.0.2 + +* Mon Jan 09 2023 Kalev Lember - 108.0.1-4 +- Drop conditionals for F35 + +* Wed Dec 21 2022 Martin Stransky - 108.0.1-3 +- Added second arch build fix + +* Wed Dec 21 2022 Martin Stransky - 108.0.1-2 +- Added mozbz#1795851 [wayland] Crash buffer size (170x113) + is not divisible by scale (2) + +* Mon Dec 19 2022 Martin Stransky - 108.0.1-1 +- Update to 108.0.1 + +* Wed Dec 14 2022 Martin Stransky - 108.0-2 +- Update to 108.0 Build 2 +- Added fix for rhbz#2149821 + +* Tue Dec 6 2022 Martin Stransky - 108.0-1 +- Update to 108.0 + +* Tue Dec 6 2022 Martin Stransky - 107.0.1-1 +- Update to 107.0.1 + +* Thu Nov 24 2022 Martin Stransky - 107.0-4 +- Added fix for mozbz#1779186 - fix VA-API playback artifacts + +* Mon Nov 21 2022 Martin Stransky - 107.0-3 +- Disabled crashreporter + +* Mon Nov 21 2022 Jan Horak - 107.0-2 +- Enabled mozilla crashreporter again + +* Mon Nov 14 2022 Martin Stransky - 107.0-1 +- Update to 107.0 + +* Fri Nov 04 2022 Martin Stransky - 106.0.4-1 +- Update to 106.0.4 + +* Mon Oct 31 2022 Martin Stransky - 106.0.3-1 +- Update to 106.0.3 + +* Sun Oct 23 2022 Martin Stransky - 106.0.1-1 +- Update to 106.0.1 +- Require xdg-desktop-portal when file dialog portal is used. +- Disabled file dialog portals on F37+ + +* Thu Oct 20 2022 Jan Grulich - 106.0-2 +- Enable upstream WebRTC code for screensharing on Wayland + +* Fri Oct 14 2022 Martin Stransky - 106.0-1 +- Updated to 106.0 +- Disabled PGO build due to rhbz#2136401 + +* Fri Oct 14 2022 Martin Stransky - 105.0.2-2 +- Fixed crashes on multi-monitor systems (mzbz#1793922) + +* Wed Oct 5 2022 Martin Stransky - 105.0.2-1 +- Updated to 105.0.2 + +* Fri Sep 30 2022 Martin Stransky - 105.0.1-2 +- Added fix for mozilla#1791856 / rhbz#2130087 + +* Thu Sep 22 2022 Martin Stransky - 105.0.1-1 +- Updated to 105.0.1 +- Excluded i686 due to https://bugzilla.mozilla.org/show_bug.cgi?id=1792159, + https://bugzilla.redhat.com/show_bug.cgi?id=2129720 + +* Tue Sep 20 2022 Martin Stransky - 105.0-1 +- Updated to 105.0 + +* Tue Sep 6 2022 Martin Stransky - 104.0.2-1 +- Updated to 104.0.2 + +* Tue Aug 30 2022 Martin Stransky - 104.0.1-1 +- Updated to 104.0.1 + +* Tue Aug 23 2022 Kalev Lember - 104.0-5 +- Use constrain_build macro to simplify parallel make handling +- Drop obsolete build conditionals +- Drop unused patches +- Use build_ldflags +- Drop hardened_build option +- Re-enable s390x builds + +* Tue Aug 23 2022 Jan Horak - 104.0-4 +- Rebuild due to ppc64le fixes + +* Mon Aug 22 2022 Eike Rathke - 104.0-3 +- Update to 104.0 respin + +* Wed Aug 17 2022 Martin Stransky - 104.0-2 +- Added build fixes + +* Tue Aug 16 2022 Martin Stransky - 104.0-1 +- Updated to 104.0 + +* Fri Aug 12 2022 Martin Stransky - 103.0.2-1 +- Updated to 103.0.2 + +* Thu Aug 4 2022 Martin Stransky - 103.0.1-2 +- Added arm build fixes by Gabriel Hojda +- Enable VA-API (rhbz#2115253) + +* Tue Aug 2 2022 Martin Stransky - 103.0.1-1 +- Update to 103.0.1 + +* Tue Jul 26 2022 Martin Stransky - 103.0-1 +- Update to 103.0 +- Disabled ppc64le due to webrtc build failures (rhbz#2113850) + +* Thu Jul 21 2022 Fedora Release Engineering - 102.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Wed Jul 13 2022 Martin Stransky - 102.0-3 +- Update preference logging. +- Added ARM fixes by Gabriel Hojda. + +* Mon Jul 11 2022 Jan Grulich - 102.0-2 +- Backport upstream fixes to WebRTC for screensharing on Wayland + +* Tue Jun 28 2022 Martin Stransky - 102.0-1 +- Updated to 102.0 +- Applied patch from https://src.fedoraproject.org/rpms/firefox/pull-request/43 + +* Mon Jun 27 2022 Martin Stransky - 101.0.1-7 +- Rebuild + +* Fri Jun 17 2022 Martin Stransky - 101.0.1-6 +- Added fix for mozbz#1774271 - Intel/dmabuf export issues. + +* Wed Jun 15 2022 Martin Stransky - 101.0.1-5 +- Added fix for mozbz#1758948 (AV1 VA-API playback shuttering) + +* Tue Jun 14 2022 Martin Stransky - 101.0.1-3 +- Added fixes for mozbz#1773377 and mozbz#1774075 + +* Mon Jun 13 2022 Martin Stransky - 101.0.1-2 +- Fix WebGL mem leaks (mzbz#1773968) + +* Thu Jun 9 2022 Martin Stransky - 101.0.1-1 +- Updated to 101.0.1 +- More VA-API sandbox fixes (mzbz#1769182) +- Fixed OpenH264 decode (rhbz#2094319) + +* Tue Jun 7 2022 Martin Stransky - 101.0-2 +- Enabled VA-API by default (+ added VA-API fixes from upstream) +- Fixed WebGL performance on NVIDIA drivers (mzbz#1735929) + +* Mon May 30 2022 Martin Stransky - 101.0-1 +- Updated to 101.0 + +* Wed May 25 2022 Martin Stransky - 100.0.2-2 +- Added fix for mzbz#1771104 + +* Fri May 20 2022 Martin Stransky - 100.0.2-1 +- Updated to 100.0.2 + +* Wed May 18 2022 Martin Stransky - 100.0.1-1 +- Updated to 100.0.1 + +* Mon May 16 2022 Jan Horak - 100.0-6 +- Fix spellchecker.dictionary_path of F36+ + +* Tue May 10 2022 Jan Horak - 100.0-5 +- Fix crashes on f36 multimonitor setup and too big profile manager + +* Mon May 9 2022 Martin Stransky - 100.0-4 +- Added fix for mozbz#1767916. + +* Thu May 5 2022 Martin Stransky - 100.0-3 +- Removed Fedora user agent patch (rhbz#2081791). + +* Tue May 3 2022 Martin Stransky - 100.0-2 +- Added fix for mozbz#1759137 + +* Mon May 2 2022 Martin Stransky - 100.0-1 +- Updated to 100.0 + +* Thu Apr 28 2022 Jan Horak - 99.0.1-2 +- Fixing bookmark install location - rhbz#2054953 + +* Wed Apr 13 2022 Martin Stransky - 99.0.1-1 +- Updated to 99.0.1 + +* Wed Apr 6 2022 Martin Stransky - 99.0-1 +- Updated to 99.0 + +* Thu Mar 31 2022 Martin Stransky - 98.0.2-1 +- Updated to 98.0.2 + +* Wed Mar 30 2022 Jan Grulich - 98.0-4 +- Wayland screensharing: avoid potential crash when cursor metadata are not set + +* Wed Mar 16 2022 Martin Stransky - 98.0-3 +- Added a workaround for rhbz#2063961 + +* Wed Mar 2 2022 Martin Stransky - 98.0-2 +- Added support for ffmpeg 5.0 +- Spec tweaks +- Updated to Build 3 + +* Tue Mar 1 2022 Martin Stransky - 98.0-1 +- Updated to 98.0 + +* Mon Feb 21 2022 Jan Grulich - 97.0.1-2 +- Backport WebRTC changes to PipeWire/Wayland screen sharing support + +* Fri Feb 18 2022 Martin Stransky - 97.0.1-1 +- Updated to 97.0.1 +- GCC 12 build fixes + +* Tue Feb 8 2022 Martin Stransky - 97.0-1 +- Updated to 97.0 + +* Mon Jan 31 2022 Martin Stransky - 96.0.3-1 +- Updated to 96.0.3 + +* Tue Jan 25 2022 Parag Nemade - 96.0.1-3 +- Update hunspell-dir path + F36 Change https://fedoraproject.org/wiki/Changes/Hunspell_dictionary_dir_change + +* Thu Jan 20 2022 Fedora Release Engineering - 96.0.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Tue Jan 18 2022 Martin Stransky - 96.0.1-1 +- Updated to 96.0.1 + +* Tue Jan 11 2022 Martin Stransky - 96.0-1 +- Updated to 96.0 + +* Sat Jan 08 2022 Miro Hrončok - 95.0.2-5 +- Rebuilt for https://fedoraproject.org/wiki/Changes/LIBFFI34 + +* Thu Dec 23 2021 Martin Stransky - 95.0.2-4 +- Added fix fox mozbz#1744896 (VSync) + +* Wed Dec 22 2021 Martin Stransky - 95.0.2-3 +- Added Fedora 36 build fix (mzbz#1745560) + +* Mon Dec 20 2021 Martin Stransky - 95.0.2-1 +- Updated to 95.0.2 +- Enabled Wayland on KDE by default + +* Thu Dec 9 2021 Martin Stransky - 95.0-2 +- Updated symbolic icon (rhbz#2028939) + +* Fri Dec 3 2021 Martin Stransky - 95.0-1 +- Updated to 95.0 + +* Fri Nov 19 2021 Martin Stransky - 94.0-2 +- Added fix for mozbz#1739924 / rhbz#2020981. + +* Mon Nov 1 2021 Martin Stransky - 94.0-1 +- Updated to 94.0 + +* Thu Oct 07 2021 Martin Stransky - 93.0-2 +- Require NSS 3.70 + +* Wed Sep 29 2021 Martin Stransky - 93.0-1 +- Updated to 93.0 + +* Mon Sep 27 2021 Martin Stransky - 92.0.1-1 +- Updated to 92.0.1 + +* Mon Sep 13 2021 Martin Stransky - 92.0-3 +- Added fix for mozbz#1725828 + +* Thu Sep 9 2021 Martin Stransky - 92.0-2 +- Disable test + +* Fri Sep 3 2021 Martin Stransky - 92.0-1 +- Updated to 92.0 +- Added fix for mozbz#1728749 +- Added fix for mozbz#1708709 + +* Thu Aug 26 2021 Martin Stransky - 91.0.2-1 +- Updated to 91.0.2 + +* Mon Aug 23 2021 Martin Stransky - 91.0.1-2 +- Set %%build_with_clang automatically based on %%toolchain + by Timm Bäder +- Updated Fedora UA patch by Eric Engestrom + (https://src.fedoraproject.org/rpms/firefox/pull-request/21) +- Added fix for mozbz#1726515 + +* Mon Aug 23 2021 Martin Stransky - 91.0.1-1 +- Updated to 91.0.1 + +* Tue Aug 10 2021 Martin Stransky - 91.0-1 +- Updated to 91.0 + +* Wed Aug 04 2021 Martin Stransky - 90.0.2-2 +- Added fix for rhbz#1988841 - Allow unsigned extensions when installed + under non-user-writable dirs. + +* Thu Jul 22 2021 Martin Stransky - 90.0.2-1 +- Updated to 90.0.2 + +* Wed Jul 21 2021 Fedora Release Engineering - 90.0.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Wed Jul 21 2021 Martin Stransky - 90.0.1-1 +- Updated to 90.0.1 +- Added fixes to build on rawhide + +* Thu Jul 15 2021 Martin Stransky - 90.0-3 +- Disabled Wayland backend on KDE due to + https://bugzilla.mozilla.org/show_bug.cgi?id=1714132 + +* Tue Jul 13 2021 Martin Stransky - 90.0-2 +- Added xorg-x11-server-Xwayland dependency for Mutter + +* Mon Jul 12 2021 Martin Stransky - 90.0-1 +- Updated to 90.0 + +* Mon Jul 12 2021 Daiki Ueno - 89.0.2-3 +- flatpak: Enable loading system trust store on the host (rhbz#1766340) + +* Wed Jun 30 2021 Martin Stransky - 89.0.2-2 +- Added fix for mozbz#1715254 (rhbz#1976892). + +* Thu Jun 24 2021 Martin Stransky - 89.0.2-1 +- Updated to latest upstream (89.0.2) + +* Mon Jun 14 2021 Martin Stransky - 89.0-2 +- Added fix for mozbz#1646135 + +* Tue Jun 1 2021 Martin Stransky - 89.0-1 +- Updated to latest upstream (89.0) + +* Mon May 10 2021 Martin Stransky - 88.0.1-1 +- Updated to latest upstream (88.0.1) + +* Tue May 4 2021 Martin Stransky - 88.0-8 +- Added fix for mozbz#1705048. + +* Fri Apr 30 2021 Martin Stransky - 88.0-7 +- Added pciutils-libs req (rhbz#1955338) +- Enabled Wayland on KDE (rhbz#1922608) + +* Tue Apr 27 2021 Martin Stransky - 88.0-6 +- Test fix. + +* Fri Apr 23 2021 Martin Stransky - 88.0-5 +- Added fix for mozbz#1580595 - mouse pointer lock. +- Another test update. + +* Thu Apr 22 2021 Martin Stransky - 88.0-4 +- Run with mochitest test suite. + +* Thu Apr 22 2021 Martin Stransky - 88.0-3 +- Build with crashreporter enabled. + +* Wed Apr 21 2021 Martin Stransky - 88.0-2 +- Added clipboard fix mzbz#1703763. + +* Mon Apr 19 2021 Martin Stransky - 88.0-1 +- Update to 88.0 + +* Mon Apr 12 2021 Martin Stransky - 87.0-12 +- Added fix for mozbz#1701089 (Widevine playback issues). + +* Tue Apr 6 2021 Martin Stransky - 87.0-11 +- Enabled xpcshell/crashtests on Wayland. + +* Sat Apr 3 2021 Martin Stransky - 87.0-10 +- Wayland testing again. + +* Thu Apr 1 2021 Martin Stransky - 87.0-9 +- Added fix for mozbz#1702606 / rhbz#1936071 +- Switched tests back to X11 due to massive failures. + +* Thu Apr 1 2021 Martin Stransky - 87.0-8 +- Run testsuite on Wayland on Fedora 33+ +- Spec cleanup + +* Wed Mar 31 2021 Martin Stransky - 87.0-7 +- Added fix for mozbz#1693472 - Wayland/KDE rendering issues. + +* Tue Mar 30 2021 Jonathan Wakely - 87.0-6 +- Rebuilt for removed libstdc++ symbol (#1937698) + +* Tue Mar 30 2021 Martin Stransky - 87.0-5 +- Reftest fix + +* Fri Mar 26 2021 Martin Stransky - 87.0-4 +- More test fixes +- Enabled ppc64le +- Disabled crashreporter on Fedora 34+ + +* Wed Mar 24 2021 Martin Stransky - 87.0-2 +- More test fixes + +* Tue Mar 23 2021 Martin Stransky - 87.0-1 +- Disabled ARM due to build failures +- Updated to 87.0 + +* Sat Mar 13 2021 Martin Stransky - 86.0.1-2 +- Enabled ARM + +* Fri Mar 12 2021 Martin Stransky - 86.0.1-1 +- Update to latest upstream (86.0.1) + +* Wed Mar 10 2021 Martin Stransky - 86.0-8 +- Temporary disable ppc64le/Fedora 35 due to + https://bugzilla.redhat.com/show_bug.cgi?id=1933742 + +* Wed Mar 3 2021 Martin Stransky - 86.0-7 +- Added fix for mozbz#1694670 + +* Mon Mar 1 2021 Martin Stransky - 86.0-6 +- Run xpcshell tests sequential +- Test fixes + +* Mon Mar 1 2021 Martin Stransky - 86.0-4 +- Enable Wayland backend only when Wayland display is set. + +* Mon Mar 1 2021 Martin Stransky - 86.0-3 +- Added icecat-78.7.1-fix_error_template_with_C_linkage.patch to + build on F34+ + +* Fri Feb 26 2021 Martin Stransky - 86.0-2 +- Built with system nss + +* Tue Feb 23 2021 Martin Stransky - 86.0-1 +- Update to 86.0 +- Disabled Wayland backend on KDE/Plasma + +* Tue Feb 23 2021 Martin Stransky - 85.0.1-2 +- Fixed some reftest run in Mock + +* Mon Feb 08 2021 Martin Stransky - 85.0.1-1 +- Updated to 85.0.1 + +* Wed Feb 03 2021 Dan Horák - 85.0-11 +- Fix parameter passing on ppc64le (mozb#1690152) + +* Tue Feb 02 2021 Kalev Lember - 85.0-10 +- Remove gtk2 support as flash plugin is no longer supported + +* Sat Jan 30 2021 Martin Stransky - 85.0-9 +- Enable WebRender on KDE/Wayland and AMD/Intel drivers. + +* Sat Jan 30 2021 Martin Stransky - 85.0-8 +- Enable Wayland backend on Fedora 34/KDE/Plasma (and other compositors) + by default (https://bugzilla.redhat.com/show_bug.cgi?id=1922608). + +* Fri Jan 29 2021 Martin Stransky - 85.0-7 +- Added clipboard fix mozbz#1631061. + +* Thu Jan 28 2021 Kalev Lember - 85.0-6 +- Make provides/requires filtering smarter/automatic (rhbz#1582116) +- Drop dbus-glib requires that are now automatically generated again + +* Thu Jan 28 2021 Martin Stransky - 85.0-5 +- Add dbus-glib requires. + +* Tue Jan 26 2021 Martin Stransky - 85.0-4 +- Added fix for mozbz#1679933 - startup crash + +* Tue Jan 26 2021 Fedora Release Engineering - 85.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Wed Jan 20 2021 Martin Stransky - 85.0-2 +- Update to 85.0. + +* Wed Jan 20 2021 Jan Horak - 84.0.2-8 +- Fixing package requires/provides + +* Tue Jan 19 2021 Martin Stransky - 84.0.2-7 +- Fixed mzbz#164294 regression. + +* Fri Jan 15 2021 Martin Stransky - 84.0.2-6 +- Added WebRender fix (mozbz#1681107). + +* Thu Jan 14 2021 Martin Stransky - 84.0.2-5 +- Removed some failing tests. +- Spec file tweaks. + +* Tue Jan 12 2021 Martin Stransky - 84.0.2-4 +- Enabled LTO in Firefox build system. + +* Tue Jan 12 2021 Martin Stransky - 84.0.2-3 +- Removed failing xpcshell/reftests, test tweaks. + +* Mon Jan 11 2021 Martin Stransky - 84.0.2-2 +- Added a workaround for rhbz#1908018 + +* Wed Jan 6 2021 Martin Stransky - 84.0.2-1 +- Updated to 84.0.2 + +* Tue Jan 05 2021 Jan Horak - 84.0.1-5 +- Removing requires/provides of the bundled libraries + +* Mon Jan 4 2021 Martin Stransky - 84.0.1-4 +- Enabled tests + +* Mon Jan 4 2021 Martin Stransky - 84.0.1-3 +- Enabled armv7hl arch on rawhide + +* Wed Dec 23 2020 Martin Stransky - 84.0.1-2 +- Reverted mzbz#1631061 due to clipboard regressions +- Disabled armv7hl build on rawhide due to rhbz#1910277 +- Build with system nss on rawhide (rhbz#1908791). + +* Tue Dec 22 2020 Martin Stransky - 84.0.1-1 +- Updated to 84.0.1 + +* Sun Dec 20 2020 Miro Hrončok - 84.0-7 +- Filter out private libraries provides +- Fixes: rhbz#1908791 + +* Thu Dec 17 2020 Martin Stransky - 84.0-6 +- Disable PGO on Rawhide due to build issues +- Disable system nss on Rawhide due to rhbz#1908018 +- Enabled system nss on Fedora 33/32 + +* Wed Dec 16 2020 Martin Stransky - 84.0-5 +- Build with tests enabled + +* Wed Dec 16 2020 Martin Stransky - 84.0-4 +- Disabled LTO due to massive test failures + +* Wed Dec 16 2020 Martin Stransky - 84.0-3 +- Updated to Firefox 84 Build 3 +- Disabled system nss due to addon breakage (rhbz#1908018). + +* Wed Dec 9 2020 Martin Stransky - 83.0-15 +- Enabled tests everywhere +- Enabled crash reporter + +* Tue Dec 1 2020 Martin Stransky - 83.0-14 +- Enabled LTO + +* Tue Dec 1 2020 Martin Stransky - 83.0-13 +- Added fix for mozbz#1672139 + +* Tue Dec 1 2020 Martin Stransky - 83.0-12 +- More mochitest fixes + +* Mon Nov 30 2020 Martin Stransky - 83.0-11 +- Mochitest tweaking + +* Sat Nov 28 2020 Martin Stransky - 83.0-10 +- Added fix for mzbz#1678680 + +* Wed Nov 25 2020 Martin Stransky - 83.0-9 +- Added mochitest test files + +* Wed Nov 25 2020 Martin Stransky - 83.0-8 +- Added fix for rhbz#1900542 + +* Wed Nov 25 2020 Martin Stransky - 83.0-7 +- Export MOZ_GMP_PATH from /usr/bin/firefox script + (https://pagure.io/fedora-workstation/issue/126) + +* Tue Nov 24 2020 Martin Stransky - 83.0-6 +- Fix mochitest + +* Wed Nov 18 2020 Martin Stransky - 83.0-5 +- Build with tests enabled + +* Wed Nov 18 2020 Martin Stransky - 83.0-4 +- Enable all arches + +* Fri Nov 13 2020 Martin Stransky - 83.0-3 +- Updated to 83.0 Build 2 + +* Thu Nov 12 2020 Martin Stransky - 83.0-1 +- Updated to 83.0 +- Updated PipeWire patches from mozbz#1672944 + +* Tue Nov 10 2020 Martin Stransky - 82.0.3-2 +- Added fix for mozbz#1885133 + +* Mon Nov 9 2020 Martin Stransky - 82.0.3-1 +- Updated to 82.0.3 + +* Mon Nov 9 2020 Kalev Lember - 82.0.2-7 +- Include date in appdata release tags + +* Fri Nov 6 2020 Tomas Popela - 82.0.2-6 +- Re-enable s390x buils by backporting a change from Thunderbird + https://src.fedoraproject.org/rpms/thunderbird/c/5f0bec1b5b79e117cc469710afbfa4d008af9c29?branch=master + +* Tue Nov 3 2020 Martin Stransky - 82.0.2-5 +- Added mozilla-openh264 dependency to play H264 clips out of the box +- Updated Firefox tests + +* Tue Nov 3 2020 Martin Stransky - 82.0.2-3 +- Disabled LTO again. + +* Tue Nov 3 2020 Martin Stransky - 82.0.2-2 +- NSS debug build + +* Thu Oct 29 2020 Martin Stransky - 82.0.2-1 +- Updated to 82.0.2 +- Removed mzbz#1668771 due to rhbz#1888920 + +* Wed Oct 28 2020 Martin Stransky - 82.0.1-1 +- Updated to 82.0.1 + +* Tue Oct 27 2020 Martin Stransky - 82.0-8 +- Added fix for mozbz#1673313 + +* Tue Oct 27 2020 Martin Stransky - 82.0-7 +- Added fix for rawhide crashes (rhbz#1891234) + +* Sat Oct 24 2020 Martin Stransky - 82.0-6 +- Enable LTO + +* Tue Oct 20 2020 Martin Stransky - 82.0-5 +- Added fix for rhbz#1889742 - Typo in /usr/bin/firefox + +* Mon Oct 19 2020 Martin Stransky - 82.0-4 +- Updated openh264 patch to use keyframes from contained + for openh264 only. + +* Mon Oct 19 2020 Martin Stransky - 82.0-3 +- Added ELN build fixes + +* Thu Oct 15 2020 Martin Stransky - 82.0-2 +- Updated SELinux relabel setup (rhbz#1731371) + +* Thu Oct 15 2020 Martin Stransky - 82.0-1 +- Updated to 82.0 Build 2 + +* Thu Oct 15 2020 Martin Stransky - 81.0.2-3 +- Added experimental openh264 seek patch (mzbz#1670333) + +* Mon Oct 12 2020 Martin Stransky - 81.0.2-2 +- Added a partial fox for rhbz#1886722 + +* Mon Oct 12 2020 Martin Stransky - 81.0.2-1 +- Updated to latest upstream - 81.0.2 + +* Thu Oct 8 2020 Martin Stransky - 81.0.1-9 +- Added an updated fix for mozbz#1656727 + +* Thu Oct 8 2020 Martin Stransky - 81.0.1-8 +- Added fixes for mozbz#1634404, mozbz#1669495 + +* Thu Oct 8 2020 Martin Stransky - 81.0.1-7 +- Removed mozbz#1656727 as it causes a regression rhbz#1886243 + +* Wed Oct 7 2020 Martin Stransky - 81.0.1-6 +- PGO patch update +- Added fix for mzbz#1669442 (LTO builds) + +* Mon Oct 5 2020 Martin Stransky - 81.0.1-5 +- Added fix for mozbz#1656727 + +* Fri Oct 2 2020 Martin Stransky - 81.0.1-4 +- Added fix for mozbz#1668771 + +* Thu Oct 1 2020 Martin Stransky - 81.0.1-3 +- Added fix for mozbz#1661192 + +* Thu Oct 1 2020 Martin Stransky - 81.0.1-2 +- Added fix for mozbz#1640567 +- Enable PGO + +* Wed Sep 30 2020 Martin Stransky - 81.0.1-1 +- Updated to 81.0.1 + +* Wed Sep 30 2020 Martin Stransky - 81.0-9 +- Disabled openh264 download +- Removed fdk-aac-free dependency (rhbz#1883672) +- Enabled LTO + +* Sat Sep 26 2020 Dan Horák - 81.0-8 +- Re-enable builds for ppc64le + +* Fri Sep 25 2020 Martin Stransky - 81.0-7 +- Added openh264 fixes + +* Wed Sep 23 2020 Martin Stransky - 81.0-6 +- Added fix for rhbz#1731371 + +* Tue Sep 22 2020 Kalev Lember - 81.0-5 +- Re-enable builds for armv7hl and aarch64 architectures + +* Tue Sep 22 2020 Kalev Lember - 81.0-4 +- Disable LTO to work around firefox build failing in F33+ + +* Mon Sep 21 2020 Martin Stransky - 81.0-3 +- Updated to 81.0 Build 2 +- Updated firefox-disable-ffvpx-with-vapi patch +- Deleted old changelog entries + +* Thu Sep 17 2020 Martin Stransky - 81.0-2 +- Added upstream patches mzbz#1665324 mozbz#1665329 +- Updated requested nss version to 3.56 + +* Tue Sep 15 2020 Martin Stransky - 81.0-1 +- Updated to 81.0 + +* Thu Sep 10 2020 Martin Stransky - 80.0.1-3 +- Test build for all arches. + +* Fri Sep 4 2020 Martin Stransky - 80.0.1-2 +- Added patch for mozbz#1875469 + +* Tue Sep 1 2020 Martin Stransky - 80.0.1-1 +- Updated to 80.0.1 + +* Tue Aug 18 2020 Martin Stransky - 80.0-1 +- Updated to 80.0 Build 2 +- Go back to gcc +- Disabled WebGL dmabuf backend due to reported errors + (mzbz#1655323, mozbz#1656505). + +* Tue Aug 18 2020 Martin Stransky - 79.0-6 +- Enabled pgo +- Build with clang + +* Tue Aug 4 2020 Martin Stransky - 79.0-5 +- Added upstream fix for mozbz#1656436. + +* Mon Aug 3 2020 Martin Stransky - 79.0-4 +- Updated fix for mozbz#1645671 + +* Thu Jul 30 2020 Martin Stransky - 79.0-3 +- Added VA-API fix for mozbz#1645671 + +* Wed Jul 29 2020 Martin Stransky - 79.0-2 +- Try to enable armv7hl again. +- Disabled ppc64le due to cargo crash (rhbz#1862012). + +* Mon Jul 27 2020 Martin Stransky - 79.0-1 +- Update to 79.0 +- Disabled PGO due to rhbz#1849165 (gcc internal error). + +* Mon Jul 27 2020 Fedora Release Engineering - 78.0.2-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Thu Jul 23 2020 Frantisek Zatloukal - 78.0-4 +- Use python3 instead of python2 for build + +* Tue Jul 21 2020 Martin Stransky - 78.0-3 +- Added fix for mozbz#1651701/rhbz#1855730 + +* Fri Jul 10 2020 Jan Horak - 78.0.2-2 +- Fixing clang build - linker setup + +* Thu Jul 09 2020 Jan Horak - 78.0.2-1 +- Update to 78.0.2 build2 + +* Wed Jul 01 2020 Jan Horak - 78.0.1-1 +- Update to 78.0.1 build1 + +* Wed Jul 1 2020 Martin Stransky - 78.0-2 +- Add 'Open the Profile Manager' desktop file entry + +* Mon Jun 29 2020 Jan Horak - 78.0-1 +- Update to 78.0 build2 + +* Tue Jun 23 2020 Martin Stransky - 77.0.1-3 +- Build with PGO/LTO again. + +* Wed Jun 03 2020 Jan Horak - 77.0.1-2 +- Update to 77.0.1 build1 + +* Wed Jun 03 2020 Jan Horak - 77.0.1-1 +- Fixing pipewire patch +- New upstream version (77.0.1) + +* Tue Jun 2 2020 Martin Stransky - 77.0-2 +- Rebuild with updated langpacks (rhbz#1843028). + +* Fri May 29 2020 Martin Stransky - 77.0-1 +- Updated to Firefox 77.0 + +* Mon May 25 2020 Martin Stransky - 76.0.1-7 +- Added fix for mozbz#1632456 + +* Mon May 25 2020 Martin Stransky - 76.0.1-6 +- Added fix for mozbz#1634213 + +* Mon May 25 2020 Martin Stransky - 76.0.1-5 +- Added fix for mozbz#1619882 - video flickering when va-api is used. + +* Thu May 21 2020 Jan Grulich - 76.0.1-4 +- Add support for PipeWire 0.3 + +* Wed May 20 2020 Peter Robinson - 76.0.1-3 +- Build aarch64 again so aarch64 users get updates + +* Wed May 13 2020 Martin Stransky - 76.0.1-2 +- Added extra va-api frames to vp8/9 decoder. + +* Fri May 8 2020 Martin Stransky - 76.0.1-1 +- Updated to 76.0.1 + +* Thu May 7 2020 Martin Stransky - 76.0-3 +- Disable ffvpx when va-api is enabled. + +* Tue May 05 2020 Jan Horak - 76.0-2 +- Don't use google safe browsing api key for the geolocation + +* Sun May 3 2020 Martin Stransky - 76.0-1 +- Updated to 76.0 + +* Thu Apr 23 2020 Martin Stransky - 75.0-3 +- Added fix for mozilla bug #1527976 (browser D&D) + +* Tue Apr 14 2020 Jan Horak - 75.0-2 +- Removed gconf-2.0 build requirement + +* Mon Apr 06 2020 Martin Stransky - 75.0-1 +- Updated to 75.0 + +* Mon Apr 06 2020 Martin Stransky - 74.0.1-3 +- Added fix for mozbz#1627469 + +* Mon Apr 06 2020 Jan Horak - 74.0.1-2 +- Fixing pipewire patch + +* Sat Apr 4 2020 Martin Stransky - 74.0.1-1 +- Updated to latest upstream +- Added fix for mozbz#1624745 + +* Wed Apr 1 2020 Martin Stransky - 74.0-14 +- Added fixes to gnome shell search provider + +* Tue Mar 31 2020 Jan Horak - 74.0-13 +- Allow addons sideload to fix missing langpacks issues + +* Thu Mar 19 2020 Martin Stransky - 74.0-12 +- Added fix for rhbz#1814850 by Daniel Rusek + +* Tue Mar 17 2020 Martin Stransky - 74.0-11 +- Added fix for mozbz#1623106 + +* Tue Mar 17 2020 Martin Stransky - 74.0-9 +- Added fix for mozbz#1623060 + +* Tue Mar 17 2020 Jan Grulich - 74-0-8 +- Add support for window sharing + +* Mon Mar 16 2020 Martin Stransky - 74.0-7 +- Use D-Bus remote exclusively for both X11 and Wayland backends + when WAYLAND_DISPLAY is present. + +* Fri Mar 13 2020 Martin Stransky - 74.0-6 +- Added fix for mozbz#1615098 + +* Thu Mar 12 2020 Martin Stransky - 74.0-5 +- Added fix for mozbz#1196777 + +* Tue Mar 10 2020 Kalev Lember - 74.0-4 +- Remove unused libIDL build dep +- Disabled arm due to build failures + +* Tue Mar 10 2020 Martin Stransky - 74.0-3 +- Update to 74.0 Build 3 + +* Mon Mar 09 2020 Martin Stransky - 74.0-2 +- Update to 74.0 Build 2 + +* Tue Mar 03 2020 Martin Stransky - 74.0-1 +- Update to 74.0 Build 1 +- Added mozbz#1609538 + +* Mon Feb 24 2020 Martin Stransky - 73.0.1-4 +- Using pipewire-0.2 as buildrequire +- Added armv7hl fixes by Gabriel Hojda + +* Mon Feb 24 2020 Martin Stransky - 73.0.1-2 +- Fixed Bug 1804787 - Some .desktop menu entries unlocalized + +* Thu Feb 20 2020 Martin Stransky - 73.0.1-1 +- Update to 73.0.1 + +* Tue Feb 11 2020 Jan Horak - 73.0-1 +- Update to 73.0 build3 + +* Tue Feb 04 2020 Kalev Lember - 72.0.2-3 +- Fix various issues with appdata, making the validation pass again +- Validate appdata during the build +- Make sure the release tag in appdata is in sync with the package version + +* Tue Jan 28 2020 Fedora Release Engineering - 72.0.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Mon Jan 20 2020 Jan Horak - 72.0.2-1 +- Update to 72.0.2 build1 + +* Wed Jan 15 2020 Jan Horak - 72.0.1-2 +- Added fix for wrong cursor offset of popup windows and bumped required nss + version + +* Wed Jan 08 2020 Jan Horak - 72.0.1-1 +- Update to 72.0.1 build1 + +* Mon Jan 06 2020 Jan Horak - 72.0-2 +- Update to 72.0 build4 + +* Fri Jan 03 2020 Jan Horak - 72.0-1 +- Update to 72.0 build3 + +* Wed Dec 18 2019 Jan Horak - 71.0-17 +- Fix for wrong intl.accept_lang when using non en-us langpack + +* Mon Dec 9 2019 Martin Stransky - 71.0-16 +- Build with asan + +* Mon Dec 9 2019 Martin Stransky - 71.0-15 +- Enabled Mozilla crash reporter +- Enabled PGO builds + +* Mon Dec 9 2019 Martin Stransky - 71.0-14 +- Updated workaround for mzbz#1601707 + +* Sat Dec 7 2019 Martin Stransky - 71.0-13 +- Built with -fno-lifetime-dse + +* Fri Dec 6 2019 Martin Stransky - 71.0-12 +- Clang test build, should fix extension breakage + +* Fri Dec 6 2019 Martin Stransky - 71.0-11 +- Added workaround for: + https://bugzilla.mozilla.org/show_bug.cgi?id=1601707 + http://gcc.gnu.org/PR92831 + +* Fri Dec 6 2019 Martin Stransky - 71.0-10 +- Remove appdata and ship metainfo only + +* Wed Dec 4 2019 Martin Stransky - 71.0-9 +- Included kiosk mode workaround (mozbz#1594738) + +* Tue Dec 3 2019 Martin Stransky - 71.0-8 +- Disabled PGO due to startup crash + +* Mon Dec 2 2019 Martin Stransky - 71.0-7 +- Updated to 71.0 Build 5 +- Updated Gnome search provider + +* Wed Nov 27 2019 Martin Stransky - 71.0-6 +- Enable Gnome search provider + +* Wed Nov 27 2019 Martin Stransky - 71.0-5 +- Added fix for mozbz#1593408 +- Temporary disable Gnome search provider + +* Tue Nov 26 2019 Martin Stransky - 71.0-2 +- Enable Gnome search provider + +* Tue Nov 26 2019 Martin Stransky - 71.0-1 +- Updated to 71.0 Build 2 + +* Tue Nov 19 2019 Jan Horak - 70.0.1-5 +- Added fixes for missing popup and overflow widget glitches + +* Mon Nov 04 2019 Jan Horak - 70.0.1-4 +- Added fix for non-scrollable popups + +* Fri Nov 1 2019 Martin Stransky - 70.0.1-1 +- Updated to 70.0.1 +- Built with system-nss (reverted 70.0-2 change). + +* Thu Oct 31 2019 Martin Stransky - 70.0-2 +- Switched to in-tree nss due to rhbz#1752303 + +* Tue Oct 15 2019 Martin Stransky - 70.0-1 +- Updated to 70.0 diff --git a/fix-cargo-checksum b/fix-cargo-checksum new file mode 100755 index 0000000..bae2b2d --- /dev/null +++ b/fix-cargo-checksum @@ -0,0 +1,21 @@ +#!/bin/bash +if [ -z $1 ]; then + echo "Fixes .cargo-checksum.json by removing deleted files and recompute sha256sum" + echo "Usage: $0 .cargo-checksum.json" + exit +fi + +FILE=$1 +#set -x +cp $FILE $1.backup +for i in $(cat .cargo-checksum.json|jq -r '.files| keys[]'); do +if [ ! -f $i ]; then + #echo $i non exist + sed -ie "s|\"$i\":\"[^\"]*\",||" $FILE +else + SHA=`sha256sum $i | cut -d " " -f1` + sed -ie "s|\"$i\":\"[^\"]*\"|\"$i\":\"$SHA\"|" $FILE +fi + +#echo $i +done diff --git a/gen_cbindgen-vendor.sh b/gen_cbindgen-vendor.sh index afe171c..5711901 100755 --- a/gen_cbindgen-vendor.sh +++ b/gen_cbindgen-vendor.sh @@ -12,7 +12,7 @@ to be used with 'cargo vendor' commmand. """ [dependencies] -cbindgen = "0.8.2" +cbindgen = "0.29.1" [[bin]] name = "dummy" diff --git a/gen_dump_syms-vendor.sh b/gen_dump_syms-vendor.sh new file mode 100755 index 0000000..3854ad8 --- /dev/null +++ b/gen_dump_syms-vendor.sh @@ -0,0 +1,33 @@ +#!/bin/bash +set -x + +# Dummy Cargo.toml file with cbindgen dependency +cat > Cargo.toml </pref -+ rv = NS_GetSpecialDirectory(NS_APP_PREFS_SYSTEM_CONFIG_DIR, -+ getter_AddRefs(jsFile)); -+ NS_ENSURE_SUCCESS(rv, rv); -+ -+ rv = jsFile->AppendNative(NS_LITERAL_CSTRING("pref")); -+ NS_ENSURE_SUCCESS(rv, rv); -+ rv = jsFile->AppendNative(nsDependentCString(aFileName)); -+ NS_ENSURE_SUCCESS(rv, rv); - -+ rv = NS_NewLocalFileInputStream(getter_AddRefs(inStr), jsFile); -+ NS_ENSURE_SUCCESS(rv, rv); -+ } - } else { - nsAutoCString location("resource://gre/defaults/autoconfig/"); - location += aFileName; -diff -up firefox-67.0/modules/libpref/Preferences.cpp.1170092 firefox-67.0/modules/libpref/Preferences.cpp ---- firefox-67.0/modules/libpref/Preferences.cpp.1170092 2019-05-15 15:10:23.860653275 +0200 -+++ firefox-67.0/modules/libpref/Preferences.cpp 2019-05-15 15:11:58.160110320 +0200 -@@ -4417,6 +4417,9 @@ float MOZ_MAYBE_UNUSED GetPref(co - // - // Thus, in the omni.jar case, we always load app-specific default - // preferences from omni.jar, whether or not `$app == $gre`. -+ // -+ // At very end load configuration from system config location: -+ // - /etc/firefox/pref/*.js - - nsresult rv = NS_ERROR_FAILURE; - nsZipFind* findPtr; -diff -up firefox-67.0/toolkit/xre/nsXREDirProvider.cpp.1170092 firefox-67.0/toolkit/xre/nsXREDirProvider.cpp ---- firefox-67.0/toolkit/xre/nsXREDirProvider.cpp.1170092 2019-05-14 01:08:35.000000000 +0200 -+++ firefox-67.0/toolkit/xre/nsXREDirProvider.cpp 2019-05-15 15:10:23.861653269 +0200 -@@ -60,6 +60,7 @@ - #endif - #ifdef XP_UNIX - # include -+# include "nsIXULAppInfo.h" - #endif - #ifdef XP_IOS - # include "UIKitDirProvider.h" -@@ -524,6 +525,21 @@ nsXREDirProvider::GetFile(const char* aP - } - } - } -+ -+#if defined(XP_UNIX) -+ if (!strcmp(aProperty, NS_APP_PREFS_SYSTEM_CONFIG_DIR)) { -+ nsCString sysConfigDir = NS_LITERAL_CSTRING("/etc/"); -+ nsCOMPtr appInfo = do_GetService("@mozilla.org/xre/app-info;1"); -+ if (!appInfo) -+ return NS_ERROR_NOT_AVAILABLE; -+ nsCString appName; -+ appInfo->GetName(appName); -+ ToLowerCase(appName); -+ sysConfigDir.Append(appName); -+ return NS_NewNativeLocalFile(sysConfigDir, false, aFile); -+ } -+#endif -+ - if (NS_FAILED(rv) || !file) return NS_ERROR_FAILURE; - - if (ensureFilePermissions) { -@@ -880,6 +896,16 @@ nsresult nsXREDirProvider::GetFilesInter - LoadDirIntoArray(mXULAppDir, kAppendPrefDir, directories); - LoadDirsIntoArray(mAppBundleDirectories, kAppendPrefDir, directories); - -+ // Add /etc//pref/ directory if it exists -+ nsCOMPtr systemPrefDir; -+ rv = NS_GetSpecialDirectory(NS_APP_PREFS_SYSTEM_CONFIG_DIR, -+ getter_AddRefs(systemPrefDir)); -+ if (NS_SUCCEEDED(rv)) { -+ rv = systemPrefDir->AppendNative(NS_LITERAL_CSTRING("pref")); -+ if (NS_SUCCEEDED(rv)) -+ directories.AppendObject(systemPrefDir); -+ } -+ - rv = NS_NewArrayEnumerator(aResult, directories, NS_GET_IID(nsIFile)); - } else if (!strcmp(aProperty, NS_APP_CHROME_DIR_LIST)) { - // NS_APP_CHROME_DIR_LIST is only used to get default (native) icons -diff -up firefox-67.0/xpcom/io/nsAppDirectoryServiceDefs.h.1170092 firefox-67.0/xpcom/io/nsAppDirectoryServiceDefs.h ---- firefox-67.0/xpcom/io/nsAppDirectoryServiceDefs.h.1170092 2019-05-14 01:08:28.000000000 +0200 -+++ firefox-67.0/xpcom/io/nsAppDirectoryServiceDefs.h 2019-05-15 15:10:24.044652216 +0200 -@@ -62,6 +62,7 @@ - #define NS_APP_PREFS_DEFAULTS_DIR_LIST "PrefDL" - #define NS_APP_PREFS_OVERRIDE_DIR \ - "PrefDOverride" // Directory for per-profile defaults -+#define NS_APP_PREFS_SYSTEM_CONFIG_DIR "PrefSysConf" // Directory with system-wide configuration - - #define NS_APP_USER_PROFILE_50_DIR "ProfD" - #define NS_APP_USER_PROFILE_LOCAL_50_DIR "ProfLD" diff --git a/mozilla-1196777.patch b/mozilla-1196777.patch index 6606fe3..ac405c6 100644 --- a/mozilla-1196777.patch +++ b/mozilla-1196777.patch @@ -1,13 +1,12 @@ -diff -up firefox-65.0/widget/gtk/nsWindow.cpp.1196777 firefox-65.0/widget/gtk/nsWindow.cpp ---- firefox-65.0/widget/gtk/nsWindow.cpp.1196777 2019-01-28 14:37:27.470163867 +0100 -+++ firefox-65.0/widget/gtk/nsWindow.cpp 2019-01-28 14:41:52.479064393 +0100 -@@ -156,7 +156,8 @@ const gint kEvents = - #if GTK_CHECK_VERSION(3, 4, 0) - GDK_SMOOTH_SCROLL_MASK | GDK_TOUCH_MASK | - #endif -- GDK_SCROLL_MASK | GDK_POINTER_MOTION_MASK | GDK_PROPERTY_CHANGE_MASK; -+ GDK_SCROLL_MASK | GDK_POINTER_MOTION_MASK | GDK_PROPERTY_CHANGE_MASK | -+ GDK_FOCUS_CHANGE_MASK; +diff -up firefox-133.0/widget/gtk/nsWindow.cpp.1196777 firefox-133.0/widget/gtk/nsWindow.cpp +--- firefox-133.0/widget/gtk/nsWindow.cpp.1196777 2024-11-22 09:32:52.293470407 +0100 ++++ firefox-133.0/widget/gtk/nsWindow.cpp 2024-11-22 10:21:54.996441520 +0100 +@@ -191,7 +191,7 @@ constexpr gint kEvents = + GDK_VISIBILITY_NOTIFY_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | + GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_SMOOTH_SCROLL_MASK | + GDK_TOUCH_MASK | GDK_SCROLL_MASK | GDK_POINTER_MOTION_MASK | +- GDK_PROPERTY_CHANGE_MASK; ++ GDK_PROPERTY_CHANGE_MASK | GDK_FOCUS_CHANGE_MASK; /* utility functions */ - static bool is_mouse_in_window(GdkWindow *aWindow, gdouble aMouseX, + static bool is_mouse_in_window(GdkWindow* aWindow, gdouble aMouseX, diff --git a/mozilla-1337988.patch b/mozilla-1337988.patch deleted file mode 100644 index 8c40445..0000000 --- a/mozilla-1337988.patch +++ /dev/null @@ -1,496 +0,0 @@ -diff -up firefox-56.0/dom/plugins/base/nsJSNPRuntime.cpp.1337988 firefox-56.0/dom/plugins/base/nsJSNPRuntime.cpp ---- firefox-56.0/dom/plugins/base/nsJSNPRuntime.cpp.1337988 2017-09-14 22:15:56.000000000 +0200 -+++ firefox-56.0/dom/plugins/base/nsJSNPRuntime.cpp 2017-09-25 10:34:11.205611698 +0200 -@@ -1719,7 +1719,7 @@ NPObjWrapper_ObjectMoved(JSObject *obj, - auto entry = - static_cast(sNPObjWrappers->Search(npobj)); - MOZ_ASSERT(entry && entry->mJSObj); -- MOZ_ASSERT(entry->mJSObj == old); -+ MOZ_ASSERT(entry->mJSObj.unbarrieredGetPtr() == old); - entry->mJSObj = obj; - } - -diff -up firefox-56.0/js/ipc/JavaScriptShared.cpp.1337988 firefox-56.0/js/ipc/JavaScriptShared.cpp ---- firefox-56.0/js/ipc/JavaScriptShared.cpp.1337988 2017-07-31 18:20:47.000000000 +0200 -+++ firefox-56.0/js/ipc/JavaScriptShared.cpp 2017-09-25 10:34:11.205611698 +0200 -@@ -101,7 +101,7 @@ IdToObjectMap::has(const ObjectId& id, c - auto p = table_.lookup(id); - if (!p) - return false; -- return p->value() == obj; -+ return p->value().unbarrieredGet() == obj; - } - #endif - -diff -up firefox-56.0/js/public/RootingAPI.h.1337988 firefox-56.0/js/public/RootingAPI.h ---- firefox-56.0/js/public/RootingAPI.h.1337988 2017-07-31 18:20:47.000000000 +0200 -+++ firefox-56.0/js/public/RootingAPI.h 2017-09-25 10:34:11.206611695 +0200 -@@ -148,6 +148,10 @@ template - struct PersistentRootedMarker; - } /* namespace gc */ - -+#define DECLARE_POINTER_COMPARISON_OPS(T) \ -+ bool operator==(const T& other) const { return get() == other; } \ -+ bool operator!=(const T& other) const { return get() != other; } -+ - // Important: Return a reference so passing a Rooted, etc. to - // something that takes a |const T&| is not a GC hazard. - #define DECLARE_POINTER_CONSTREF_OPS(T) \ -@@ -237,8 +241,6 @@ class Heap : public js::HeapBase::value, - "Type T must be a public GC pointer type"); - public: -- using ElementType = T; -- - Heap() { - static_assert(sizeof(T) == sizeof(Heap), - "Heap must be binary compatible with T."); -@@ -385,8 +387,6 @@ template - class TenuredHeap : public js::HeapBase> - { - public: -- using ElementType = T; -- - TenuredHeap() : bits(0) { - static_assert(sizeof(T) == sizeof(TenuredHeap), - "TenuredHeap must be binary compatible with T."); -@@ -394,6 +394,9 @@ class TenuredHeap : public js::HeapBase< - explicit TenuredHeap(T p) : bits(0) { setPtr(p); } - explicit TenuredHeap(const TenuredHeap& p) : bits(0) { setPtr(p.getPtr()); } - -+ bool operator==(const TenuredHeap& other) { return bits == other.bits; } -+ bool operator!=(const TenuredHeap& other) { return bits != other.bits; } -+ - void setPtr(T newPtr) { - MOZ_ASSERT((reinterpret_cast(newPtr) & flagsMask) == 0); - if (newPtr) -@@ -470,8 +473,6 @@ class MOZ_NONHEAP_CLASS Handle : public - friend class JS::MutableHandle; - - public: -- using ElementType = T; -- - /* Creates a handle from a handle of a type convertible to T. */ - template - MOZ_IMPLICIT Handle(Handle handle, -@@ -533,6 +534,7 @@ class MOZ_NONHEAP_CLASS Handle : public - MOZ_IMPLICIT Handle(MutableHandle& root, - typename mozilla::EnableIf::value, int>::Type dummy = 0); - -+ DECLARE_POINTER_COMPARISON_OPS(T); - DECLARE_POINTER_CONSTREF_OPS(T); - DECLARE_NONPOINTER_ACCESSOR_METHODS(*ptr); - -@@ -559,8 +561,6 @@ template - class MOZ_STACK_CLASS MutableHandle : public js::MutableHandleBase> - { - public: -- using ElementType = T; -- - inline MOZ_IMPLICIT MutableHandle(Rooted* root); - inline MOZ_IMPLICIT MutableHandle(PersistentRooted* root); - -@@ -589,6 +589,7 @@ class MOZ_STACK_CLASS MutableHandle : pu - return h; - } - -+ DECLARE_POINTER_COMPARISON_OPS(T); - DECLARE_POINTER_CONSTREF_OPS(T); - DECLARE_NONPOINTER_ACCESSOR_METHODS(*ptr); - DECLARE_NONPOINTER_MUTABLE_ACCESSOR_METHODS(*ptr); -@@ -805,8 +806,6 @@ class MOZ_RAII Rooted : public js::Roote - } - - public: -- using ElementType = T; -- - template - explicit Rooted(const RootingContext& cx) - : ptr(GCPolicy::initial()) -@@ -839,6 +838,7 @@ class MOZ_RAII Rooted : public js::Roote - ptr = mozilla::Move(value); - } - -+ DECLARE_POINTER_COMPARISON_OPS(T); - DECLARE_POINTER_CONSTREF_OPS(T); - DECLARE_POINTER_ASSIGN_OPS(Rooted, T); - DECLARE_NONPOINTER_ACCESSOR_METHODS(ptr); -@@ -903,14 +903,13 @@ template - class MOZ_RAII FakeRooted : public RootedBase> - { - public: -- using ElementType = T; -- - template - explicit FakeRooted(CX* cx) : ptr(JS::GCPolicy::initial()) {} - - template - FakeRooted(CX* cx, T initial) : ptr(initial) {} - -+ DECLARE_POINTER_COMPARISON_OPS(T); - DECLARE_POINTER_CONSTREF_OPS(T); - DECLARE_POINTER_ASSIGN_OPS(FakeRooted, T); - DECLARE_NONPOINTER_ACCESSOR_METHODS(ptr); -@@ -931,8 +930,6 @@ template - class FakeMutableHandle : public js::MutableHandleBase> - { - public: -- using ElementType = T; -- - MOZ_IMPLICIT FakeMutableHandle(T* t) { - ptr = t; - } -@@ -1124,8 +1121,6 @@ class PersistentRooted : public js::Root - } - - public: -- using ElementType = T; -- - PersistentRooted() : ptr(GCPolicy::initial()) {} - - explicit PersistentRooted(RootingContext* cx) -@@ -1203,6 +1198,7 @@ class PersistentRooted : public js::Root - } - } - -+ DECLARE_POINTER_COMPARISON_OPS(T); - DECLARE_POINTER_CONSTREF_OPS(T); - DECLARE_POINTER_ASSIGN_OPS(PersistentRooted, T); - DECLARE_NONPOINTER_ACCESSOR_METHODS(ptr); -@@ -1234,8 +1230,6 @@ class JS_PUBLIC_API(ObjectPtr) - Heap value; - - public: -- using ElementType = JSObject*; -- - ObjectPtr() : value(nullptr) {} - - explicit ObjectPtr(JSObject* obj) : value(obj) {} -@@ -1342,177 +1336,6 @@ Swap(JS::TenuredHeap& aX, JS::Tenured - - } /* namespace mozilla */ - --namespace js { --namespace detail { -- --// DefineComparisonOps is a trait which selects which wrapper classes to define --// operator== and operator!= for. It supplies a getter function to extract the --// value to compare. This is used to avoid triggering the automatic read --// barriers where appropriate. --// --// If DefineComparisonOps is not specialized for a particular wrapper you may --// get errors such as 'invalid operands to binary expression' or 'no match for --// operator==' when trying to compare against instances of the wrapper. -- --template --struct DefineComparisonOps : mozilla::FalseType {}; -- --template --struct DefineComparisonOps> : mozilla::TrueType { -- static const T& get(const JS::Heap& v) { return v.unbarrieredGet(); } --}; -- --template --struct DefineComparisonOps> : mozilla::TrueType { -- static const T get(const JS::TenuredHeap& v) { return v.unbarrieredGetPtr(); } --}; -- --template <> --struct DefineComparisonOps : mozilla::TrueType { -- static const JSObject* get(const JS::ObjectPtr& v) { return v.unbarrieredGet(); } --}; -- --template --struct DefineComparisonOps> : mozilla::TrueType { -- static const T& get(const JS::Rooted& v) { return v.get(); } --}; -- --template --struct DefineComparisonOps> : mozilla::TrueType { -- static const T& get(const JS::Handle& v) { return v.get(); } --}; -- --template --struct DefineComparisonOps> : mozilla::TrueType { -- static const T& get(const JS::MutableHandle& v) { return v.get(); } --}; -- --template --struct DefineComparisonOps> : mozilla::TrueType { -- static const T& get(const JS::PersistentRooted& v) { return v.get(); } --}; -- --template --struct DefineComparisonOps> : mozilla::TrueType { -- static const T& get(const js::FakeRooted& v) { return v.get(); } --}; -- --template --struct DefineComparisonOps> : mozilla::TrueType { -- static const T& get(const js::FakeMutableHandle& v) { return v.get(); } --}; -- --} /* namespace detail */ --} /* namespace js */ -- --// Overload operator== and operator!= for all types with the DefineComparisonOps --// trait using the supplied getter. --// --// There are four cases: -- --// Case 1: comparison between two wrapper objects. -- --template --typename mozilla::EnableIf::value && -- js::detail::DefineComparisonOps::value, bool>::Type --operator==(const T& a, const U& b) { -- return js::detail::DefineComparisonOps::get(a) == js::detail::DefineComparisonOps::get(b); --} -- --template --typename mozilla::EnableIf::value && -- js::detail::DefineComparisonOps::value, bool>::Type --operator!=(const T& a, const U& b) { -- return !(a == b); --} -- --// Case 2: comparison between a wrapper object and its unwrapped element type. -- --template --typename mozilla::EnableIf::value, bool>::Type --operator==(const T& a, const typename T::ElementType& b) { -- return js::detail::DefineComparisonOps::get(a) == b; --} -- --template --typename mozilla::EnableIf::value, bool>::Type --operator!=(const T& a, const typename T::ElementType& b) { -- return !(a == b); --} -- --template --typename mozilla::EnableIf::value, bool>::Type --operator==(const typename T::ElementType& a, const T& b) { -- return a == js::detail::DefineComparisonOps::get(b); --} -- --template --typename mozilla::EnableIf::value, bool>::Type --operator!=(const typename T::ElementType& a, const T& b) { -- return !(a == b); --} -- --// Case 3: For pointer wrappers, comparison between the wrapper and a const --// element pointer. -- --template --typename mozilla::EnableIf::value && -- mozilla::IsPointer::value, bool>::Type --operator==(const typename mozilla::RemovePointer::Type* a, const T& b) { -- return a == js::detail::DefineComparisonOps::get(b); --} -- --template --typename mozilla::EnableIf::value && -- mozilla::IsPointer::value, bool>::Type --operator!=(const typename mozilla::RemovePointer::Type* a, const T& b) { -- return !(a == b); --} -- --template --typename mozilla::EnableIf::value && -- mozilla::IsPointer::value, bool>::Type --operator==(const T& a, const typename mozilla::RemovePointer::Type* b) { -- return js::detail::DefineComparisonOps::get(a) == b; --} -- --template --typename mozilla::EnableIf::value && -- mozilla::IsPointer::value, bool>::Type --operator!=(const T& a, const typename mozilla::RemovePointer::Type* b) { -- return !(a == b); --} -- --// Case 4: For pointer wrappers, comparison between the wrapper and nullptr. -- --template --typename mozilla::EnableIf::value && -- mozilla::IsPointer::value, bool>::Type --operator==(std::nullptr_t a, const T& b) { -- return a == js::detail::DefineComparisonOps::get(b); --} -- --template --typename mozilla::EnableIf::value && -- mozilla::IsPointer::value, bool>::Type --operator!=(std::nullptr_t a, const T& b) { -- return !(a == b); --} -- --template --typename mozilla::EnableIf::value && -- mozilla::IsPointer::value, bool>::Type --operator==(const T& a, std::nullptr_t b) { -- return js::detail::DefineComparisonOps::get(a) == b; --} -- --template --typename mozilla::EnableIf::value && -- mozilla::IsPointer::value, bool>::Type --operator!=(const T& a, std::nullptr_t b) { -- return !(a == b); --} -- - #undef DELETE_ASSIGNMENT_OPS - - #endif /* js_RootingAPI_h */ -diff -up firefox-56.0/js/src/gc/Barrier.h.1337988 firefox-56.0/js/src/gc/Barrier.h ---- firefox-56.0/js/src/gc/Barrier.h.1337988 2017-09-14 22:16:01.000000000 +0200 -+++ firefox-56.0/js/src/gc/Barrier.h 2017-09-25 10:34:11.206611695 +0200 -@@ -353,8 +353,8 @@ class WriteBarrieredBase : public Barrie - explicit WriteBarrieredBase(const T& v) : BarrieredBase(v) {} - - public: -- using ElementType = T; - -+ DECLARE_POINTER_COMPARISON_OPS(T); - DECLARE_POINTER_CONSTREF_OPS(T); - - // Use this if the automatic coercion to T isn't working. -@@ -612,13 +612,14 @@ class ReadBarriered : public ReadBarrier - return *this; - } - -- const T& get() const { -- if (InternalBarrierMethods::isMarkable(this->value)) -- this->read(); -+ const T get() const { -+ if (!InternalBarrierMethods::isMarkable(this->value)) -+ return JS::GCPolicy::initial(); -+ this->read(); - return this->value; - } - -- const T& unbarrieredGet() const { -+ const T unbarrieredGet() const { - return this->value; - } - -@@ -626,9 +627,9 @@ class ReadBarriered : public ReadBarrier - return bool(this->value); - } - -- operator const T&() const { return get(); } -+ operator const T() const { return get(); } - -- const T& operator->() const { return get(); } -+ const T operator->() const { return get(); } - - T* unsafeGet() { return &this->value; } - T const* unsafeGet() const { return &this->value; } -@@ -955,35 +956,6 @@ typedef ReadBarriered - - typedef ReadBarriered ReadBarrieredValue; - --namespace detail { -- --template --struct DefineComparisonOps> : mozilla::TrueType { -- static const T& get(const PreBarriered& v) { return v.get(); } --}; -- --template --struct DefineComparisonOps> : mozilla::TrueType { -- static const T& get(const GCPtr& v) { return v.get(); } --}; -- --template --struct DefineComparisonOps> : mozilla::TrueType { -- static const T& get(const HeapPtr& v) { return v.get(); } --}; -- --template --struct DefineComparisonOps> : mozilla::TrueType { -- static const T& get(const ReadBarriered& v) { return v.unbarrieredGet(); } --}; -- --template <> --struct DefineComparisonOps : mozilla::TrueType { -- static const Value& get(const HeapSlot& v) { return v.get(); } --}; -- --} /* namespace detail */ -- - } /* namespace js */ - - #endif /* gc_Barrier_h */ -diff -up firefox-56.0/js/src/jsapi-tests/testGCHeapPostBarriers.cpp.1337988 firefox-56.0/js/src/jsapi-tests/testGCHeapPostBarriers.cpp ---- firefox-56.0/js/src/jsapi-tests/testGCHeapPostBarriers.cpp.1337988 2017-09-14 22:16:02.000000000 +0200 -+++ firefox-56.0/js/src/jsapi-tests/testGCHeapPostBarriers.cpp 2017-09-25 10:34:11.206611695 +0200 -@@ -5,7 +5,6 @@ - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - --#include "mozilla/TypeTraits.h" - #include "mozilla/UniquePtr.h" - - #include "js/RootingAPI.h" -diff -up firefox-56.0/js/src/vm/SharedMem.h.1337988 firefox-56.0/js/src/vm/SharedMem.h ---- firefox-56.0/js/src/vm/SharedMem.h.1337988 2017-06-15 22:52:29.000000000 +0200 -+++ firefox-56.0/js/src/vm/SharedMem.h 2017-09-25 10:34:11.206611695 +0200 -@@ -12,8 +12,8 @@ - template - class SharedMem - { -- // static_assert(mozilla::IsPointer::value, -- // "SharedMem encapsulates pointer types"); -+ static_assert(mozilla::IsPointer::value, -+ "SharedMem encapsulates pointer types"); - - enum Sharedness { - IsUnshared, -diff -up firefox-56.0/js/xpconnect/src/XPCInlines.h.1337988 firefox-56.0/js/xpconnect/src/XPCInlines.h ---- firefox-56.0/js/xpconnect/src/XPCInlines.h.1337988 2017-09-14 22:16:03.000000000 +0200 -+++ firefox-56.0/js/xpconnect/src/XPCInlines.h 2017-09-25 10:34:11.206611695 +0200 -@@ -465,7 +465,7 @@ inline - void XPCWrappedNativeTearOff::JSObjectMoved(JSObject* obj, const JSObject* old) - { - MOZ_ASSERT(!IsMarked()); -- MOZ_ASSERT(mJSObject == old); -+ MOZ_ASSERT(mJSObject.unbarrieredGetPtr() == old); - mJSObject = obj; - } - -diff -up firefox-56.0/js/xpconnect/src/XPCWrappedNative.cpp.1337988 firefox-56.0/js/xpconnect/src/XPCWrappedNative.cpp ---- firefox-56.0/js/xpconnect/src/XPCWrappedNative.cpp.1337988 2017-09-14 22:16:03.000000000 +0200 -+++ firefox-56.0/js/xpconnect/src/XPCWrappedNative.cpp 2017-09-25 10:34:11.207611692 +0200 -@@ -874,7 +874,7 @@ void - XPCWrappedNative::FlatJSObjectMoved(JSObject* obj, const JSObject* old) - { - JS::AutoAssertGCCallback inCallback; -- MOZ_ASSERT(mFlatJSObject == old); -+ MOZ_ASSERT(mFlatJSObject.unbarrieredGetPtr() == old); - - nsWrapperCache* cache = nullptr; - CallQueryInterface(mIdentity, &cache); -diff -up firefox-56.0/js/xpconnect/src/XPCWrappedNativeProto.cpp.1337988 firefox-56.0/js/xpconnect/src/XPCWrappedNativeProto.cpp ---- firefox-56.0/js/xpconnect/src/XPCWrappedNativeProto.cpp.1337988 2017-07-31 18:20:47.000000000 +0200 -+++ firefox-56.0/js/xpconnect/src/XPCWrappedNativeProto.cpp 2017-09-25 10:34:11.207611692 +0200 -@@ -101,7 +101,7 @@ XPCWrappedNativeProto::CallPostCreatePro - void - XPCWrappedNativeProto::JSProtoObjectFinalized(js::FreeOp* fop, JSObject* obj) - { -- MOZ_ASSERT(obj == mJSProtoObject, "huh?"); -+ MOZ_ASSERT(obj == mJSProtoObject.unbarrieredGet(), "huh?"); - - #ifdef DEBUG - // Check that this object has already been swept from the map. -@@ -117,7 +117,7 @@ XPCWrappedNativeProto::JSProtoObjectFina - void - XPCWrappedNativeProto::JSProtoObjectMoved(JSObject* obj, const JSObject* old) - { -- MOZ_ASSERT(mJSProtoObject == old); -+ MOZ_ASSERT(mJSProtoObject.unbarrieredGet() == old); - mJSProtoObject.init(obj); // Update without triggering barriers. - } - diff --git a/mozilla-1353817.patch b/mozilla-1353817.patch deleted file mode 100644 index dc8d8f8..0000000 --- a/mozilla-1353817.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 1cc652f5525f458b0b4ceb12af24bf5a4367db32 Mon Sep 17 00:00:00 2001 -From: Nicolas Dufresne -Date: Tue, 23 May 2017 13:09:48 -0400 -Subject: [PATCH] Bug 1353817: Include SkNx_neon.h for ARM64 too - -This fixes build errors as arm_neon.h was missing along with some -missing converters. ---- - gfx/skia/skia/src/core/SkNx.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gfx/skia/skia/src/core/SkNx.h b/gfx/skia/skia/src/core/SkNx.h -index 6bca856..b0427aa 100644 ---- a/gfx/skia/skia/src/core/SkNx.h -+++ b/gfx/skia/skia/src/core/SkNx.h -@@ -299,7 +299,7 @@ typedef SkNx<4, uint32_t> Sk4u; - // Include platform specific specializations if available. - #if !defined(SKNX_NO_SIMD) && SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 - #include "../opts/SkNx_sse.h" --#elif !defined(SKNX_NO_SIMD) && defined(SK_ARM_HAS_NEON) -+#elif !defined(SKNX_NO_SIMD) && (defined(SK_ARM_HAS_NEON) || defined(SK_CPU_ARM64)) - #include "../opts/SkNx_neon.h" - #else - --- -2.9.4 - diff --git a/mozilla-1423598-popup.patch b/mozilla-1423598-popup.patch deleted file mode 100644 index bacac7d..0000000 --- a/mozilla-1423598-popup.patch +++ /dev/null @@ -1,203 +0,0 @@ -diff -up firefox-67.0/widget/gtk/nsWindow.cpp.mozilla-1423598-popup firefox-67.0/widget/gtk/nsWindow.cpp ---- firefox-67.0/widget/gtk/nsWindow.cpp.mozilla-1423598-popup 2019-05-15 15:21:25.590222702 +0200 -+++ firefox-67.0/widget/gtk/nsWindow.cpp 2019-05-15 15:24:26.925439991 +0200 -@@ -1115,13 +1115,89 @@ void nsWindow::Move(double aX, double aY - NotifyRollupGeometryChange(); - } - -+#ifdef DEBUG -+static void NativeMoveResizeWaylandPopupCallback(GdkWindow *window, -+ const GdkRectangle *flipped_rect, const GdkRectangle *final_rect, -+ gboolean flipped_x, gboolean flipped_y, void *unused) -+{ -+ LOG(("NativeMoveResizeWaylandPopupCallback flipped %d %d\n", -+ flipped_rect->x, flipped_rect->y)); -+ LOG(("NativeMoveResizeWaylandPopupCallback final %d %d\n", -+ final_rect->x, final_rect->y)); -+} -+#endif -+ -+void nsWindow::NativeMoveResizeWaylandPopup(GdkPoint* aPosition, GdkRectangle* aSize) { -+ // Available as of GTK 3.24+ -+ static auto sGdkWindowMoveToRect = -+ (void (*)(GdkWindow *, const GdkRectangle *, GdkGravity, GdkGravity, -+ GdkAnchorHints, gint, gint)) -+ dlsym(RTLD_DEFAULT, "gdk_window_move_to_rect"); -+ -+ if (aSize) { -+ gtk_window_resize(GTK_WINDOW(mShell), aSize->width, aSize->height); -+ } -+ if (!sGdkWindowMoveToRect) { -+ gtk_window_move(GTK_WINDOW(mShell), aPosition->x, aPosition->y); -+ return; -+ } -+ -+ GdkWindow *gdkWindow = gtk_widget_get_window(GTK_WIDGET(mShell)); -+ if (!gdkWindow) { -+ return; -+ } -+ -+ GtkWidget* parentWidget = -+ GTK_WIDGET(gtk_window_get_transient_for(GTK_WINDOW(mShell))); -+ -+ int x_parent, y_parent; -+ gdk_window_get_origin(gtk_widget_get_window(parentWidget), &x_parent, &y_parent); -+ -+ GdkRectangle rect = { aPosition->x - x_parent, -+ aPosition->y - y_parent, -+ 1, 1}; -+ if (aSize) { -+ rect.width = aSize->width; -+ rect.height = aSize->height; -+ } -+ -+#ifdef DEBUG -+ LOG(("NativeMoveResizeWaylandPopup request position %d,%d\n", -+ aPosition->x, aPosition->y)); -+ if (aSize) { -+ LOG(("NativeMoveResizeWaylandPopup request size %d,%d\n", -+ aSize->width, aSize->height)); -+ } -+ LOG(("NativeMoveResizeWaylandPopup result %d %d\n", rect.x, rect.y)); -+ g_signal_connect(gdkWindow, "moved-to-rect", -+ G_CALLBACK(NativeMoveResizeWaylandPopupCallback), this); -+#endif -+ -+ GdkGravity rectAnchor = GDK_GRAVITY_NORTH_WEST; -+ GdkGravity menuAnchor = GDK_GRAVITY_NORTH_WEST; -+ if (GetTextDirection() == GTK_TEXT_DIR_RTL) { -+ rectAnchor = GDK_GRAVITY_NORTH_EAST; -+ menuAnchor = GDK_GRAVITY_NORTH_EAST; -+ } -+ -+ GdkAnchorHints hints = GdkAnchorHints(GDK_ANCHOR_SLIDE | GDK_ANCHOR_FLIP); -+ if (aSize) { -+ hints = GdkAnchorHints(hints|GDK_ANCHOR_RESIZE); -+ } -+ -+ sGdkWindowMoveToRect(gdkWindow, &rect, rectAnchor, menuAnchor, hints, 0, 0); -+} -+ - void nsWindow::NativeMove() { - GdkPoint point = DevicePixelsToGdkPointRoundDown(mBounds.TopLeft()); -- -- if (mIsTopLevel) { -- gtk_window_move(GTK_WINDOW(mShell), point.x, point.y); -- } else if (mGdkWindow) { -- gdk_window_move(mGdkWindow, point.x, point.y); -+ if (!mIsX11Display && mIsTopLevel && mWindowType == eWindowType_popup) { -+ NativeMoveResizeWaylandPopup(&point, nullptr); -+ } else { -+ if (mIsTopLevel) { -+ gtk_window_move(GTK_WINDOW(mShell), point.x, point.y); -+ } else if (mGdkWindow) { -+ gdk_window_move(mGdkWindow, point.x, point.y); -+ } - } - } - -@@ -3412,11 +3488,6 @@ nsresult nsWindow::Create(nsIWidget *aPa - GDK_WINDOW_TYPE_HINT_DIALOG); - gtk_window_set_transient_for(GTK_WINDOW(mShell), topLevelParent); - } else if (mWindowType == eWindowType_popup) { -- // With popup windows, we want to control their position, so don't -- // wait for the window manager to place them (which wouldn't -- // happen with override-redirect windows anyway). -- NativeMove(); -- - gtk_window_set_wmclass(GTK_WINDOW(mShell), "Popup", - gdk_get_program_class()); - -@@ -3475,6 +3546,14 @@ nsresult nsWindow::Create(nsIWidget *aPa - if (topLevelParent) { - gtk_window_set_transient_for(GTK_WINDOW(mShell), topLevelParent); - } -+ -+ // We need realized mShell at NativeMove(). -+ gtk_widget_realize(mShell); -+ -+ // With popup windows, we want to control their position, so don't -+ // wait for the window manager to place them (which wouldn't -+ // happen with override-redirect windows anyway). -+ NativeMove(); - } else { // must be eWindowType_toplevel - SetDefaultIcon(); - gtk_window_set_wmclass(GTK_WINDOW(mShell), "Toplevel", -@@ -3918,23 +3997,27 @@ void nsWindow::NativeMoveResize() { - LOG(("nsWindow::NativeMoveResize [%p] %d %d %d %d\n", (void *)this, topLeft.x, - topLeft.y, size.width, size.height)); - -- if (mIsTopLevel) { -- // x and y give the position of the window manager frame top-left. -- gtk_window_move(GTK_WINDOW(mShell), topLeft.x, topLeft.y); -- // This sets the client window size. -- MOZ_ASSERT(size.width > 0 && size.height > 0, -- "Can't resize window smaller than 1x1."); -- gtk_window_resize(GTK_WINDOW(mShell), size.width, size.height); -- } else if (mContainer) { -- GtkAllocation allocation; -- allocation.x = topLeft.x; -- allocation.y = topLeft.y; -- allocation.width = size.width; -- allocation.height = size.height; -- gtk_widget_size_allocate(GTK_WIDGET(mContainer), &allocation); -- } else if (mGdkWindow) { -- gdk_window_move_resize(mGdkWindow, topLeft.x, topLeft.y, size.width, -- size.height); -+ if (!mIsX11Display && mIsTopLevel && mWindowType == eWindowType_popup) { -+ NativeMoveResizeWaylandPopup(&topLeft, &size); -+ } else { -+ if (mIsTopLevel) { -+ // x and y give the position of the window manager frame top-left. -+ gtk_window_move(GTK_WINDOW(mShell), topLeft.x, topLeft.y); -+ // This sets the client window size. -+ MOZ_ASSERT(size.width > 0 && size.height > 0, -+ "Can't resize window smaller than 1x1."); -+ gtk_window_resize(GTK_WINDOW(mShell), size.width, size.height); -+ } else if (mContainer) { -+ GtkAllocation allocation; -+ allocation.x = topLeft.x; -+ allocation.y = topLeft.y; -+ allocation.width = size.width; -+ allocation.height = size.height; -+ gtk_widget_size_allocate(GTK_WIDGET(mContainer), &allocation); -+ } else if (mGdkWindow) { -+ gdk_window_move_resize(mGdkWindow, topLeft.x, topLeft.y, size.width, -+ size.height); -+ } - } - - #ifdef MOZ_X11 -@@ -6818,3 +6901,18 @@ void nsWindow::ForceTitlebarRedraw(void) - RestyleHint{0}, nsChangeHint_RepaintFrame); - } - } -+ -+GtkTextDirection nsWindow::GetTextDirection() { -+ nsView *view = nsView::GetViewFor(this); -+ if (!view) { -+ return GTK_TEXT_DIR_LTR; -+ } -+ nsIFrame *frame = view->GetFrame(); -+ if (!frame) { -+ return GTK_TEXT_DIR_LTR; -+ } -+ -+ WritingMode wm = frame->GetWritingMode(); -+ bool isFrameRTL = !(wm.IsVertical() ? wm.IsVerticalLR() : wm.IsBidiLTR()); -+ return isFrameRTL ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR; -+} -diff -up firefox-67.0/widget/gtk/nsWindow.h.mozilla-1423598-popup firefox-67.0/widget/gtk/nsWindow.h ---- firefox-67.0/widget/gtk/nsWindow.h.mozilla-1423598-popup 2019-05-14 01:08:37.000000000 +0200 -+++ firefox-67.0/widget/gtk/nsWindow.h 2019-05-15 15:21:25.890221541 +0200 -@@ -460,6 +460,10 @@ class nsWindow final : public nsBaseWidg - nsWindow* GetTransientForWindowIfPopup(); - bool IsHandlingTouchSequence(GdkEventSequence* aSequence); - -+ void NativeMoveResizeWaylandPopup(GdkPoint* aPosition, GdkRectangle* aSize); -+ -+ GtkTextDirection GetTextDirection(); -+ - #ifdef MOZ_X11 - typedef enum {GTK_WIDGET_COMPOSIDED_DEFAULT = 0, - GTK_WIDGET_COMPOSIDED_DISABLED = 1, diff --git a/mozilla-1467127.patch b/mozilla-1467127.patch deleted file mode 100644 index 69a8903..0000000 --- a/mozilla-1467127.patch +++ /dev/null @@ -1,256 +0,0 @@ -diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp ---- a/gfx/thebes/gfxPlatform.cpp -+++ b/gfx/thebes/gfxPlatform.cpp -@@ -70,6 +70,10 @@ - # include "mozilla/gfx/DeviceManagerDx.h" - #endif - -+#ifdef MOZ_WAYLAND -+# include "mozilla/widget/nsWaylandDisplayShutdown.h" -+#endif -+ - #include "nsGkAtoms.h" - #include "gfxPlatformFontList.h" - #include "gfxContext.h" -@@ -1276,6 +1280,9 @@ - layers::PaintThread::Shutdown(); - } - } else if (XRE_IsParentProcess()) { -+#ifdef MOZ_WAYLAND -+ widget::WaylandDisplayShutdown(); -+#endif - gfx::VRManagerChild::ShutDown(); - layers::CompositorManagerChild::Shutdown(); - layers::ImageBridgeChild::ShutDown(); -diff --git a/widget/gtk/WindowSurfaceWayland.cpp b/widget/gtk/WindowSurfaceWayland.cpp ---- a/widget/gtk/WindowSurfaceWayland.cpp -+++ b/widget/gtk/WindowSurfaceWayland.cpp -@@ -144,6 +144,8 @@ - (wl_buffer/wl_surface). - */ - -+#define EVENT_LOOP_DELAY (1000 / 240) -+ - #define BUFFER_BPP 4 - gfx::SurfaceFormat WindowBackBuffer::mFormat = gfx::SurfaceFormat::B8G8R8A8; - -diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build ---- a/widget/gtk/moz.build -+++ b/widget/gtk/moz.build -@@ -101,6 +101,9 @@ - 'nsWaylandDisplay.cpp', - 'WindowSurfaceWayland.cpp', - ] -+ EXPORTS.mozilla.widget += [ -+ 'nsWaylandDisplayShutdown.h' -+ ] - - if CONFIG['ACCESSIBILITY']: - UNIFIED_SOURCES += [ -diff --git a/widget/gtk/nsAppShell.cpp b/widget/gtk/nsAppShell.cpp ---- a/widget/gtk/nsAppShell.cpp -+++ b/widget/gtk/nsAppShell.cpp -@@ -27,6 +27,9 @@ - #include "ScreenHelperGTK.h" - #include "HeadlessScreenHelper.h" - #include "mozilla/widget/ScreenManager.h" -+#ifdef MOZ_WAYLAND -+# include "nsWaylandDisplay.h" -+#endif - - using mozilla::LazyLogModule; - using mozilla::Unused; -@@ -267,5 +270,9 @@ - } - - bool nsAppShell::ProcessNextNativeEvent(bool mayWait) { -- return g_main_context_iteration(nullptr, mayWait); -+ bool ret = g_main_context_iteration(nullptr, mayWait); -+#ifdef MOZ_WAYLAND -+ WaylandDispatchDisplays(); -+#endif -+ return ret; - } -diff --git a/widget/gtk/nsWaylandDisplay.h b/widget/gtk/nsWaylandDisplay.h ---- a/widget/gtk/nsWaylandDisplay.h -+++ b/widget/gtk/nsWaylandDisplay.h -@@ -14,10 +14,6 @@ - namespace mozilla { - namespace widget { - --// TODO: Bug 1467125 - We need to integrate wl_display_dispatch_queue_pending() --// with compositor event loop. --#define EVENT_LOOP_DELAY (1000 / 240) -- - // Our general connection to Wayland display server, - // holds our display connection and runs event loop. - class nsWaylandDisplay { -@@ -25,9 +21,10 @@ - explicit nsWaylandDisplay(wl_display* aDisplay); - virtual ~nsWaylandDisplay(); - -- bool DisplayLoop(); -+ bool DispatchEventQueue(); - bool Matches(wl_display* aDisplay); - -+ MessageLoop* GetDispatcherThreadLoop() { return mDispatcherThreadLoop; } - wl_display* GetDisplay() { return mDisplay; }; - wl_event_queue* GetEventQueue() { return mEventQueue; }; - wl_subcompositor* GetSubcompositor(void) { return mSubcompositor; }; -@@ -47,7 +44,10 @@ - void SetPrimarySelectionDeviceManager( - gtk_primary_selection_device_manager* aPrimarySelectionDeviceManager); - -+ void Shutdown(); -+ - private: -+ MessageLoop* mDispatcherThreadLoop; - PRThread* mThreadId; - wl_display* mDisplay; - wl_event_queue* mEventQueue; -@@ -59,6 +59,7 @@ - wl_registry* mRegistry; - }; - -+void WaylandDispatchDisplays(); - nsWaylandDisplay* WaylandDisplayGet(GdkDisplay* aGdkDisplay = nullptr); - - } // namespace widget -diff --git a/widget/gtk/nsWaylandDisplay.cpp b/widget/gtk/nsWaylandDisplay.cpp ---- a/widget/gtk/nsWaylandDisplay.cpp -+++ b/widget/gtk/nsWaylandDisplay.cpp -@@ -21,6 +21,15 @@ - static nsWaylandDisplay *gWaylandDisplays[MAX_DISPLAY_CONNECTIONS]; - static StaticMutex gWaylandDisplaysMutex; - -+void WaylandDisplayShutdown() { -+ StaticMutexAutoLock lock(gWaylandDisplaysMutex); -+ for (auto &display : gWaylandDisplays) { -+ if (display) { -+ display->Shutdown(); -+ } -+ } -+} -+ - static void ReleaseDisplaysAtExit() { - for (int i = 0; i < MAX_DISPLAY_CONNECTIONS; i++) { - delete gWaylandDisplays[i]; -@@ -28,6 +37,10 @@ - } - } - -+static void DispatchDisplay(nsWaylandDisplay *aDisplay) { -+ aDisplay->DispatchEventQueue(); -+} -+ - // Each thread which is using wayland connection (wl_display) has to operate - // its own wl_event_queue. Main Firefox thread wl_event_queue is handled - // by Gtk main loop, other threads/wl_event_queue has to be handled by us. -@@ -35,7 +48,15 @@ - // nsWaylandDisplay is our interface to wayland compositor. It provides wayland - // global objects as we need (wl_display, wl_shm) and operates wl_event_queue on - // compositor (not the main) thread. --static void WaylandDisplayLoop(wl_display *aDisplay); -+void WaylandDispatchDisplays() { -+ StaticMutexAutoLock lock(gWaylandDisplaysMutex); -+ for (auto &display : gWaylandDisplays) { -+ if (display && display->GetDispatcherThreadLoop()) { -+ display->GetDispatcherThreadLoop()->PostTask(NewRunnableFunction( -+ "WaylandDisplayDispatch", &DispatchDisplay, display)); -+ } -+ } -+} - - // Get WaylandDisplay for given wl_display and actual calling thread. - static nsWaylandDisplay *WaylandDisplayGetLocked(GdkDisplay *aGdkDisplay, -@@ -73,27 +94,6 @@ - return WaylandDisplayGetLocked(aGdkDisplay, lock); - } - --static void WaylandDisplayLoopLocked(wl_display *aDisplay, -- const StaticMutexAutoLock &) { -- for (auto &display : gWaylandDisplays) { -- if (display && display->Matches(aDisplay)) { -- if (display->DisplayLoop()) { -- MessageLoop::current()->PostDelayedTask( -- NewRunnableFunction("WaylandDisplayLoop", &WaylandDisplayLoop, -- aDisplay), -- EVENT_LOOP_DELAY); -- } -- break; -- } -- } --} -- --static void WaylandDisplayLoop(wl_display *aDisplay) { -- MOZ_ASSERT(!NS_IsMainThread()); -- StaticMutexAutoLock lock(gWaylandDisplaysMutex); -- WaylandDisplayLoopLocked(aDisplay, lock); --} -- - void nsWaylandDisplay::SetShm(wl_shm *aShm) { mShm = aShm; } - - void nsWaylandDisplay::SetSubcompositor(wl_subcompositor *aSubcompositor) { -@@ -158,7 +158,7 @@ - static const struct wl_registry_listener registry_listener = { - global_registry_handler, global_registry_remover}; - --bool nsWaylandDisplay::DisplayLoop() { -+bool nsWaylandDisplay::DispatchEventQueue() { - wl_display_dispatch_queue_pending(mDisplay, mEventQueue); - return true; - } -@@ -168,7 +168,8 @@ - } - - nsWaylandDisplay::nsWaylandDisplay(wl_display *aDisplay) -- : mThreadId(PR_GetCurrentThread()), -+ : mDispatcherThreadLoop(nullptr), -+ mThreadId(PR_GetCurrentThread()), - mDisplay(aDisplay), - mEventQueue(nullptr), - mDataDeviceManager(nullptr), -@@ -186,15 +187,16 @@ - wl_display_roundtrip(mDisplay); - wl_display_roundtrip(mDisplay); - } else { -+ mDispatcherThreadLoop = MessageLoop::current(); - mEventQueue = wl_display_create_queue(mDisplay); -- MessageLoop::current()->PostTask(NewRunnableFunction( -- "WaylandDisplayLoop", &WaylandDisplayLoop, mDisplay)); - wl_proxy_set_queue((struct wl_proxy *)mRegistry, mEventQueue); - wl_display_roundtrip_queue(mDisplay, mEventQueue); - wl_display_roundtrip_queue(mDisplay, mEventQueue); - } - } - -+void nsWaylandDisplay::Shutdown() { mDispatcherThreadLoop = nullptr; } -+ - nsWaylandDisplay::~nsWaylandDisplay() { - // Owned by Gtk+, we don't need to release - mDisplay = nullptr; -diff --git a/widget/gtk/nsWaylandDisplayShutdown.h b/widget/gtk/nsWaylandDisplayShutdown.h -new file mode 100644 ---- /dev/null -+++ b/widget/gtk/nsWaylandDisplayShutdown.h -@@ -0,0 +1,19 @@ -+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -+/* vim:expandtab:shiftwidth=4:tabstop=4: -+ */ -+/* This Source Code Form is subject to the terms of the Mozilla Public -+ * License, v. 2.0. If a copy of the MPL was not distributed with this -+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -+ -+#ifndef __MOZ_WAYLAND_DISPLAY_SHUTDOWN_H__ -+#define __MOZ_WAYLAND_DISPLAY_SHUTDOWN_H__ -+ -+namespace mozilla { -+namespace widget { -+ -+void WaylandDisplayShutdown(); -+ -+} // namespace widget -+} // namespace mozilla -+ -+#endif // __MOZ_WAYLAND_DISPLAY_SHUTDOWN_H__ - diff --git a/mozilla-1468911.patch b/mozilla-1468911.patch deleted file mode 100644 index 209a5a7..0000000 --- a/mozilla-1468911.patch +++ /dev/null @@ -1,276 +0,0 @@ -changeset: 465236:be9a6c98a4a7 -tag: tip -user: Martin Stransky -date: Mon Mar 18 10:42:48 2019 +0100 -summary: tearing - - -diff --git a/widget/gtk/nsAppShell.cpp b/widget/gtk/nsAppShell.cpp ---- a/widget/gtk/nsAppShell.cpp -+++ b/widget/gtk/nsAppShell.cpp -@@ -35,16 +35,17 @@ using mozilla::widget::ScreenHelperGTK; - using mozilla::widget::ScreenManager; - - #define NOTIFY_TOKEN 0xFA - - LazyLogModule gWidgetLog("Widget"); - LazyLogModule gWidgetFocusLog("WidgetFocus"); - LazyLogModule gWidgetDragLog("WidgetDrag"); - LazyLogModule gWidgetDrawLog("WidgetDraw"); -+LazyLogModule gWidgetWaylandLog("WidgetWayland"); - - static GPollFunc sPollFunc; - - // Wrapper function to disable hang monitoring while waiting in poll(). - static gint PollWrapper(GPollFD* ufds, guint nfsd, gint timeout_) { - mozilla::BackgroundHangMonitor().NotifyWait(); - gint result; - { - -diff -up firefox-66.0/widget/gtk/WindowSurfaceWayland.cpp.old firefox-66.0/widget/gtk/WindowSurfaceWayland.cpp ---- firefox-66.0/widget/gtk/WindowSurfaceWayland.cpp.old 2019-03-20 15:48:52.265966904 +0100 -+++ firefox-66.0/widget/gtk/WindowSurfaceWayland.cpp 2019-03-20 14:48:21.082035284 +0100 -@@ -20,6 +20,18 @@ - #include - #include - -+#undef LOG -+#ifdef MOZ_LOGGING -+# include "mozilla/Logging.h" -+# include "nsTArray.h" -+# include "Units.h" -+extern mozilla::LazyLogModule gWidgetWaylandLog; -+# define LOGWAYLAND(args) \ -+ MOZ_LOG(gWidgetWaylandLog, mozilla::LogLevel::Debug, args) -+#else -+# define LOGWAYLAND(args) -+#endif /* MOZ_LOGGING */ -+ - namespace mozilla { - namespace widget { - -@@ -241,7 +253,7 @@ WaylandShmPool::~WaylandShmPool() { - - static void buffer_release(void* data, wl_buffer* buffer) { - auto surface = reinterpret_cast(data); -- surface->Detach(); -+ surface->Detach(buffer); - } - - static const struct wl_buffer_listener buffer_listener = {buffer_release}; -@@ -261,9 +273,16 @@ void WindowBackBuffer::Create(int aWidth - - mWidth = aWidth; - mHeight = aHeight; -+ -+ LOGWAYLAND(( -+ "%s [%p] wl_buffer %p ID %d\n", __PRETTY_FUNCTION__, (void*)this, -+ (void*)mWaylandBuffer, -+ mWaylandBuffer ? wl_proxy_get_id((struct wl_proxy*)mWaylandBuffer) : -1)); - } - - void WindowBackBuffer::Release() { -+ LOGWAYLAND(("%s [%p]\n", __PRETTY_FUNCTION__, (void*)this)); -+ - wl_buffer_destroy(mWaylandBuffer); - mWidth = mHeight = 0; - } -@@ -288,6 +307,9 @@ WindowBackBuffer::~WindowBackBuffer() { - bool WindowBackBuffer::Resize(int aWidth, int aHeight) { - if (aWidth == mWidth && aHeight == mHeight) return true; - -+ LOGWAYLAND( -+ ("%s [%p] %d %d\n", __PRETTY_FUNCTION__, (void*)this, aWidth, aHeight)); -+ - Release(); - Create(aWidth, aHeight); - -@@ -295,13 +317,26 @@ bool WindowBackBuffer::Resize(int aWidth - } - - void WindowBackBuffer::Attach(wl_surface* aSurface) { -+ LOGWAYLAND(( -+ "%s [%p] wl_surface %p ID %d wl_buffer %p ID %d\n", __PRETTY_FUNCTION__, -+ (void*)this, (void*)aSurface, -+ aSurface ? wl_proxy_get_id((struct wl_proxy*)aSurface) : -1, -+ (void*)mWaylandBuffer, -+ mWaylandBuffer ? wl_proxy_get_id((struct wl_proxy*)mWaylandBuffer) : -1)); -+ - wl_surface_attach(aSurface, mWaylandBuffer, 0, 0); - wl_surface_commit(aSurface); - wl_display_flush(mWaylandDisplay->GetDisplay()); - mAttached = true; - } - --void WindowBackBuffer::Detach() { mAttached = false; } -+void WindowBackBuffer::Detach(wl_buffer* aBuffer) { -+ LOGWAYLAND(("%s [%p] wl_buffer %p ID %d\n", __PRETTY_FUNCTION__, (void*)this, -+ (void*)aBuffer, -+ aBuffer ? wl_proxy_get_id((struct wl_proxy*)aBuffer) : -1)); -+ -+ mAttached = false; -+} - - bool WindowBackBuffer::SetImageDataFromBuffer( - class WindowBackBuffer* aSourceBuffer) { -@@ -316,6 +351,11 @@ bool WindowBackBuffer::SetImageDataFromB - } - - already_AddRefed WindowBackBuffer::Lock() { -+ LOGWAYLAND(( -+ "%s [%p] [%d x %d] wl_buffer %p ID %d\n", __PRETTY_FUNCTION__, -+ (void*)this, mWidth, mHeight, (void*)mWaylandBuffer, -+ mWaylandBuffer ? wl_proxy_get_id((struct wl_proxy*)mWaylandBuffer) : -1)); -+ - gfx::IntSize lockSize(mWidth, mHeight); - return gfxPlatform::CreateDrawTargetForData( - static_cast(mShmPool.GetImageData()), lockSize, -@@ -345,7 +385,8 @@ WindowSurfaceWayland::WindowSurfaceWayla - mPendingCommit(false), - mWaylandBufferFullScreenDamage(false), - mIsMainThread(NS_IsMainThread()), -- mNeedScaleFactorUpdate(true) { -+ mNeedScaleFactorUpdate(true), -+ mWaitToFullScreenUpdate(true) { - for (int i = 0; i < BACK_BUFFER_NUM; i++) mBackupBuffer[i] = nullptr; - } - -@@ -387,7 +428,11 @@ WindowSurfaceWayland::~WindowSurfaceWayl - WindowBackBuffer* WindowSurfaceWayland::GetWaylandBufferToDraw(int aWidth, - int aHeight) { - if (!mWaylandBuffer) { -+ LOGWAYLAND(("%s [%p] Create [%d x %d]\n", __PRETTY_FUNCTION__, (void*)this, -+ aWidth, aHeight)); -+ - mWaylandBuffer = new WindowBackBuffer(mWaylandDisplay, aWidth, aHeight); -+ mWaitToFullScreenUpdate = true; - return mWaylandBuffer; - } - -@@ -396,8 +441,11 @@ WindowBackBuffer* WindowSurfaceWayland:: - mWaylandBuffer->Resize(aWidth, aHeight); - // There's a chance that scale factor has been changed - // when buffer size changed -- mNeedScaleFactorUpdate = true; -+ mWaitToFullScreenUpdate = true; - } -+ LOGWAYLAND(("%s [%p] Reuse buffer [%d x %d]\n", __PRETTY_FUNCTION__, -+ (void*)this, aWidth, aHeight)); -+ - return mWaylandBuffer; - } - -@@ -420,6 +468,8 @@ WindowBackBuffer* WindowSurfaceWayland:: - } - - if (MOZ_UNLIKELY(availableBuffer == BACK_BUFFER_NUM)) { -+ LOGWAYLAND(("%s [%p] No drawing buffer available!\n", __PRETTY_FUNCTION__, -+ (void*)this)); - NS_WARNING("No drawing buffer available"); - return nullptr; - } -@@ -429,6 +479,8 @@ WindowBackBuffer* WindowSurfaceWayland:: - mBackupBuffer[availableBuffer] = lastWaylandBuffer; - - if (lastWaylandBuffer->IsMatchingSize(aWidth, aHeight)) { -+ LOGWAYLAND(("%s [%p] Copy from old buffer [%d x %d]\n", __PRETTY_FUNCTION__, -+ (void*)this, aWidth, aHeight)); - // Former front buffer has the same size as a requested one. - // Gecko may expect a content already drawn on screen so copy - // existing data to the new buffer. -@@ -437,9 +489,12 @@ WindowBackBuffer* WindowSurfaceWayland:: - // (https://bugzilla.redhat.com/show_bug.cgi?id=1418260) - mWaylandBufferFullScreenDamage = true; - } else { -+ LOGWAYLAND(("%s [%p] Resize to [%d x %d]\n", __PRETTY_FUNCTION__, -+ (void*)this, aWidth, aHeight)); - // Former buffer has different size from the new request. Only resize - // the new buffer and leave gecko to render new whole content. - mWaylandBuffer->Resize(aWidth, aHeight); -+ mWaitToFullScreenUpdate = true; - } - - return mWaylandBuffer; -@@ -499,6 +554,10 @@ already_AddRefed Window - gfx::IntRect bounds = aRegion.GetBounds().ToUnknownRect(); - gfx::IntSize lockSize(bounds.XMost(), bounds.YMost()); - -+ LOGWAYLAND(("%s [%p] lockSize [%d x %d] screenSize [%d x %d]\n", -+ __PRETTY_FUNCTION__, (void*)this, lockSize.width, lockSize.height, -+ screenRect.width, lockSize.height)); -+ - // Are we asked for entire nsWindow to draw? - mDrawToWaylandBufferDirectly = - (aRegion.GetNumRects() == 1 && bounds.x == 0 && bounds.y == 0 && -@@ -510,6 +569,13 @@ already_AddRefed Window - LockWaylandBuffer(screenRect.width, screenRect.height, - mWindow->WaylandSurfaceNeedsClear()); - if (dt) { -+ // When we have a request to update whole screen at once -+ // (surface was created, resized or changed somehow) -+ // we also need update scale factor of the screen. -+ if (mWaitToFullScreenUpdate) { -+ mWaitToFullScreenUpdate = false; -+ mNeedScaleFactorUpdate = true; -+ } - return dt.forget(); - } - -@@ -576,6 +642,10 @@ static void WaylandBufferDelayCommitHand - void WindowSurfaceWayland::CommitWaylandBuffer() { - MOZ_ASSERT(mPendingCommit, "Committing empty surface!"); - -+ if (mWaitToFullScreenUpdate) { -+ return; -+ } -+ - wl_surface* waylandSurface = mWindow->GetWaylandSurface(); - if (!waylandSurface) { - // Target window is not created yet - delay the commit. This can happen only -@@ -619,6 +689,7 @@ void WindowSurfaceWayland::CommitWayland - LayoutDeviceIntRect rect = mWindow->GetBounds(); - wl_surface_damage(waylandSurface, 0, 0, rect.width, rect.height); - mWaylandBufferFullScreenDamage = false; -+ mNeedScaleFactorUpdate = true; - } else { - gint scaleFactor = mWindow->GdkScaleFactor(); - for (auto iter = mWaylandBufferDamage.RectIter(); !iter.Done(); -@@ -653,6 +724,18 @@ void WindowSurfaceWayland::CommitWayland - void WindowSurfaceWayland::Commit(const LayoutDeviceIntRegion& aInvalidRegion) { - MOZ_ASSERT(mIsMainThread == NS_IsMainThread()); - -+#ifdef DEBUG -+ { -+ LayoutDeviceIntRect screenRect = mWindow->GetBounds(); -+ gfx::IntRect bounds = aInvalidRegion.GetBounds().ToUnknownRect(); -+ gfx::IntSize lockSize(bounds.XMost(), bounds.YMost()); -+ -+ LOGWAYLAND(("%s [%p] lockSize [%d x %d] screenSize [%d x %d]\n", -+ __PRETTY_FUNCTION__, (void*)this, lockSize.width, -+ lockSize.height, screenRect.width, lockSize.height)); -+ } -+#endif -+ - // We have new content at mImageSurface - copy data to mWaylandBuffer first. - if (!mDrawToWaylandBufferDirectly) { - CommitImageSurfaceToWaylandBuffer(aInvalidRegion); -diff -up firefox-66.0/widget/gtk/WindowSurfaceWayland.h.old firefox-66.0/widget/gtk/WindowSurfaceWayland.h ---- firefox-66.0/widget/gtk/WindowSurfaceWayland.h.old 2019-03-20 15:48:56.218949138 +0100 -+++ firefox-66.0/widget/gtk/WindowSurfaceWayland.h 2019-03-20 14:48:21.082035284 +0100 -@@ -46,7 +46,7 @@ class WindowBackBuffer { - already_AddRefed Lock(); - - void Attach(wl_surface* aSurface); -- void Detach(); -+ void Detach(wl_buffer* aBuffer); - bool IsAttached() { return mAttached; } - - void Clear(); -@@ -118,6 +118,7 @@ class WindowSurfaceWayland : public Wind - bool mWaylandBufferFullScreenDamage; - bool mIsMainThread; - bool mNeedScaleFactorUpdate; -+ bool mWaitToFullScreenUpdate; - }; - - } // namespace widget diff --git a/mozilla-1508378.patch b/mozilla-1508378.patch deleted file mode 100644 index bbbce4b..0000000 --- a/mozilla-1508378.patch +++ /dev/null @@ -1,92 +0,0 @@ -changeset: 468935:3b964face103 -tag: tip -user: Martin Stransky -date: Wed Apr 10 15:14:32 2019 +0200 -summary: Bug 1508378 - Fix round error when damage rect size/position is odd number and scale factor is used, r=lsalzman - -diff --git a/widget/gtk/WindowSurfaceWayland.cpp b/widget/gtk/WindowSurfaceWayland.cpp ---- a/widget/gtk/WindowSurfaceWayland.cpp -+++ b/widget/gtk/WindowSurfaceWayland.cpp -@@ -624,16 +624,33 @@ static void WaylandBufferDelayCommitHand - } else { - // Referenced WindowSurfaceWayland is already deleted. - // Do nothing but just release the mDelayedCommitHandle allocated at - // WindowSurfaceWayland::CommitWaylandBuffer(). - free(aSurface); - } - } - -+void WindowSurfaceWayland::CalcRectScale(LayoutDeviceIntRect& aRect, int aScale) { -+ if (aRect.x & 0x1) { -+ aRect.width += 1; -+ } -+ aRect.x = aRect.x / aScale; -+ -+ if (aRect.y & 0x1) { -+ aRect.height += 1; -+ } -+ aRect.y = aRect.y / aScale; -+ -+ aRect.width = (aRect.width & 0x1) ? aRect.width / aScale + 1 : -+ aRect.width / aScale; -+ aRect.height = (aRect.height & 0x1) ? aRect.height / aScale + 1 : -+ aRect.height / aScale; -+} -+ - void WindowSurfaceWayland::CommitWaylandBuffer() { - MOZ_ASSERT(mPendingCommit, "Committing empty surface!"); - - if (mWaitToFullScreenUpdate) { - return; - } - - wl_surface* waylandSurface = mWindow->GetWaylandSurface(); -@@ -679,21 +696,23 @@ void WindowSurfaceWayland::CommitWayland - LayoutDeviceIntRect rect = mWindow->GetBounds(); - wl_surface_damage(waylandSurface, 0, 0, rect.width, rect.height); - mWaylandBufferFullScreenDamage = false; - mNeedScaleFactorUpdate = true; - } else { - gint scaleFactor = mWindow->GdkScaleFactor(); - for (auto iter = mWaylandBufferDamage.RectIter(); !iter.Done(); - iter.Next()) { -- const mozilla::LayoutDeviceIntRect& r = iter.Get(); -+ mozilla::LayoutDeviceIntRect r = iter.Get(); - // We need to remove the scale factor because the wl_surface_damage - // also multiplies by current scale factor. -- wl_surface_damage(waylandSurface, r.x / scaleFactor, r.y / scaleFactor, -- r.width / scaleFactor, r.height / scaleFactor); -+ if (scaleFactor > 1) { -+ CalcRectScale(r, scaleFactor); -+ } -+ wl_surface_damage(waylandSurface, r.x, r.y, r.width, r.height); - } - } - - // Clear all back buffer damage as we're committing - // all requested regions. - mWaylandBufferDamage.SetEmpty(); - - mFrameCallback = wl_surface_frame(waylandSurface); -diff --git a/widget/gtk/WindowSurfaceWayland.h b/widget/gtk/WindowSurfaceWayland.h ---- a/widget/gtk/WindowSurfaceWayland.h -+++ b/widget/gtk/WindowSurfaceWayland.h -@@ -96,16 +96,17 @@ class WindowSurfaceWayland : public Wind - WindowBackBuffer* GetWaylandBufferToDraw(int aWidth, int aHeight); - - already_AddRefed LockWaylandBuffer(int aWidth, int aHeight, - bool aClearBuffer); - already_AddRefed LockImageSurface( - const gfx::IntSize& aLockSize); - bool CommitImageSurfaceToWaylandBuffer(const LayoutDeviceIntRegion& aRegion); - void CommitWaylandBuffer(); -+ void CalcRectScale(LayoutDeviceIntRect& aRect, int scale); - - // TODO: Do we need to hold a reference to nsWindow object? - nsWindow* mWindow; - nsWaylandDisplay* mWaylandDisplay; - WindowBackBuffer* mWaylandBuffer; - LayoutDeviceIntRegion mWaylandBufferDamage; - WindowBackBuffer* mBackupBuffer[BACK_BUFFER_NUM]; - RefPtr mImageSurface; - diff --git a/mozilla-1516081.patch b/mozilla-1516081.patch deleted file mode 100644 index 8eec605..0000000 --- a/mozilla-1516081.patch +++ /dev/null @@ -1,38 +0,0 @@ -diff -up firefox-65.0/build/moz.configure/toolchain.configure.1516081 firefox-65.0/build/moz.configure/toolchain.configure ---- firefox-65.0/build/moz.configure/toolchain.configure.1516081 2019-01-24 19:48:38.000000000 +0100 -+++ firefox-65.0/build/moz.configure/toolchain.configure 2019-01-28 14:09:00.813320242 +0100 -@@ -1364,7 +1364,7 @@ def pgo_flags(compiler, build_env, targe - - if compiler.type == 'gcc': - return namespace( -- gen_cflags=['-fprofile-generate'], -+ gen_cflags=['-fprofile-generate', '-DMOZ_PROFILE_INSTRUMENTATION'], - gen_ldflags=['-fprofile-generate'], - use_cflags=['-fprofile-use', '-fprofile-correction', - '-Wcoverage-mismatch'], -@@ -1385,7 +1385,8 @@ def pgo_flags(compiler, build_env, targe - - if gen_ldflags: - return namespace( -- gen_cflags=['-fprofile-instr-generate'], -+ gen_cflags=['-fprofile-instr-generate', -+ '-DMOZ_PROFILE_INSTRUMENTATION'], - gen_ldflags=gen_ldflags, - use_cflags=['-fprofile-instr-use=%s' % profdata, - '-Wno-error=profile-instr-out-of-date', -diff -up firefox-65.0/toolkit/components/terminator/nsTerminator.cpp.1516081 firefox-65.0/toolkit/components/terminator/nsTerminator.cpp ---- firefox-65.0/toolkit/components/terminator/nsTerminator.cpp.1516081 2019-01-28 14:09:00.813320242 +0100 -+++ firefox-65.0/toolkit/components/terminator/nsTerminator.cpp 2019-01-28 14:11:56.745577302 +0100 -@@ -419,6 +419,12 @@ void nsTerminator::StartWatchdog() { - } - } - #endif -+ // Disable watchdog for PGO train builds - writting profile information at -+ // exit may take time and it is better to make build hang rather than -+ // silently produce poorly performing binary. -+#ifdef MOZ_PROFILE_INSTRUMENTATION -+ crashAfterMS = INT32_MAX; -+#endif - - UniquePtr options(new Options()); - const PRIntervalTime ticksDuration = PR_MillisecondsToInterval(1000); diff --git a/mozilla-1516803.patch b/mozilla-1516803.patch index f1f37f4..30d1fdf 100644 --- a/mozilla-1516803.patch +++ b/mozilla-1516803.patch @@ -1,16 +1,15 @@ -diff --git a/security/sandbox/linux/moz.build b/security/sandbox/linux/moz.build ---- a/security/sandbox/linux/moz.build -+++ b/security/sandbox/linux/moz.build -@@ -99,9 +99,8 @@ +diff -up firefox-84.0/security/sandbox/linux/moz.build.1516803 firefox-84.0/security/sandbox/linux/moz.build +--- firefox-84.0/security/sandbox/linux/moz.build.1516803 2020-12-10 16:17:55.425139545 +0100 ++++ firefox-84.0/security/sandbox/linux/moz.build 2020-12-10 16:29:21.945860841 +0100 +@@ -114,9 +114,8 @@ if CONFIG["CC_TYPE"] in ("clang", "gcc") # gcc lto likes to put the top level asm in syscall.cc in a different partition # from the function using it which breaks the build. Work around that by # forcing there to be only one partition. --for f in CONFIG['OS_CXXFLAGS']: -- if f.startswith('-flto') and CONFIG['CC_TYPE'] != 'clang': -- LDFLAGS += ['--param lto-partitions=1'] +-for f in CONFIG["OS_CXXFLAGS"]: +- if f.startswith("-flto") and CONFIG["CC_TYPE"] != "clang": +- LDFLAGS += ["--param lto-partitions=1"] +if CONFIG['CC_TYPE'] != 'clang': + LDFLAGS += ['--param', 'lto-partitions=1'] - DEFINES['NS_NO_XPCOM'] = True + DEFINES["NS_NO_XPCOM"] = True DisableStlWrapping() - diff --git a/mozilla-1517205.patch b/mozilla-1517205.patch deleted file mode 100644 index f200cbe..0000000 --- a/mozilla-1517205.patch +++ /dev/null @@ -1,209 +0,0 @@ -diff -up firefox-67.0/widget/gtk/mozcontainer.cpp.mozilla-1517205 firefox-67.0/widget/gtk/mozcontainer.cpp ---- firefox-67.0/widget/gtk/mozcontainer.cpp.mozilla-1517205 2019-05-15 16:00:23.366366060 +0200 -+++ firefox-67.0/widget/gtk/mozcontainer.cpp 2019-05-15 16:02:01.596967825 +0200 -@@ -567,8 +567,7 @@ struct wl_surface *moz_container_get_wl_ - moz_container_get_scale(container)); - - wl_surface_commit(container->surface); -- wl_display_flush(waylandDisplay->GetDisplay()); -- WaylandDisplayRelease(waylandDisplay); -+ wl_display_flush(waylandDisplay->GetDisplay()); - } - - return container->surface; -diff -up firefox-67.0/widget/gtk/nsClipboardWayland.cpp.mozilla-1517205 firefox-67.0/widget/gtk/nsClipboardWayland.cpp ---- firefox-67.0/widget/gtk/nsClipboardWayland.cpp.mozilla-1517205 2019-05-14 01:08:37.000000000 +0200 -+++ firefox-67.0/widget/gtk/nsClipboardWayland.cpp 2019-05-15 16:00:23.367366056 +0200 -@@ -639,7 +639,6 @@ static gboolean offer_hash_remove(gpoint - nsRetrievalContextWayland::~nsRetrievalContextWayland(void) { - g_hash_table_foreach_remove(mActiveOffers, offer_hash_remove, nullptr); - g_hash_table_destroy(mActiveOffers); -- WaylandDisplayRelease(mDisplay); - } - - GdkAtom *nsRetrievalContextWayland::GetTargets(int32_t aWhichClipboard, -diff -up firefox-67.0/widget/gtk/nsWaylandDisplay.cpp.mozilla-1517205 firefox-67.0/widget/gtk/nsWaylandDisplay.cpp ---- firefox-67.0/widget/gtk/nsWaylandDisplay.cpp.mozilla-1517205 2019-05-14 01:08:37.000000000 +0200 -+++ firefox-67.0/widget/gtk/nsWaylandDisplay.cpp 2019-05-15 16:00:23.368366052 +0200 -@@ -21,6 +21,13 @@ namespace widget { - static nsWaylandDisplay *gWaylandDisplays[MAX_DISPLAY_CONNECTIONS]; - static StaticMutex gWaylandDisplaysMutex; - -+static void ReleaseDisplaysAtExit() { -+ for (int i = 0; i < MAX_DISPLAY_CONNECTIONS; i++) { -+ delete gWaylandDisplays[i]; -+ gWaylandDisplays[i] = nullptr; -+ } -+} -+ - // Each thread which is using wayland connection (wl_display) has to operate - // its own wl_event_queue. Main Firefox thread wl_event_queue is handled - // by Gtk main loop, other threads/wl_event_queue has to be handled by us. -@@ -35,7 +42,6 @@ static nsWaylandDisplay *WaylandDisplayG - const StaticMutexAutoLock &) { - for (auto &display : gWaylandDisplays) { - if (display && display->Matches(aDisplay)) { -- NS_ADDREF(display); - return display; - } - } -@@ -43,7 +49,7 @@ static nsWaylandDisplay *WaylandDisplayG - for (auto &display : gWaylandDisplays) { - if (display == nullptr) { - display = new nsWaylandDisplay(aDisplay); -- NS_ADDREF(display); -+ atexit(ReleaseDisplaysAtExit); - return display; - } - } -@@ -67,26 +73,6 @@ nsWaylandDisplay *WaylandDisplayGet(GdkD - return WaylandDisplayGetLocked(display, lock); - } - --static bool WaylandDisplayReleaseLocked(nsWaylandDisplay *aDisplay, -- const StaticMutexAutoLock &) { -- for (auto &display : gWaylandDisplays) { -- if (display == aDisplay) { -- int rc = display->Release(); -- if (rc == 0) { -- display = nullptr; -- } -- return true; -- } -- } -- MOZ_ASSERT(false, "Missing nsWaylandDisplay for this thread!"); -- return false; --} -- --void WaylandDisplayRelease(nsWaylandDisplay *aDisplay) { -- StaticMutexAutoLock lock(gWaylandDisplaysMutex); -- WaylandDisplayReleaseLocked(aDisplay, lock); --} -- - static void WaylandDisplayLoopLocked(wl_display *aDisplay, - const StaticMutexAutoLock &) { - for (auto &display : gWaylandDisplays) { -@@ -130,6 +116,8 @@ static void global_registry_handler(void - uint32_t id, const char *interface, - uint32_t version) { - auto display = reinterpret_cast(data); -+ if (!display) -+ return; - - if (strcmp(interface, "wl_shm") == 0) { - auto shm = static_cast( -@@ -180,9 +168,7 @@ bool nsWaylandDisplay::Matches(wl_displa - return mThreadId == PR_GetCurrentThread() && aDisplay == mDisplay; - } - --NS_IMPL_ISUPPORTS(nsWaylandDisplay, nsISupports); -- --nsWaylandDisplay::nsWaylandDisplay(wl_display *aDisplay) -+nsWaylandDisplay::nsWaylandDisplay(wl_display* aDisplay) - : mThreadId(PR_GetCurrentThread()), - mDisplay(aDisplay), - mEventQueue(nullptr), -@@ -190,9 +176,10 @@ nsWaylandDisplay::nsWaylandDisplay(wl_di - mSubcompositor(nullptr), - mSeat(nullptr), - mShm(nullptr), -- mPrimarySelectionDeviceManager(nullptr) { -- wl_registry *registry = wl_display_get_registry(mDisplay); -- wl_registry_add_listener(registry, ®istry_listener, this); -+ mPrimarySelectionDeviceManager(nullptr), -+ mRegistry(nullptr) { -+ mRegistry = wl_display_get_registry(mDisplay); -+ wl_registry_add_listener(mRegistry, ®istry_listener, this); - - if (NS_IsMainThread()) { - // Use default event queue in main thread operated by Gtk+. -@@ -203,17 +190,19 @@ nsWaylandDisplay::nsWaylandDisplay(wl_di - mEventQueue = wl_display_create_queue(mDisplay); - MessageLoop::current()->PostTask(NewRunnableFunction( - "WaylandDisplayLoop", &WaylandDisplayLoop, mDisplay)); -- wl_proxy_set_queue((struct wl_proxy *)registry, mEventQueue); -+ wl_proxy_set_queue((struct wl_proxy *)mRegistry, mEventQueue); - wl_display_roundtrip_queue(mDisplay, mEventQueue); - wl_display_roundtrip_queue(mDisplay, mEventQueue); - } - } - - nsWaylandDisplay::~nsWaylandDisplay() { -- MOZ_ASSERT(mThreadId == PR_GetCurrentThread()); - // Owned by Gtk+, we don't need to release - mDisplay = nullptr; - -+ wl_registry_destroy(mRegistry); -+ mRegistry = nullptr; -+ - if (mEventQueue) { - wl_event_queue_destroy(mEventQueue); - mEventQueue = nullptr; -diff -up firefox-67.0/widget/gtk/nsWaylandDisplay.h.mozilla-1517205 firefox-67.0/widget/gtk/nsWaylandDisplay.h ---- firefox-67.0/widget/gtk/nsWaylandDisplay.h.mozilla-1517205 2019-05-14 01:08:27.000000000 +0200 -+++ firefox-67.0/widget/gtk/nsWaylandDisplay.h 2019-05-15 16:00:23.368366052 +0200 -@@ -20,11 +20,10 @@ namespace widget { - - // Our general connection to Wayland display server, - // holds our display connection and runs event loop. --class nsWaylandDisplay : public nsISupports { -- NS_DECL_THREADSAFE_ISUPPORTS -- -+class nsWaylandDisplay { - public: - explicit nsWaylandDisplay(wl_display* aDisplay); -+ virtual ~nsWaylandDisplay(); - - bool DisplayLoop(); - bool Matches(wl_display* aDisplay); -@@ -41,7 +40,6 @@ class nsWaylandDisplay : public nsISuppo - return mPrimarySelectionDeviceManager; - }; - -- public: - void SetShm(wl_shm* aShm); - void SetSubcompositor(wl_subcompositor* aSubcompositor); - void SetDataDeviceManager(wl_data_device_manager* aDataDeviceManager); -@@ -49,9 +47,7 @@ class nsWaylandDisplay : public nsISuppo - void SetPrimarySelectionDeviceManager( - gtk_primary_selection_device_manager* aPrimarySelectionDeviceManager); - -- private: -- virtual ~nsWaylandDisplay(); -- -+private: - PRThread* mThreadId; - wl_display* mDisplay; - wl_event_queue* mEventQueue; -@@ -60,10 +56,10 @@ class nsWaylandDisplay : public nsISuppo - wl_seat* mSeat; - wl_shm* mShm; - gtk_primary_selection_device_manager* mPrimarySelectionDeviceManager; -+ wl_registry *mRegistry; - }; - - nsWaylandDisplay* WaylandDisplayGet(GdkDisplay* aGdkDisplay = nullptr); --void WaylandDisplayRelease(nsWaylandDisplay* aDisplay); - - } // namespace widget - } // namespace mozilla -diff -up firefox-67.0/widget/gtk/WindowSurfaceWayland.cpp.mozilla-1517205 firefox-67.0/widget/gtk/WindowSurfaceWayland.cpp ---- firefox-67.0/widget/gtk/WindowSurfaceWayland.cpp.mozilla-1517205 2019-05-15 16:00:23.335366185 +0200 -+++ firefox-67.0/widget/gtk/WindowSurfaceWayland.cpp 2019-05-15 16:00:23.368366052 +0200 -@@ -413,16 +413,6 @@ WindowSurfaceWayland::~WindowSurfaceWayl - delete mBackupBuffer[i]; - } - } -- -- if (!mIsMainThread) { -- // We can be destroyed from main thread even though we was created/used -- // in compositor thread. We have to unref/delete WaylandDisplay in -- // compositor thread then and we can't use MessageLoop::current() here. -- mDisplayThreadMessageLoop->PostTask(NewRunnableFunction( -- "WaylandDisplayRelease", &WaylandDisplayRelease, mWaylandDisplay)); -- } else { -- WaylandDisplayRelease(mWaylandDisplay); -- } - } - - WindowBackBuffer* WindowSurfaceWayland::GetWaylandBufferToDraw(int aWidth, diff --git a/mozilla-1526243.patch b/mozilla-1526243.patch deleted file mode 100644 index 2d12378..0000000 --- a/mozilla-1526243.patch +++ /dev/null @@ -1,340 +0,0 @@ -changeset: 465480:a86f3560fb17 -parent: 465477:26d9b7ffbd6b -user: Martin Stransky -date: Fri Mar 29 15:30:15 2019 +0100 -summary: Bug 1526243 - [Linux] Don't use nsGConfService in nsGNOMEShellService.cpp, r=glandium - -diff --git a/browser/components/shell/nsGNOMEShellService.cpp b/browser/components/shell/nsGNOMEShellService.cpp ---- a/browser/components/shell/nsGNOMEShellService.cpp -+++ b/browser/components/shell/nsGNOMEShellService.cpp -@@ -10,17 +10,16 @@ - #include "nsShellService.h" - #include "nsIServiceManager.h" - #include "nsIFile.h" - #include "nsIProperties.h" - #include "nsDirectoryServiceDefs.h" - #include "nsIPrefService.h" - #include "prenv.h" - #include "nsString.h" --#include "nsIGConfService.h" - #include "nsIGIOService.h" - #include "nsIGSettingsService.h" - #include "nsIStringBundle.h" - #include "nsIOutputStream.h" - #include "nsIProcess.h" - #include "nsServiceManagerUtils.h" - #include "nsComponentManagerUtils.h" - #include "nsIImageLoadingContent.h" -@@ -65,48 +64,39 @@ static const ProtocolAssociation appProt - - static const MimeTypeAssociation appTypes[] = { - // clang-format off - { "text/html", "htm html shtml" }, - { "application/xhtml+xml", "xhtml xht" } - // clang-format on - }; - --// GConf registry key constants --#define DG_BACKGROUND "/desktop/gnome/background" -- --#define kDesktopImageKey DG_BACKGROUND "/picture_filename" --#define kDesktopOptionsKey DG_BACKGROUND "/picture_options" --#define kDesktopDrawBGKey DG_BACKGROUND "/draw_background" --#define kDesktopColorKey DG_BACKGROUND "/primary_color" -- - #define kDesktopBGSchema "org.gnome.desktop.background" - #define kDesktopImageGSKey "picture-uri" - #define kDesktopOptionGSKey "picture-options" - #define kDesktopDrawBGGSKey "draw-background" - #define kDesktopColorGSKey "primary-color" - - static bool IsRunningAsASnap() { return (PR_GetEnv("SNAP") != nullptr); } - - nsresult nsGNOMEShellService::Init() { - nsresult rv; - - if (gfxPlatform::IsHeadless()) { - return NS_ERROR_NOT_AVAILABLE; - } - -- // GConf, GSettings or GIO _must_ be available, or we do not allow -+ // GSettings or GIO _must_ be available, or we do not allow - // CreateInstance to succeed. - -- nsCOMPtr gconf = do_GetService(NS_GCONFSERVICE_CONTRACTID); - nsCOMPtr giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID); - nsCOMPtr gsettings = - do_GetService(NS_GSETTINGSSERVICE_CONTRACTID); - -- if (!gconf && !giovfs && !gsettings) return NS_ERROR_NOT_AVAILABLE; -+ if (!giovfs && !gsettings) return NS_ERROR_NOT_AVAILABLE; - - // Check G_BROKEN_FILENAMES. If it's set, then filenames in glib use - // the locale encoding. If it's not set, they use UTF-8. - mUseLocaleFilenames = PR_GetEnv("G_BROKEN_FILENAMES") != nullptr; - - if (GetAppPathFromLauncher()) return NS_OK; - - nsCOMPtr dirSvc( -@@ -212,35 +202,23 @@ nsGNOMEShellService::IsDefaultBrowser(bo - } - if (strcmp(output, "yes\n") == 0) { - *aIsDefaultBrowser = true; - } - g_free(output); - return NS_OK; - } - -- nsCOMPtr gconf = do_GetService(NS_GCONFSERVICE_CONTRACTID); - nsCOMPtr giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID); -- -- bool enabled; - nsAutoCString handler; - nsCOMPtr gioApp; - - for (unsigned int i = 0; i < ArrayLength(appProtocols); ++i) { - if (!appProtocols[i].essential) continue; - -- if (gconf) { -- handler.Truncate(); -- gconf->GetAppForProtocol(nsDependentCString(appProtocols[i].name), -- &enabled, handler); -- -- if (!CheckHandlerMatchesAppName(handler) || !enabled) -- return NS_OK; // the handler is disabled or set to another app -- } -- - if (giovfs) { - handler.Truncate(); - nsCOMPtr handlerApp; - giovfs->GetAppForURIScheme(nsDependentCString(appProtocols[i].name), - getter_AddRefs(handlerApp)); - gioApp = do_QueryInterface(handlerApp); - if (!gioApp) return NS_OK; - -@@ -270,39 +248,17 @@ nsGNOMEShellService::SetDefaultBrowser(b - GSpawnFlags flags = static_cast(G_SPAWN_SEARCH_PATH | - G_SPAWN_STDOUT_TO_DEV_NULL | - G_SPAWN_STDERR_TO_DEV_NULL); - g_spawn_sync(nullptr, (gchar **)argv, nullptr, flags, nullptr, nullptr, - nullptr, nullptr, nullptr, nullptr); - return NS_OK; - } - -- nsCOMPtr gconf = do_GetService(NS_GCONFSERVICE_CONTRACTID); - nsCOMPtr giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID); -- if (gconf) { -- nsAutoCString appKeyValue; -- if (mAppIsInPath) { -- // mAppPath is in the users path, so use only the basename as the launcher -- gchar *tmp = g_path_get_basename(mAppPath.get()); -- appKeyValue = tmp; -- g_free(tmp); -- } else { -- appKeyValue = mAppPath; -- } -- -- appKeyValue.AppendLiteral(" %s"); -- -- for (unsigned int i = 0; i < ArrayLength(appProtocols); ++i) { -- if (appProtocols[i].essential || aClaimAllTypes) { -- gconf->SetAppForProtocol(nsDependentCString(appProtocols[i].name), -- appKeyValue); -- } -- } -- } -- - if (giovfs) { - nsresult rv; - nsCOMPtr bundleService = - do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv); - NS_ENSURE_SUCCESS(rv, rv); - - nsCOMPtr brandBundle; - rv = bundleService->CreateBundle(BRAND_PROPERTIES, -@@ -353,19 +309,21 @@ nsGNOMEShellService::SetDefaultBrowser(b - } - - return NS_OK; - } - - NS_IMETHODIMP - nsGNOMEShellService::GetCanSetDesktopBackground(bool *aResult) { - // setting desktop background is currently only supported -- // for Gnome or desktops using the same GSettings and GConf keys -- const char *gnomeSession = getenv("GNOME_DESKTOP_SESSION_ID"); -- if (gnomeSession) { -+ // for Gnome or desktops using the same GSettings keys -+ const char *currentDesktop = getenv("XDG_CURRENT_DESKTOP"); -+ if (currentDesktop && -+ (strstr(currentDesktop, "GNOME-Flashback:GNOME") != nullptr || -+ strstr(currentDesktop, "GNOME") != nullptr)) { - *aResult = true; - } else { - *aResult = false; - } - - return NS_OK; - } - -@@ -439,20 +397,16 @@ nsGNOMEShellService::SetDesktopBackgroun - filePath.Append('/'); - filePath.Append(NS_ConvertUTF16toUTF8(brandName)); - filePath.AppendLiteral("_wallpaper.png"); - - // write the image to a file in the home dir - rv = WriteImage(filePath, container); - NS_ENSURE_SUCCESS(rv, rv); - -- // Try GSettings first. If we don't have GSettings or the right schema, fall -- // back to using GConf instead. Note that if GSettings works ok, the changes -- // get mirrored to GConf by the gsettings->gconf bridge in -- // gnome-settings-daemon - nsCOMPtr gsettings = - do_GetService(NS_GSETTINGSSERVICE_CONTRACTID); - if (gsettings) { - nsCOMPtr background_settings; - gsettings->GetCollectionForSchema(NS_LITERAL_CSTRING(kDesktopBGSchema), - getter_AddRefs(background_settings)); - if (background_settings) { - gchar *file_uri = g_filename_to_uri(filePath.get(), nullptr, nullptr); -@@ -465,32 +419,17 @@ nsGNOMEShellService::SetDesktopBackgroun - nsDependentCString(file_uri)); - g_free(file_uri); - background_settings->SetBoolean(NS_LITERAL_CSTRING(kDesktopDrawBGGSKey), - true); - return rv; - } - } - -- // if the file was written successfully, set it as the system wallpaper -- nsCOMPtr gconf = do_GetService(NS_GCONFSERVICE_CONTRACTID); -- -- if (gconf) { -- gconf->SetString(NS_LITERAL_CSTRING(kDesktopOptionsKey), options); -- -- // Set the image to an empty string first to force a refresh -- // (since we could be writing a new image on top of an existing -- // Firefox_wallpaper.png and nautilus doesn't monitor the file for changes) -- gconf->SetString(NS_LITERAL_CSTRING(kDesktopImageKey), EmptyCString()); -- -- gconf->SetString(NS_LITERAL_CSTRING(kDesktopImageKey), filePath); -- gconf->SetBool(NS_LITERAL_CSTRING(kDesktopDrawBGKey), true); -- } -- -- return rv; -+ return NS_ERROR_FAILURE; - } - - #define COLOR_16_TO_8_BIT(_c) ((_c) >> 8) - #define COLOR_8_TO_16_BIT(_c) ((_c) << 8 | (_c)) - - NS_IMETHODIMP - nsGNOMEShellService::GetDesktopBackgroundColor(uint32_t *aColor) { - nsCOMPtr gsettings = -@@ -502,22 +441,16 @@ nsGNOMEShellService::GetDesktopBackgroun - gsettings->GetCollectionForSchema(NS_LITERAL_CSTRING(kDesktopBGSchema), - getter_AddRefs(background_settings)); - if (background_settings) { - background_settings->GetString(NS_LITERAL_CSTRING(kDesktopColorGSKey), - background); - } - } - -- if (!background_settings) { -- nsCOMPtr gconf = do_GetService(NS_GCONFSERVICE_CONTRACTID); -- if (gconf) -- gconf->GetString(NS_LITERAL_CSTRING(kDesktopColorKey), background); -- } -- - if (background.IsEmpty()) { - *aColor = 0; - return NS_OK; - } - - GdkColor color; - gboolean success = gdk_color_parse(background.get(), &color); - -@@ -555,23 +488,17 @@ nsGNOMEShellService::SetDesktopBackgroun - getter_AddRefs(background_settings)); - if (background_settings) { - background_settings->SetString(NS_LITERAL_CSTRING(kDesktopColorGSKey), - colorString); - return NS_OK; - } - } - -- nsCOMPtr gconf = do_GetService(NS_GCONFSERVICE_CONTRACTID); -- -- if (gconf) { -- gconf->SetString(NS_LITERAL_CSTRING(kDesktopColorKey), colorString); -- } -- -- return NS_OK; -+ return NS_ERROR_FAILURE; - } - - NS_IMETHODIMP - nsGNOMEShellService::OpenApplication(int32_t aApplication) { - nsAutoCString scheme; - if (aApplication == APPLICATION_MAIL) - scheme.AssignLiteral("mailto"); - else if (aApplication == APPLICATION_NEWS) -@@ -581,55 +508,17 @@ nsGNOMEShellService::OpenApplication(int - - nsCOMPtr giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID); - if (giovfs) { - nsCOMPtr handlerApp; - giovfs->GetAppForURIScheme(scheme, getter_AddRefs(handlerApp)); - if (handlerApp) return handlerApp->LaunchWithURI(nullptr, nullptr); - } - -- nsCOMPtr gconf = do_GetService(NS_GCONFSERVICE_CONTRACTID); -- if (!gconf) return NS_ERROR_FAILURE; -- -- bool enabled; -- nsAutoCString appCommand; -- gconf->GetAppForProtocol(scheme, &enabled, appCommand); -- -- if (!enabled) return NS_ERROR_FAILURE; -- -- // XXX we don't currently handle launching a terminal window. -- // If the handler requires a terminal, bail. -- bool requiresTerminal; -- gconf->HandlerRequiresTerminal(scheme, &requiresTerminal); -- if (requiresTerminal) return NS_ERROR_FAILURE; -- -- // Perform shell argument expansion -- int argc; -- char **argv; -- if (!g_shell_parse_argv(appCommand.get(), &argc, &argv, nullptr)) -- return NS_ERROR_FAILURE; -- -- char **newArgv = new char *[argc + 1]; -- int newArgc = 0; -- -- // Run through the list of arguments. Copy all of them to the new -- // argv except for %s, which we skip. -- for (int i = 0; i < argc; ++i) { -- if (strcmp(argv[i], "%s") != 0) newArgv[newArgc++] = argv[i]; -- } -- -- newArgv[newArgc] = nullptr; -- -- gboolean err = g_spawn_async(nullptr, newArgv, nullptr, G_SPAWN_SEARCH_PATH, -- nullptr, nullptr, nullptr, nullptr); -- -- g_strfreev(argv); -- delete[] newArgv; -- -- return err ? NS_OK : NS_ERROR_FAILURE; -+ return NS_ERROR_FAILURE; - } - - NS_IMETHODIMP - nsGNOMEShellService::OpenApplicationWithURI(nsIFile *aApplication, - const nsACString &aURI) { - nsresult rv; - nsCOMPtr process = - do_CreateInstance("@mozilla.org/process/util;1", &rv); - diff --git a/mozilla-1532643-popup.patch b/mozilla-1532643-popup.patch deleted file mode 100644 index 3b870a2..0000000 --- a/mozilla-1532643-popup.patch +++ /dev/null @@ -1,71 +0,0 @@ -diff -up firefox-67.0/layout/xul/moz.build.mozilla-1532643-popup firefox-67.0/layout/xul/moz.build ---- firefox-67.0/layout/xul/moz.build.mozilla-1532643-popup 2019-05-14 01:08:24.000000000 +0200 -+++ firefox-67.0/layout/xul/moz.build 2019-05-15 15:31:39.714299754 +0200 -@@ -88,3 +88,6 @@ LOCAL_INCLUDES += [ - - if CONFIG['CC_TYPE'] in ('clang', 'gcc'): - CXXFLAGS += ['-Wno-error=shadow'] -+ -+CFLAGS += CONFIG['TK_CFLAGS'] -+CXXFLAGS += CONFIG['TK_CFLAGS'] -diff -up firefox-67.0/layout/xul/nsMenuPopupFrame.cpp.mozilla-1532643-popup firefox-67.0/layout/xul/nsMenuPopupFrame.cpp ---- firefox-67.0/layout/xul/nsMenuPopupFrame.cpp.mozilla-1532643-popup 2019-05-14 01:08:24.000000000 +0200 -+++ firefox-67.0/layout/xul/nsMenuPopupFrame.cpp 2019-05-15 15:37:01.121215863 +0200 -@@ -55,6 +55,10 @@ - #include "mozilla/dom/KeyboardEvent.h" - #include "mozilla/dom/KeyboardEventBinding.h" - #include -+#ifdef MOZ_WAYLAND -+#include -+#include -+#endif /* MOZ_WAYLAND */ - - using namespace mozilla; - using mozilla::dom::Document; -@@ -301,11 +305,29 @@ nsresult nsMenuPopupFrame::CreateWidgetF - !(mode == eTransparencyTransparent || tag == nsGkAtoms::menulist); - widgetData.mPopupLevel = PopupLevel(widgetData.mNoAutoHide); - -+ static bool waylandBackend = -+#ifdef MOZ_WAYLAND -+ !GDK_IS_X11_DISPLAY(gdk_display_get_default()); -+#else -+ false; -+#endif -+ - // panels which have a parent level need a parent widget. This allows them to - // always appear in front of the parent window but behind other windows that - // should be in front of it. - nsCOMPtr parentWidget; -- if (widgetData.mPopupLevel != ePopupLevelTop) { -+ if (waylandBackend) { -+ // On Wayland we always need to connect menu to its parent menu widget -+ // otherwise it's not shown. -+ nsMenuFrame* menuFrame = do_QueryFrame(GetParent()); -+ if (menuFrame) { -+ nsMenuParent* parentPopup = menuFrame->GetMenuParent(); -+ if (parentPopup && parentPopup->IsMenu()) { -+ parentWidget = -+ static_cast(parentPopup)->GetWidget(); -+ } -+ } -+ } else if (widgetData.mPopupLevel != ePopupLevelTop) { - nsCOMPtr dsti = PresContext()->GetDocShell(); - if (!dsti) return NS_ERROR_FAILURE; - -diff -up firefox-67.0/widget/gtk/nsWindow.cpp.mozilla-1532643-popup firefox-67.0/widget/gtk/nsWindow.cpp ---- firefox-67.0/widget/gtk/nsWindow.cpp.mozilla-1532643-popup 2019-05-15 15:31:39.712299764 +0200 -+++ firefox-67.0/widget/gtk/nsWindow.cpp 2019-05-15 15:31:39.716299744 +0200 -@@ -3527,11 +3527,7 @@ nsresult nsWindow::Create(nsIWidget *aPa - } else { - switch (aInitData->mPopupHint) { - case ePopupTypeMenu: -- // Use GDK_WINDOW_TYPE_HINT_UTILITY on Wayland which -- // guides Gtk to create the popup as subsurface -- // instead of xdg_shell popup (see Bug 1423598). -- gtkTypeHint = mIsX11Display ? GDK_WINDOW_TYPE_HINT_POPUP_MENU -- : GDK_WINDOW_TYPE_HINT_UTILITY; -+ gtkTypeHint = GDK_WINDOW_TYPE_HINT_POPUP_MENU; - break; - case ePopupTypeTooltip: - gtkTypeHint = GDK_WINDOW_TYPE_HINT_TOOLTIP; diff --git a/mozilla-1535567.patch b/mozilla-1535567.patch deleted file mode 100644 index 43b606c..0000000 --- a/mozilla-1535567.patch +++ /dev/null @@ -1,136 +0,0 @@ -diff -up firefox-67.0/widget/gtk/mozcontainer.cpp.mozilla-1535567 firefox-67.0/widget/gtk/mozcontainer.cpp ---- firefox-67.0/widget/gtk/mozcontainer.cpp.mozilla-1535567 2019-05-14 01:08:37.000000000 +0200 -+++ firefox-67.0/widget/gtk/mozcontainer.cpp 2019-05-15 15:56:19.645336209 +0200 -@@ -157,6 +157,7 @@ void moz_container_init(MozContainer *co - container->subsurface = nullptr; - container->eglwindow = nullptr; - container->frame_callback_handler = nullptr; -+ container->frame_callback_handler_surface_id = -1; - // We can draw to x11 window any time. - container->ready_to_draw = GDK_IS_X11_DISPLAY(gdk_display_get_default()); - container->surface_needs_clear = true; -@@ -165,6 +166,11 @@ void moz_container_init(MozContainer *co - } - - #if defined(MOZ_WAYLAND) -+void moz_container_set_initial_draw_callback( -+ MozContainer *container, std::function inital_draw_cb) { -+ container->inital_draw_cb = inital_draw_cb; -+} -+ - static wl_surface *moz_container_get_gtk_container_surface( - MozContainer *container) { - static auto sGdkWaylandWindowGetWlSurface = (wl_surface * (*)(GdkWindow *)) -@@ -178,37 +184,61 @@ static void frame_callback_handler(void - uint32_t time) { - MozContainer *container = MOZ_CONTAINER(data); - g_clear_pointer(&container->frame_callback_handler, wl_callback_destroy); -+ container->frame_callback_handler_surface_id = -1; - if (!container->ready_to_draw && container->inital_draw_cb) { - container->inital_draw_cb(); - } - container->ready_to_draw = true; - } - --void moz_container_set_initial_draw_callback( -- MozContainer *container, std::function inital_draw_cb) { -- container->inital_draw_cb = inital_draw_cb; --} -- - static const struct wl_callback_listener frame_listener = { - frame_callback_handler}; - --static gboolean moz_container_map_wayland(GtkWidget *widget, -- GdkEventAny *event) { -- MozContainer *container = MOZ_CONTAINER(widget); -- -- if (container->ready_to_draw || container->frame_callback_handler) { -- return FALSE; -- } -- -+static void moz_container_request_parent_frame_callback( -+ MozContainer *container) { - wl_surface *gtk_container_surface = - moz_container_get_gtk_container_surface(container); -+ int gtk_container_surface_id = -+ gtk_container_surface -+ ? wl_proxy_get_id((struct wl_proxy *)gtk_container_surface) -+ : -1; -+ -+ -+ -+ -+ -+ -+ -+ if (container->frame_callback_handler && -+ container->frame_callback_handler_surface_id == -+ gtk_container_surface_id) { -+ return; -+ } -+ -+ // If there's pending frame callback, delete it. -+ if (container->frame_callback_handler) { -+ g_clear_pointer(&container->frame_callback_handler, wl_callback_destroy); -+ } - - if (gtk_container_surface) { -+ container->frame_callback_handler_surface_id = gtk_container_surface_id; - container->frame_callback_handler = wl_surface_frame(gtk_container_surface); - wl_callback_add_listener(container->frame_callback_handler, &frame_listener, - container); -+ } else { -+ container->frame_callback_handler_surface_id = -1; -+ } -+} -+ -+static gboolean moz_container_map_wayland(GtkWidget *widget, -+ GdkEventAny *event) { -+ MozContainer *container = MOZ_CONTAINER(widget); -+ -+ if (container->ready_to_draw) { -+ return FALSE; - } - -+ moz_container_request_parent_frame_callback(MOZ_CONTAINER(widget)); - return FALSE; - } - -@@ -217,6 +247,7 @@ static void moz_container_unmap_wayland( - g_clear_pointer(&container->subsurface, wl_subsurface_destroy); - g_clear_pointer(&container->surface, wl_surface_destroy); - g_clear_pointer(&container->frame_callback_handler, wl_callback_destroy); -+ container->frame_callback_handler_surface_id = -1; - - container->surface_needs_clear = true; - container->ready_to_draw = false; -@@ -329,6 +360,10 @@ void moz_container_realize(GtkWidget *wi - : gtk_widget_get_visual(widget); - - window = gdk_window_new(parent, &attributes, attributes_mask); -+ -+ -+ -+ - gdk_window_set_user_data(window, widget); - } else { - window = parent; -@@ -498,6 +533,7 @@ static void moz_container_add(GtkContain - struct wl_surface *moz_container_get_wl_surface(MozContainer *container) { - if (!container->surface) { - if (!container->ready_to_draw) { -+ moz_container_request_parent_frame_callback(container); - return nullptr; - } - GdkDisplay *display = gtk_widget_get_display(GTK_WIDGET(container)); -diff -up firefox-67.0/widget/gtk/mozcontainer.h.mozilla-1535567 firefox-67.0/widget/gtk/mozcontainer.h ---- firefox-67.0/widget/gtk/mozcontainer.h.mozilla-1535567 2019-05-14 01:08:37.000000000 +0200 -+++ firefox-67.0/widget/gtk/mozcontainer.h 2019-05-15 15:50:59.440570372 +0200 -@@ -77,6 +77,7 @@ struct _MozContainer { - struct wl_subsurface *subsurface; - struct wl_egl_window *eglwindow; - struct wl_callback *frame_callback_handler; -+ int frame_callback_handler_surface_id; - gboolean surface_needs_clear; - gboolean ready_to_draw; - std::function inital_draw_cb; diff --git a/mozilla-1539471.patch b/mozilla-1539471.patch deleted file mode 100644 index 1a321d2..0000000 --- a/mozilla-1539471.patch +++ /dev/null @@ -1,206 +0,0 @@ -diff -up firefox-66.0.1/widget/gtk/nsWindow.cpp.mozilla-1539471 firefox-66.0.1/widget/gtk/nsWindow.cpp ---- firefox-66.0.1/widget/gtk/nsWindow.cpp.mozilla-1539471 2019-03-28 14:08:42.351128620 +0100 -+++ firefox-66.0.1/widget/gtk/nsWindow.cpp 2019-03-28 14:20:23.282890178 +0100 -@@ -312,6 +312,9 @@ static nsWindow *gFocusWindow = nullptr; - static bool gBlockActivateEvent = false; - static bool gGlobalsInitialized = false; - static bool gRaiseWindows = true; -+#ifdef MOZ_WAYLAND -+static GList *gCurrentPopupWindows = nullptr; -+#endif - - #if GTK_CHECK_VERSION(3, 4, 0) - static uint32_t gLastTouchID = 0; -@@ -1136,8 +1139,16 @@ void nsWindow::NativeMoveResizeWaylandPo - return; - } - -- GtkWidget* parentWidget = -- GTK_WIDGET(gtk_window_get_transient_for(GTK_WINDOW(mShell))); -+ GtkWidget *parentWidget; -+ if (mPopupType == ePopupTypeTooltip && gCurrentPopupWindows) { -+ // Attach tooltip window to the latest popup window -+ // to have both visible. -+ parentWidget = GTK_WIDGET(gCurrentPopupWindows->data); -+ gtk_window_set_transient_for(GTK_WINDOW(mShell), -+ GTK_WINDOW(parentWidget)); -+ } else { -+ parentWidget = GTK_WIDGET(gtk_window_get_transient_for(GTK_WINDOW(mShell))); -+ } - - int x_parent, y_parent; - gdk_window_get_origin(gtk_widget_get_window(parentWidget), &x_parent, &y_parent); -@@ -3489,7 +3500,7 @@ nsresult nsWindow::Create(nsIWidget *aPa - gtkTypeHint = GDK_WINDOW_TYPE_HINT_DND; - mIsDragPopup = true; - } else { -- switch (aInitData->mPopupHint) { -+ switch (mPopupType) { - case ePopupTypeMenu: - gtkTypeHint = GDK_WINDOW_TYPE_HINT_POPUP_MENU; - break; -@@ -3610,6 +3621,8 @@ nsresult nsWindow::Create(nsIWidget *aPa - return NS_ERROR_FAILURE; - - case eWindowType_child: { -+ MOZ_ASSERT(mIsX11Display, -+ "eWindowType_child is not supported on Wayland!"); - if (parentMozContainer) { - mGdkWindow = CreateGdkWindow(parentGdkWindow, parentMozContainer); - mHasMappedToplevel = parentnsWindow->mHasMappedToplevel; -@@ -3979,6 +3992,49 @@ void nsWindow::NativeMoveResize() { - } - } - -+#ifdef MOZ_WAYLAND -+void nsWindow::OpenToplevelWaylandWindow() { -+ // Wayland keeps strong popup window hierarchy. We need to track active -+ // (visible) popup windows and make sure we hide popup on the same level -+ // before we open another one on that level. It means that every open -+ // popup needs to have an unique parent. -+ if (mWindowType == eWindowType_popup) { -+ GtkWidget *parentWidget = -+ GTK_WIDGET(gtk_window_get_transient_for(GTK_WINDOW(mShell))); -+ -+ if (gCurrentPopupWindows) { -+ do { -+ GtkWidget *widget = GTK_WIDGET(gCurrentPopupWindows->data); -+ if (widget == parentWidget) { -+ break; -+ } -+ nsWindow* window = get_window_for_gtk_widget(widget); -+ NS_ASSERTION(window, "Unknown window in popup widget list!"); -+ window->CloseToplevelWaylandWindow(); -+ -+ } while (gCurrentPopupWindows != nullptr); -+ } -+ gCurrentPopupWindows = g_list_prepend(gCurrentPopupWindows, mShell); -+ } -+ -+ gtk_widget_show(mShell); -+} -+ -+void nsWindow::CloseToplevelWaylandWindow() { -+ if (mContainer && moz_container_has_wl_egl_window(mContainer)) { -+ // Because wl_egl_window is destroyed on moz_container_unmap(), -+ // the current compositor cannot use it anymore. To avoid crash, -+ // destroy the compositor & recreate a new compositor on next -+ // expose event. -+ DestroyLayerManager(); -+ } -+ if (mWindowType == eWindowType_popup) { -+ gCurrentPopupWindows = g_list_remove(gCurrentPopupWindows, mShell); -+ } -+ gtk_widget_hide(mShell); -+} -+#endif -+ - void nsWindow::NativeShow(bool aAction) { - if (aAction) { - // unset our flag now that our window has been shown -@@ -3990,51 +4046,55 @@ void nsWindow::NativeShow(bool aAction) - SetUserTimeAndStartupIDForActivatedWindow(mShell); - } - -- gtk_widget_show(mShell); -+#ifdef MOZ_WAYLAND -+ if (!mIsX11Display) { -+ OpenToplevelWaylandWindow(); -+ } else -+#endif -+ { -+ gtk_widget_show(mShell); -+ } - } else if (mContainer) { - gtk_widget_show(GTK_WIDGET(mContainer)); - } else if (mGdkWindow) { - gdk_window_show_unraised(mGdkWindow); - } - } else { --#ifdef MOZ_WAYLAND -- if (mContainer && moz_container_has_wl_egl_window(mContainer)) { -- // Because wl_egl_window is destroyed on moz_container_unmap(), -- // the current compositor cannot use it anymore. To avoid crash, -- // destroy the compositor & recreate a new compositor on next -- // expose event. -- DestroyLayerManager(); -- } --#endif -- - if (mIsTopLevel) { -- // Workaround window freezes on GTK versions before 3.21.2 by -- // ensuring that configure events get dispatched to windows before -- // they are unmapped. See bug 1225044. -- if (gtk_check_version(3, 21, 2) != nullptr && mPendingConfigures > 0) { -- GtkAllocation allocation; -- gtk_widget_get_allocation(GTK_WIDGET(mShell), &allocation); -- -- GdkEventConfigure event; -- PodZero(&event); -- event.type = GDK_CONFIGURE; -- event.window = mGdkWindow; -- event.send_event = TRUE; -- event.x = allocation.x; -- event.y = allocation.y; -- event.width = allocation.width; -- event.height = allocation.height; -- -- auto shellClass = GTK_WIDGET_GET_CLASS(mShell); -- for (unsigned int i = 0; i < mPendingConfigures; i++) { -- Unused << shellClass->configure_event(mShell, &event); -+#ifdef MOZ_WAYLAND -+ if (!mIsX11Display) { -+ CloseToplevelWaylandWindow(); -+ } else -+#endif -+ { -+ // Workaround window freezes on GTK versions before 3.21.2 by -+ // ensuring that configure events get dispatched to windows before -+ // they are unmapped. See bug 1225044. -+ if (gtk_check_version(3, 21, 2) != nullptr && mPendingConfigures > 0) { -+ GtkAllocation allocation; -+ gtk_widget_get_allocation(GTK_WIDGET(mShell), &allocation); -+ -+ GdkEventConfigure event; -+ PodZero(&event); -+ event.type = GDK_CONFIGURE; -+ event.window = mGdkWindow; -+ event.send_event = TRUE; -+ event.x = allocation.x; -+ event.y = allocation.y; -+ event.width = allocation.width; -+ event.height = allocation.height; -+ -+ auto shellClass = GTK_WIDGET_GET_CLASS(mShell); -+ for (unsigned int i = 0; i < mPendingConfigures; i++) { -+ Unused << shellClass->configure_event(mShell, &event); -+ } -+ mPendingConfigures = 0; - } -- mPendingConfigures = 0; -- } - -- gtk_widget_hide(mShell); -+ gtk_widget_hide(mShell); - -- ClearTransparencyBitmap(); // Release some resources -+ ClearTransparencyBitmap(); // Release some resources -+ } - } else if (mContainer) { - gtk_widget_hide(GTK_WIDGET(mContainer)); - } else if (mGdkWindow) { -diff -up firefox-66.0.1/widget/gtk/nsWindow.h.mozilla-1539471 firefox-66.0.1/widget/gtk/nsWindow.h ---- firefox-66.0.1/widget/gtk/nsWindow.h.mozilla-1539471 2019-03-28 14:08:42.345128639 +0100 -+++ firefox-66.0.1/widget/gtk/nsWindow.h 2019-03-28 14:08:42.355128607 +0100 -@@ -603,6 +603,11 @@ class nsWindow final : public nsBaseWidg - - void ForceTitlebarRedraw(); - -+#ifdef MOZ_WAYLAND -+ void OpenToplevelWaylandWindow(); -+ void CloseToplevelWaylandWindow(); -+#endif -+ - /** - * |mIMContext| takes all IME related stuff. - * diff --git a/mozilla-1540145.patch b/mozilla-1540145.patch deleted file mode 100644 index 755aa13..0000000 --- a/mozilla-1540145.patch +++ /dev/null @@ -1,156 +0,0 @@ -diff -up firefox-67.0/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp.mozilla-1540145 firefox-67.0/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp ---- firefox-67.0/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp.mozilla-1540145 2019-05-14 01:08:35.000000000 +0200 -+++ firefox-67.0/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp 2019-05-15 15:20:13.365502186 +0200 -@@ -34,16 +34,10 @@ class nsUnixSystemProxySettings final : - private: - ~nsUnixSystemProxySettings() = default; - -- nsCOMPtr mGConf; -- nsCOMPtr mGSettings; -+ nsCOMPtr mGSettings; - nsCOMPtr mProxySettings; - nsInterfaceHashtable - mSchemeProxySettings; -- bool IsProxyMode(const char* aMode); -- nsresult SetProxyResultFromGConf(const char* aKeyBase, const char* aType, -- nsACString& aResult); -- nsresult GetProxyFromGConf(const nsACString& aScheme, const nsACString& aHost, -- int32_t aPort, nsACString& aResult); - nsresult GetProxyFromGSettings(const nsACString& aScheme, - const nsACString& aHost, int32_t aPort, - nsACString& aResult); -@@ -68,16 +62,6 @@ void nsUnixSystemProxySettings::Init() { - NS_LITERAL_CSTRING("org.gnome.system.proxy"), - getter_AddRefs(mProxySettings)); - } -- if (!mProxySettings) { -- mGConf = do_GetService(NS_GCONFSERVICE_CONTRACTID); -- } --} -- --bool nsUnixSystemProxySettings::IsProxyMode(const char* aMode) { -- nsAutoCString mode; -- return NS_SUCCEEDED(mGConf->GetString( -- NS_LITERAL_CSTRING("/system/proxy/mode"), mode)) && -- mode.EqualsASCII(aMode); - } - - nsresult nsUnixSystemProxySettings::GetPACURI(nsACString& aResult) { -@@ -92,14 +76,8 @@ nsresult nsUnixSystemProxySettings::GetP - } - /* The org.gnome.system.proxy schema has been found, but auto mode is not - * set. Don't try the GConf and return empty string. */ -- aResult.Truncate(); -- return NS_OK; - } - -- if (mGConf && IsProxyMode("auto")) { -- return mGConf->GetString(NS_LITERAL_CSTRING("/system/proxy/autoconfig_url"), -- aResult); -- } - // Return an empty string when auto mode is not set. - aResult.Truncate(); - return NS_OK; -@@ -217,30 +195,6 @@ static nsresult GetProxyFromEnvironment( - return NS_OK; - } - --nsresult nsUnixSystemProxySettings::SetProxyResultFromGConf( -- const char* aKeyBase, const char* aType, nsACString& aResult) { -- nsAutoCString hostKey; -- hostKey.AppendASCII(aKeyBase); -- hostKey.AppendLiteral("host"); -- nsAutoCString host; -- nsresult rv = mGConf->GetString(hostKey, host); -- NS_ENSURE_SUCCESS(rv, rv); -- if (host.IsEmpty()) return NS_ERROR_FAILURE; -- -- nsAutoCString portKey; -- portKey.AppendASCII(aKeyBase); -- portKey.AppendLiteral("port"); -- int32_t port; -- rv = mGConf->GetInt(portKey, &port); -- NS_ENSURE_SUCCESS(rv, rv); -- -- /* When port is 0, proxy is not considered as enabled even if host is set. */ -- if (port == 0) return NS_ERROR_FAILURE; -- -- SetProxyResult(aType, host, port, aResult); -- return NS_OK; --} -- - nsresult nsUnixSystemProxySettings::SetProxyResultFromGSettings( - const char* aKeyBase, const char* aType, nsACString& aResult) { - nsDependentCString key(aKeyBase); -@@ -366,63 +320,6 @@ static bool HostIgnoredByProxy(const nsA - return memcmp(&ignoreAddr, &hostAddr, sizeof(PRIPv6Addr)) == 0; - } - --nsresult nsUnixSystemProxySettings::GetProxyFromGConf(const nsACString& aScheme, -- const nsACString& aHost, -- int32_t aPort, -- nsACString& aResult) { -- bool masterProxySwitch = false; -- mGConf->GetBool(NS_LITERAL_CSTRING("/system/http_proxy/use_http_proxy"), -- &masterProxySwitch); -- // if no proxy is set in GConf return NS_ERROR_FAILURE -- if (!(IsProxyMode("manual") || masterProxySwitch)) { -- return NS_ERROR_FAILURE; -- } -- -- nsCOMPtr ignoreList; -- if (NS_SUCCEEDED(mGConf->GetStringList( -- NS_LITERAL_CSTRING("/system/http_proxy/ignore_hosts"), -- getter_AddRefs(ignoreList))) && -- ignoreList) { -- uint32_t len = 0; -- ignoreList->GetLength(&len); -- for (uint32_t i = 0; i < len; ++i) { -- nsCOMPtr str = do_QueryElementAt(ignoreList, i); -- if (str) { -- nsAutoString s; -- if (NS_SUCCEEDED(str->GetData(s)) && !s.IsEmpty()) { -- if (HostIgnoredByProxy(NS_ConvertUTF16toUTF8(s), aHost)) { -- aResult.AppendLiteral("DIRECT"); -- return NS_OK; -- } -- } -- } -- } -- } -- -- bool useHttpProxyForAll = false; -- // This setting sometimes doesn't exist, don't bail on failure -- mGConf->GetBool(NS_LITERAL_CSTRING("/system/http_proxy/use_same_proxy"), -- &useHttpProxyForAll); -- -- nsresult rv; -- if (!useHttpProxyForAll) { -- rv = SetProxyResultFromGConf("/system/proxy/socks_", "SOCKS", aResult); -- if (NS_SUCCEEDED(rv)) return rv; -- } -- -- if (aScheme.LowerCaseEqualsLiteral("http") || useHttpProxyForAll) { -- rv = SetProxyResultFromGConf("/system/http_proxy/", "PROXY", aResult); -- } else if (aScheme.LowerCaseEqualsLiteral("https")) { -- rv = SetProxyResultFromGConf("/system/proxy/secure_", "PROXY", aResult); -- } else if (aScheme.LowerCaseEqualsLiteral("ftp")) { -- rv = SetProxyResultFromGConf("/system/proxy/ftp_", "PROXY", aResult); -- } else { -- rv = NS_ERROR_FAILURE; -- } -- -- return rv; --} -- - nsresult nsUnixSystemProxySettings::GetProxyFromGSettings( - const nsACString& aScheme, const nsACString& aHost, int32_t aPort, - nsACString& aResult) { -@@ -494,7 +391,6 @@ nsresult nsUnixSystemProxySettings::GetP - nsresult rv = GetProxyFromGSettings(aScheme, aHost, aPort, aResult); - if (NS_SUCCEEDED(rv)) return rv; - } -- if (mGConf) return GetProxyFromGConf(aScheme, aHost, aPort, aResult); - - return GetProxyFromEnvironment(aScheme, aHost, aPort, aResult); - } diff --git a/mozilla-1552590.patch b/mozilla-1552590.patch deleted file mode 100644 index 58d5b18..0000000 --- a/mozilla-1552590.patch +++ /dev/null @@ -1,2701 +0,0 @@ -changeset: 474982:24c0dda573b3 -parent: 474915:839cdad764d7 -user: Martin Stransky -date: Fri May 17 11:24:33 2019 +0200 -summary: Implement dmabuf surfaces - -diff --git a/gfx/2d/WaylandDMABufSurface.cpp b/gfx/2d/WaylandDMABufSurface.cpp -new file mode 100644 ---- /dev/null -+++ b/gfx/2d/WaylandDMABufSurface.cpp -@@ -0,0 +1,274 @@ -+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -+/* vim: set ts=8 sts=2 et sw=2 tw=80: */ -+/* This Source Code Form is subject to the terms of the Mozilla Public -+ * License, v. 2.0. If a copy of the MPL was not distributed with this -+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -+ -+// Based on weston/simple-dmabuf-egl.c -+ -+#include "WaylandDMABufSurface.h" -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+ -+using namespace mozilla; -+using namespace mozilla::widget; -+ -+#ifndef DRM_FORMAT_MOD_INVALID -+# define DRM_FORMAT_MOD_INVALID ((1ULL << 56) - 1) -+#endif -+#define BUFFER_FLAGS 0 -+ -+bool WaylandDMABufSurface::mAvailable = false; -+bool WaylandDMABufSurface::mInitialized = false; -+ -+bool WaylandDMABufSurface::IsAvailable() { -+ if (!mInitialized) { -+ mInitialized = true; -+ if (!nsGbmLib::IsAvailable()) { -+ return false; -+ } -+ -+ // Test Alpha and non-alpha formats -+ nsWaylandDisplay* display = WaylandDisplayGet(); -+ if (!display->GetGbmFormat(false) || !display->GetGbmFormat(true)) { -+ return false; -+ } -+ mAvailable = true; -+ } -+ return static_cast(mAvailable); -+} -+ -+static void buffer_release(void* data, wl_buffer* buffer) { -+ auto surface = reinterpret_cast(data); -+ surface->WLBufferDetach(); -+} -+ -+static const struct wl_buffer_listener buffer_listener = {buffer_release}; -+ -+static void buffer_created(void* data, -+ struct zwp_linux_buffer_params_v1* params, -+ struct wl_buffer* new_buffer) { -+ auto surface = static_cast(data); -+ -+ surface->SetWLBuffer(new_buffer); -+ -+ nsWaylandDisplay* display = WaylandDisplayGet(); -+ /* When not using explicit synchronization listen to wl_buffer.release -+ * for release notifications, otherwise we are going to use -+ * zwp_linux_buffer_release_v1. */ -+ if (!display->IsExplicitSyncEnabled()) { -+ wl_buffer_add_listener(new_buffer, &buffer_listener, surface); -+ } -+ zwp_linux_buffer_params_v1_destroy(params); -+} -+ -+static void buffer_create_failed(void* data, -+ struct zwp_linux_buffer_params_v1* params) { -+ zwp_linux_buffer_params_v1_destroy(params); -+} -+ -+static const struct zwp_linux_buffer_params_v1_listener params_listener = { -+ buffer_created, buffer_create_failed}; -+ -+WaylandDMABufSurface::WaylandDMABufSurface() -+ : mWidth(0), -+ mHeight(0), -+ mGmbFormat(nullptr), -+ mWLBuffer(nullptr), -+ mMappedRegion(nullptr), -+ mGbmBufferObject(nullptr), -+ mBufferModifier(DRM_FORMAT_MOD_INVALID), -+ mBufferPlaneCount(1), -+ mWLBufferAttached(false), -+ mFastWLBufferCreation(true) { -+ for (int i = 0; i < DMABUF_BUFFER_PLANES; i++) { -+ mDmabufFds[i] = -1; -+ mStrides[i] = 0; -+ mOffsets[i] = 0; -+ } -+} -+ -+WaylandDMABufSurface::~WaylandDMABufSurface() { Release(); } -+ -+bool WaylandDMABufSurface::Create(int aWidth, int aHeight, bool aHasAlpha) { -+ MOZ_ASSERT(mWLBuffer == nullptr); -+ -+ mWidth = aWidth; -+ mHeight = aHeight; -+ -+ nsWaylandDisplay* display = WaylandDisplayGet(); -+ mGmbFormat = display->GetGbmFormat(aHasAlpha); -+ if (!mGmbFormat) { -+ // Requested DRM format is not supposed. -+ return false; -+ } -+ -+#ifdef HAVE_GBM_MODIFIERS -+ if (nsGbmLib::IsModifierAvailable() && mGmbFormat->mModifiersCount > 0) { -+ mGbmBufferObject = nsGbmLib::CreateWithModifiers( -+ display->GetGbmDevice(), mWidth, mHeight, mGmbFormat->mFormat, -+ mGmbFormat->mModifiers, mGmbFormat->mModifiersCount); -+ if (mGbmBufferObject) { -+ mBufferModifier = nsGbmLib::GetModifier(mGbmBufferObject); -+ } -+ } -+#endif -+ -+ if (!mGbmBufferObject) { -+ mGbmBufferObject = -+ nsGbmLib::Create(display->GetGbmDevice(), mWidth, mHeight, -+ mGmbFormat->mFormat, GBM_BO_USE_RENDERING); -+ } -+ -+ if (!mGbmBufferObject) { -+ return false; -+ } -+ -+#ifdef HAVE_GBM_MODIFIERS -+ if (nsGbmLib::IsModifierAvailable()) { -+ mBufferPlaneCount = nsGbmLib::GetPlaneCount(mGbmBufferObject); -+ for (int i = 0; i < mBufferPlaneCount; i++) { -+ uint32_t handle = nsGbmLib::GetHandleForPlane(mGbmBufferObject, i).u32; -+ int ret = nsGbmLib::DrmPrimeHandleToFD(display->GetGbmDeviceFd(), handle, -+ 0, &mDmabufFds[i]); -+ if (ret < 0 || mDmabufFds[i] < 0) { -+ Release(); -+ return false; -+ } -+ mStrides[i] = nsGbmLib::GetStrideForPlane(mGbmBufferObject, i); -+ mOffsets[i] = nsGbmLib::GetOffset(mGbmBufferObject, i); -+ } -+ } else -+#endif -+ { -+ mBufferPlaneCount = 1; -+ mStrides[0] = nsGbmLib::GetStride(mGbmBufferObject); -+ mDmabufFds[0] = nsGbmLib::GetFd(mGbmBufferObject); -+ if (mDmabufFds[0] < 0) { -+ Release(); -+ return false; -+ } -+ } -+ -+ struct zwp_linux_buffer_params_v1* params = -+ zwp_linux_dmabuf_v1_create_params(display->GetDmabuf()); -+ for (int i = 0; i < mBufferPlaneCount; i++) { -+ zwp_linux_buffer_params_v1_add(params, mDmabufFds[i], i, mOffsets[i], -+ mStrides[i], mBufferModifier >> 32, -+ mBufferModifier & 0xffffffff); -+ } -+ zwp_linux_buffer_params_v1_add_listener(params, ¶ms_listener, this); -+ -+ if (mFastWLBufferCreation) { -+ mWLBuffer = zwp_linux_buffer_params_v1_create_immed( -+ params, mWidth, mHeight, mGmbFormat->mFormat, BUFFER_FLAGS); -+ /* When not using explicit synchronization listen to -+ * wl_buffer.release for release notifications, otherwise we -+ * are going to use zwp_linux_buffer_release_v1. */ -+ if (!display->IsExplicitSyncEnabled()) { -+ wl_buffer_add_listener(mWLBuffer, &buffer_listener, this); -+ } -+ } else { -+ zwp_linux_buffer_params_v1_create(params, mWidth, mHeight, -+ mGmbFormat->mFormat, BUFFER_FLAGS); -+ } -+ -+ return true; -+} -+ -+void WaylandDMABufSurface::Release() { -+ MOZ_ASSERT(!IsMapped(), "We can't release mapped buffer!"); -+ -+ if (mWLBuffer) { -+ wl_buffer_destroy(mWLBuffer); -+ mWLBuffer = nullptr; -+ } -+ -+ if (mGbmBufferObject) { -+ nsGbmLib::Destroy(mGbmBufferObject); -+ mGbmBufferObject = nullptr; -+ } -+ -+ for (int i = 0; i < mBufferPlaneCount; i++) { -+ if (mDmabufFds[i] >= 0) { -+ close(mDmabufFds[i]); -+ mDmabufFds[i] = 0; -+ } -+ } -+} -+ -+void* WaylandDMABufSurface::MapReadOnly(uint32_t aX, uint32_t aY, -+ uint32_t aWidth, uint32_t aHeight, -+ uint32_t* aStride) { -+ NS_ASSERTION(mMappedRegion == nullptr, "Already mapped?"); -+ void* map_data = nullptr; -+ *aStride = 0; -+ mMappedRegion = nsGbmLib::Map(mGbmBufferObject, aX, aY, aWidth, aHeight, -+ GBM_BO_TRANSFER_READ, aStride, &map_data); -+ return mMappedRegion; -+} -+ -+void* WaylandDMABufSurface::MapReadOnly(uint32_t* aStride) { -+ return MapReadOnly(0, 0, mWidth, mHeight, aStride); -+} -+ -+void* WaylandDMABufSurface::Map(uint32_t aX, uint32_t aY, uint32_t aWidth, -+ uint32_t aHeight, uint32_t* aStride) { -+ NS_ASSERTION(mMappedRegion == nullptr, "Already mapped?"); -+ void* map_data = nullptr; -+ *aStride = 0; -+ mMappedRegion = nsGbmLib::Map(mGbmBufferObject, aX, aY, aWidth, aHeight, -+ GBM_BO_TRANSFER_READ_WRITE, aStride, &map_data); -+ return mMappedRegion; -+} -+ -+void* WaylandDMABufSurface::Map(uint32_t* aStride) { -+ return Map(0, 0, mWidth, mHeight, aStride); -+} -+ -+void WaylandDMABufSurface::Unmap() { -+ if (mMappedRegion) { -+ nsGbmLib::Unmap(mGbmBufferObject, mMappedRegion); -+ mMappedRegion = nullptr; -+ } -+} -+ -+bool WaylandDMABufSurface::Resize(int aWidth, int aHeight) { -+ if (aWidth == mWidth && aHeight == mHeight) { -+ return true; -+ } -+ -+ if (IsMapped()) { -+ NS_WARNING("We can't resize mapped surface!"); -+ return false; -+ } -+ -+ Release(); -+ return Create(aWidth, aHeight, mGmbFormat->mHasAlpha); -+} -+ -+bool WaylandDMABufSurface::CopyFrom( -+ class WaylandDMABufSurface* aSourceSurface) { -+ // Not implemented - we should not call that. -+ MOZ_CRASH(); -+} -+ -+// TODO - EGL clear -+void WaylandDMABufSurface::Clear() { -+ uint32_t destStride; -+ void* destData = Map(&destStride); -+ memset(destData, 0, GetHeight() * destStride); -+ Unmap(); -+} -diff --git a/gfx/2d/WaylandDMABufSurface.h b/gfx/2d/WaylandDMABufSurface.h -new file mode 100644 ---- /dev/null -+++ b/gfx/2d/WaylandDMABufSurface.h -@@ -0,0 +1,73 @@ -+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -+/* vim: set ts=8 sts=2 et sw=2 tw=80: */ -+/* This Source Code Form is subject to the terms of the Mozilla Public -+ * License, v. 2.0. If a copy of the MPL was not distributed with this -+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -+ -+#ifndef WaylandDMABufSurface_h__ -+#define WaylandDMABufSurface_h__ -+ -+#include -+#include "mozilla/widget/nsWaylandDisplay.h" -+ -+#define DMABUF_BUFFER_PLANES 4 -+ -+class WaylandDMABufSurface { -+ public: -+ static bool IsAvailable(); -+ -+ bool CreateFrameBuffer(int aWidth, int aHeight); -+ bool CreateEGLImage(int aWidth, int aHeight); -+ -+ bool Create(int aWidth, int aHeight, bool aHasAlpha = true); -+ bool Resize(int aWidth, int aHeight); -+ void Release(); -+ void Clear(); -+ -+ bool CopyFrom(class WaylandDMABufSurface* aSourceSurface); -+ -+ int GetWidth() { return mWidth; }; -+ int GetHeight() { return mHeight; }; -+ -+ void* MapReadOnly(uint32_t aX, uint32_t aY, uint32_t aWidth, uint32_t aHeight, -+ uint32_t* aStride); -+ void* MapReadOnly(uint32_t* aStride); -+ void* Map(uint32_t aX, uint32_t aY, uint32_t aWidth, uint32_t aHeight, -+ uint32_t* aStride); -+ void* Map(uint32_t* aStride); -+ bool IsMapped() { return mMappedRegion; }; -+ void Unmap(); -+ -+ void SetWLBuffer(struct wl_buffer* aWLBuffer) { mWLBuffer = aWLBuffer; }; -+ wl_buffer* GetWLBuffer() { return mWLBuffer; }; -+ -+ void WLBufferDetach() { mWLBufferAttached = false; }; -+ bool WLBufferIsAttached() { return mWLBufferAttached; }; -+ void WLBufferSetAttached() { mWLBufferAttached = true; }; -+ -+ WaylandDMABufSurface(); -+ ~WaylandDMABufSurface(); -+ -+ private: -+ int mWidth; -+ int mHeight; -+ mozilla::widget::GbmFormat* mGmbFormat; -+ -+ wl_buffer* mWLBuffer; -+ void* mMappedRegion; -+ -+ struct gbm_bo* mGbmBufferObject; -+ uint64_t mBufferModifier; -+ int mBufferPlaneCount; -+ int mDmabufFds[DMABUF_BUFFER_PLANES]; -+ uint32_t mStrides[DMABUF_BUFFER_PLANES]; -+ uint32_t mOffsets[DMABUF_BUFFER_PLANES]; -+ -+ bool mWLBufferAttached; -+ bool mFastWLBufferCreation; -+ -+ static bool mAvailable; -+ static bool mInitialized; -+}; -+ -+#endif -diff --git a/gfx/2d/moz.build b/gfx/2d/moz.build ---- a/gfx/2d/moz.build -+++ b/gfx/2d/moz.build -@@ -255,8 +255,20 @@ if CONFIG['MOZ_ENABLE_SKIA']: - '/gfx/skia/skia/include/private', - '/gfx/skia/skia/src/core', - '/gfx/skia/skia/src/image', - ] - if CONFIG['MOZ_ENABLE_SKIA_GPU']: - LOCAL_INCLUDES += [ - '/gfx/skia/skia/src/gpu', - ] -+ -+#if CONFIG['MOZ_WAYLAND'] and CONFIG['HAVE_LIBDRM']: -+if CONFIG['HAVE_LIBDRM']: -+ SOURCES += [ -+ 'WaylandDMABufSurface.cpp', -+ ] -+ EXPORTS.mozilla.gfx += [ -+ 'WaylandDMABufSurface.h', -+ ] -+ CFLAGS += CONFIG['TK_CFLAGS'] -+ CXXFLAGS += CONFIG['TK_CFLAGS'] -+ -diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js ---- a/modules/libpref/init/all.js -+++ b/modules/libpref/init/all.js -@@ -5091,16 +5091,21 @@ pref("gfx.apitrace.enabled",false); - - #ifdef MOZ_X11 - #ifdef MOZ_WIDGET_GTK - pref("gfx.xrender.enabled",false); - pref("widget.chrome.allow-gtk-dark-theme", false); - pref("widget.content.allow-gtk-dark-theme", false); - #endif - #endif -+#ifdef MOZ_WAYLAND -+#ifdef HAVE_LIBDRM -+pref("gfx.wayland_dmabuf_backend.enabled", false); -+#endif -+#endif - - pref("widget.window-transforms.disabled", false); - - #ifdef XP_WIN - // Whether to disable the automatic detection and use of direct2d. - pref("gfx.direct2d.disabled", false); - - // Whether to attempt to enable Direct2D regardless of automatic detection or -diff --git a/toolkit/moz.configure b/toolkit/moz.configure ---- a/toolkit/moz.configure -+++ b/toolkit/moz.configure -@@ -260,16 +260,24 @@ def wayland_headers(wayland, toolkit_gtk - if toolkit_gtk and artifacts: - return True - return wayland - - - set_config('MOZ_WAYLAND', depends_if(wayland_headers)(lambda _: True)) - set_define('MOZ_WAYLAND', depends_if(wayland_headers)(lambda _: True)) - -+drm_headers = pkg_check_modules('HAVE_LIBDRM', 'libdrm > 2.4', when=wayland_headers) -+set_config('HAVE_LIBDRM', depends_if(drm_headers)(lambda _: True)) -+set_define('HAVE_LIBDRM', depends_if(drm_headers)(lambda _: True)) -+ -+gbm_modifiers = pkg_check_modules('HAVE_GBM_MODIFIERS', 'gbm >= 17.1', when=drm_headers) -+set_config('HAVE_GBM_MODIFIERS', depends_if(gbm_modifiers)(lambda _: True)) -+set_define('HAVE_GBM_MODIFIERS', depends_if(gbm_modifiers)(lambda _: True)) -+ - # GL Provider - # ============================================================== - option('--with-gl-provider', nargs=1, help='Set GL provider backend type') - - @depends('--with-gl-provider') - def gl_provider(value): - if value: - return value[0] -diff --git a/widget/gtk/WindowSurfaceWayland.cpp b/widget/gtk/WindowSurfaceWayland.cpp ---- a/widget/gtk/WindowSurfaceWayland.cpp -+++ b/widget/gtk/WindowSurfaceWayland.cpp -@@ -30,16 +30,19 @@ extern mozilla::LazyLogModule gWidgetWay - MOZ_LOG(gWidgetWaylandLog, mozilla::LogLevel::Debug, args) - #else - # define LOGWAYLAND(args) - #endif /* MOZ_LOGGING */ - - namespace mozilla { - namespace widget { - -+bool WindowSurfaceWayland::mUseDMABuf = false; -+bool WindowSurfaceWayland::mUseDMABufInitialized = false; -+ - /* - Wayland multi-thread rendering scheme - - Every rendering thread (main thread, compositor thread) contains its own - nsWaylandDisplay object connected to Wayland compositor (Mutter, Weston, etc.) - - WindowSurfaceWayland implements WindowSurface class and draws nsWindow by - WindowSurface interface (Lock, Commit) to screen through nsWaylandDisplay. -@@ -255,120 +258,183 @@ WaylandShmPool::~WaylandShmPool() { - - static void buffer_release(void* data, wl_buffer* buffer) { - auto surface = reinterpret_cast(data); - surface->Detach(buffer); - } - - static const struct wl_buffer_listener buffer_listener = {buffer_release}; - --void WindowBackBuffer::Create(int aWidth, int aHeight) { -+void WindowBackBufferShm::Create(int aWidth, int aHeight) { - MOZ_ASSERT(!IsAttached(), "We can't resize attached buffers."); - - int newBufferSize = aWidth * aHeight * BUFFER_BPP; - mShmPool.Resize(newBufferSize); - - mWaylandBuffer = - wl_shm_pool_create_buffer(mShmPool.GetShmPool(), 0, aWidth, aHeight, - aWidth * BUFFER_BPP, WL_SHM_FORMAT_ARGB8888); - wl_proxy_set_queue((struct wl_proxy*)mWaylandBuffer, -- mWaylandDisplay->GetEventQueue()); -+ GetWaylandDisplay()->GetEventQueue()); - wl_buffer_add_listener(mWaylandBuffer, &buffer_listener, this); - - mWidth = aWidth; - mHeight = aHeight; - - LOGWAYLAND(( - "%s [%p] wl_buffer %p ID %d\n", __PRETTY_FUNCTION__, (void*)this, - (void*)mWaylandBuffer, - mWaylandBuffer ? wl_proxy_get_id((struct wl_proxy*)mWaylandBuffer) : -1)); - } - --void WindowBackBuffer::Release() { -+void WindowBackBufferShm::Release() { - LOGWAYLAND(("%s [%p]\n", __PRETTY_FUNCTION__, (void*)this)); - - wl_buffer_destroy(mWaylandBuffer); - mWidth = mHeight = 0; - } - --void WindowBackBuffer::Clear() { -+void WindowBackBufferShm::Clear() { - memset(mShmPool.GetImageData(), 0, mHeight * mWidth * BUFFER_BPP); - } - --WindowBackBuffer::WindowBackBuffer(nsWaylandDisplay* aWaylandDisplay, -- int aWidth, int aHeight) -- : mShmPool(aWaylandDisplay, aWidth * aHeight * BUFFER_BPP), -+WindowBackBufferShm::WindowBackBufferShm(nsWaylandDisplay* aWaylandDisplay, -+ int aWidth, int aHeight) -+ : WindowBackBuffer(aWaylandDisplay), -+ mShmPool(aWaylandDisplay, aWidth * aHeight * BUFFER_BPP), - mWaylandBuffer(nullptr), - mWidth(aWidth), - mHeight(aHeight), -- mAttached(false), -- mWaylandDisplay(aWaylandDisplay) { -+ mAttached(false) { - Create(aWidth, aHeight); - } - --WindowBackBuffer::~WindowBackBuffer() { Release(); } -+WindowBackBufferShm::~WindowBackBufferShm() { Release(); } - --bool WindowBackBuffer::Resize(int aWidth, int aHeight) { -+bool WindowBackBufferShm::Resize(int aWidth, int aHeight) { - if (aWidth == mWidth && aHeight == mHeight) return true; - - LOGWAYLAND( - ("%s [%p] %d %d\n", __PRETTY_FUNCTION__, (void*)this, aWidth, aHeight)); - - Release(); - Create(aWidth, aHeight); - - return (mWaylandBuffer != nullptr); - } - - void WindowBackBuffer::Attach(wl_surface* aSurface) { -- LOGWAYLAND(( -- "%s [%p] wl_surface %p ID %d wl_buffer %p ID %d\n", __PRETTY_FUNCTION__, -- (void*)this, (void*)aSurface, -- aSurface ? wl_proxy_get_id((struct wl_proxy*)aSurface) : -1, -- (void*)mWaylandBuffer, -- mWaylandBuffer ? wl_proxy_get_id((struct wl_proxy*)mWaylandBuffer) : -1)); -+ LOGWAYLAND( -+ ("%s [%p] wl_surface %p ID %d wl_buffer %p ID %d\n", __PRETTY_FUNCTION__, -+ (void*)this, (void*)aSurface, -+ aSurface ? wl_proxy_get_id((struct wl_proxy*)aSurface) : -1, -+ (void*)GetWlBuffer(), -+ GetWlBuffer() ? wl_proxy_get_id((struct wl_proxy*)GetWlBuffer()) : -1)); - -- wl_surface_attach(aSurface, mWaylandBuffer, 0, 0); -+ wl_surface_attach(aSurface, GetWlBuffer(), 0, 0); - wl_surface_commit(aSurface); -- wl_display_flush(mWaylandDisplay->GetDisplay()); -- mAttached = true; -+ wl_display_flush(GetWaylandDisplay()->GetDisplay()); -+ SetAttached(); - } - --void WindowBackBuffer::Detach(wl_buffer* aBuffer) { -+void WindowBackBufferShm::Detach(wl_buffer* aBuffer) { - LOGWAYLAND(("%s [%p] wl_buffer %p ID %d\n", __PRETTY_FUNCTION__, (void*)this, - (void*)aBuffer, - aBuffer ? wl_proxy_get_id((struct wl_proxy*)aBuffer) : -1)); - - mAttached = false; - } - --bool WindowBackBuffer::SetImageDataFromBuffer( -+bool WindowBackBufferShm::SetImageDataFromBuffer( - class WindowBackBuffer* aSourceBuffer) { -- if (!IsMatchingSize(aSourceBuffer)) { -- Resize(aSourceBuffer->mWidth, aSourceBuffer->mHeight); -+ auto sourceBuffer = static_cast(aSourceBuffer); -+ if (!IsMatchingSize(sourceBuffer)) { -+ Resize(sourceBuffer->mWidth, sourceBuffer->mHeight); - } - - mShmPool.SetImageDataFromPool( -- &aSourceBuffer->mShmPool, -- aSourceBuffer->mWidth * aSourceBuffer->mHeight * BUFFER_BPP); -+ &sourceBuffer->mShmPool, -+ sourceBuffer->mWidth * sourceBuffer->mHeight * BUFFER_BPP); - return true; - } - --already_AddRefed WindowBackBuffer::Lock() { -+already_AddRefed WindowBackBufferShm::Lock() { - LOGWAYLAND(( - "%s [%p] [%d x %d] wl_buffer %p ID %d\n", __PRETTY_FUNCTION__, - (void*)this, mWidth, mHeight, (void*)mWaylandBuffer, - mWaylandBuffer ? wl_proxy_get_id((struct wl_proxy*)mWaylandBuffer) : -1)); - - gfx::IntSize lockSize(mWidth, mHeight); - return gfxPlatform::CreateDrawTargetForData( - static_cast(mShmPool.GetImageData()), lockSize, -- BUFFER_BPP * mWidth, mFormat); -+ BUFFER_BPP * mWidth, GetSurfaceFormat()); -+} -+ -+#ifdef HAVE_LIBDRM -+WindowBackBufferDMABuf::WindowBackBufferDMABuf( -+ nsWaylandDisplay* aWaylandDisplay, int aWidth, int aHeight) -+ : WindowBackBuffer(aWaylandDisplay) { -+ mDMAbufSurface.Create(aWidth, aHeight); -+} -+ -+WindowBackBufferDMABuf::~WindowBackBufferDMABuf() { mDMAbufSurface.Release(); } -+ -+already_AddRefed WindowBackBufferDMABuf::Lock() { -+ LOGWAYLAND( -+ ("%s [%p] [%d x %d] wl_buffer %p ID %d\n", __PRETTY_FUNCTION__, -+ (void*)this, GetWidth(), GetHeight(), (void*)GetWlBuffer(), -+ GetWlBuffer() ? wl_proxy_get_id((struct wl_proxy*)GetWlBuffer()) : -1)); -+ -+ uint32_t stride; -+ void* pixels = mDMAbufSurface.Map(&stride); -+ gfx::IntSize lockSize(GetWidth(), GetHeight()); -+ return gfxPlatform::CreateDrawTargetForData( -+ static_cast(pixels), lockSize, stride, -+ GetSurfaceFormat()); -+} -+ -+void WindowBackBufferDMABuf::Unlock() { mDMAbufSurface.Unmap(); } -+ -+bool WindowBackBufferDMABuf::IsAttached() { -+ return mDMAbufSurface.WLBufferIsAttached(); - } - -+void WindowBackBufferDMABuf::SetAttached() { -+ return mDMAbufSurface.WLBufferSetAttached(); -+} -+ -+int WindowBackBufferDMABuf::GetWidth() { return mDMAbufSurface.GetWidth(); } -+ -+int WindowBackBufferDMABuf::GetHeight() { return mDMAbufSurface.GetHeight(); } -+ -+wl_buffer* WindowBackBufferDMABuf::GetWlBuffer() { -+ return mDMAbufSurface.GetWLBuffer(); -+} -+ -+bool WindowBackBufferDMABuf::IsLocked() { return mDMAbufSurface.IsMapped(); } -+ -+bool WindowBackBufferDMABuf::Resize(int aWidth, int aHeight) { -+ return mDMAbufSurface.Resize(aWidth, aHeight); -+} -+ -+bool WindowBackBufferDMABuf::SetImageDataFromBuffer( -+ class WindowBackBuffer* aSourceBuffer) { -+ WindowBackBufferDMABuf* source = -+ static_cast(aSourceBuffer); -+ mDMAbufSurface.CopyFrom(&source->mDMAbufSurface); -+ return true; -+} -+ -+void WindowBackBufferDMABuf::Detach(wl_buffer* aBuffer) { -+ mDMAbufSurface.WLBufferDetach(); -+} -+ -+void WindowBackBufferDMABuf::Clear() { mDMAbufSurface.Clear(); } -+#endif -+ - static void frame_callback_handler(void* data, struct wl_callback* callback, - uint32_t time) { - auto surface = reinterpret_cast(data); - surface->FrameCallbackHandler(); - - gfxPlatformGtk::GetPlatform()->SetWaylandLastVsync(time); - } - -@@ -412,23 +478,60 @@ WindowSurfaceWayland::~WindowSurfaceWayl - - for (int i = 0; i < BACK_BUFFER_NUM; i++) { - if (mBackupBuffer[i]) { - delete mBackupBuffer[i]; - } - } - } - --WindowBackBuffer* WindowSurfaceWayland::GetWaylandBufferToDraw(int aWidth, -- int aHeight) { -+bool WindowSurfaceWayland::UseDMABufBackend() { -+ if (!mUseDMABufInitialized) { -+#ifdef HAVE_LIBDRM -+ if (WaylandDMABufSurface::IsAvailable()) { -+ mUseDMABuf = -+ Preferences::GetBool("gfx.wayland_dmabuf_backend.enabled", false); -+ } -+#endif -+ mUseDMABufInitialized = true; -+ } -+ return mUseDMABuf; -+} -+ -+WindowBackBuffer* WindowSurfaceWayland::CreateWaylandBuffer(int aWidth, -+ int aHeight) { -+ if (UseDMABufBackend()) { -+ static bool sDMABufBufferCreated = false; -+ WindowBackBuffer* buffer = -+ new WindowBackBufferDMABuf(mWaylandDisplay, aWidth, aHeight); -+ if (buffer) { -+ sDMABufBufferCreated = true; -+ return buffer; -+ } -+ // If this is the first failure and there's no dmabuf already active -+ // we can safely fallback to Shm. Otherwise we can't mix DMAbuf and -+ // SHM buffers so just fails now. -+ if (sDMABufBufferCreated) { -+ NS_WARNING("Failed to allocate DMABuf buffer!"); -+ return nullptr; -+ } else { -+ NS_WARNING("Wayland DMABuf failed, switched back to Shm backend!"); -+ mUseDMABuf = false; -+ } -+ } -+ return new WindowBackBufferShm(mWaylandDisplay, aWidth, aHeight); -+} -+ -+WindowBackBuffer* WindowSurfaceWayland::GetWaylandBufferToDraw( -+ int aWidth, int aHeight, bool aFullScreenUpdate, bool aNoBackBufferCopy) { - if (!mWaylandBuffer) { - LOGWAYLAND(("%s [%p] Create [%d x %d]\n", __PRETTY_FUNCTION__, (void*)this, - aWidth, aHeight)); - -- mWaylandBuffer = new WindowBackBuffer(mWaylandDisplay, aWidth, aHeight); -+ mWaylandBuffer = CreateWaylandBuffer(aWidth, aHeight); - mWaitToFullScreenUpdate = true; - return mWaylandBuffer; - } - - if (!mWaylandBuffer->IsAttached()) { - if (!mWaylandBuffer->IsMatchingSize(aWidth, aHeight)) { - mWaylandBuffer->Resize(aWidth, aHeight); - // There's a chance that scale factor has been changed -@@ -444,75 +547,89 @@ WindowBackBuffer* WindowSurfaceWayland:: - MOZ_ASSERT(!mPendingCommit, - "Uncommitted buffer switch, screen artifacts ahead."); - - // Front buffer is used by compositor, select a back buffer - int availableBuffer; - for (availableBuffer = 0; availableBuffer < BACK_BUFFER_NUM; - availableBuffer++) { - if (!mBackupBuffer[availableBuffer]) { -- mBackupBuffer[availableBuffer] = -- new WindowBackBuffer(mWaylandDisplay, aWidth, aHeight); -+ mBackupBuffer[availableBuffer] = CreateWaylandBuffer(aWidth, aHeight); - break; - } - - if (!mBackupBuffer[availableBuffer]->IsAttached()) { - break; - } - } - - if (MOZ_UNLIKELY(availableBuffer == BACK_BUFFER_NUM)) { - LOGWAYLAND(("%s [%p] No drawing buffer available!\n", __PRETTY_FUNCTION__, - (void*)this)); - NS_WARNING("No drawing buffer available"); - return nullptr; - } - -+ bool bufferFlip = mWaylandBuffer->IsMatchingSize(aWidth, aHeight); -+ if (bufferFlip && aNoBackBufferCopy && !aFullScreenUpdate) { -+ LOGWAYLAND(("%s [%p] Delayed hard copy from old buffer [%d x %d]\n", -+ __PRETTY_FUNCTION__, (void*)this, aWidth, aHeight)); -+ return nullptr; -+ } -+ - WindowBackBuffer* lastWaylandBuffer = mWaylandBuffer; - mWaylandBuffer = mBackupBuffer[availableBuffer]; - mBackupBuffer[availableBuffer] = lastWaylandBuffer; - -- if (lastWaylandBuffer->IsMatchingSize(aWidth, aHeight)) { -- LOGWAYLAND(("%s [%p] Copy from old buffer [%d x %d]\n", __PRETTY_FUNCTION__, -- (void*)this, aWidth, aHeight)); -+ if (bufferFlip) { - // Former front buffer has the same size as a requested one. - // Gecko may expect a content already drawn on screen so copy -- // existing data to the new buffer. -- mWaylandBuffer->SetImageDataFromBuffer(lastWaylandBuffer); -+ // existing data to the new buffer if we don't do fullscreen redraw. -+ if (!aFullScreenUpdate) { -+ LOGWAYLAND(("%s [%p] Copy from old buffer [%d x %d]\n", -+ __PRETTY_FUNCTION__, (void*)this, aWidth, aHeight)); -+ mWaylandBuffer->SetImageDataFromBuffer(lastWaylandBuffer); -+ } - // When buffer switches we need to damage whole screen - // (https://bugzilla.redhat.com/show_bug.cgi?id=1418260) - mWaylandBufferFullScreenDamage = true; - } else { - LOGWAYLAND(("%s [%p] Resize to [%d x %d]\n", __PRETTY_FUNCTION__, - (void*)this, aWidth, aHeight)); - // Former buffer has different size from the new request. Only resize - // the new buffer and leave gecko to render new whole content. - mWaylandBuffer->Resize(aWidth, aHeight); - mWaitToFullScreenUpdate = true; - } - - return mWaylandBuffer; - } - - already_AddRefed WindowSurfaceWayland::LockWaylandBuffer( -- int aWidth, int aHeight, bool aClearBuffer) { -- WindowBackBuffer* buffer = GetWaylandBufferToDraw(aWidth, aHeight); -+ int aWidth, int aHeight, bool aClearBuffer, bool aFullScreenUpdate, -+ bool aNoBackBufferCopy) { -+ WindowBackBuffer* buffer = GetWaylandBufferToDraw( -+ aWidth, aHeight, aFullScreenUpdate, aNoBackBufferCopy); - if (!buffer) { -- NS_WARNING( -- "WindowSurfaceWayland::LockWaylandBuffer(): No buffer available"); -+ if (!aNoBackBufferCopy) { -+ NS_WARNING( -+ "WindowSurfaceWayland::LockWaylandBuffer(): No buffer available"); -+ } - return nullptr; - } - - if (aClearBuffer) { - buffer->Clear(); - } - - return buffer->Lock(); - } - -+void WindowSurfaceWayland::UnlockWaylandBuffer() { mWaylandBuffer->Unlock(); } -+ - already_AddRefed WindowSurfaceWayland::LockImageSurface( - const gfx::IntSize& aLockSize) { - if (!mImageSurface || mImageSurface->CairoStatus() || - !(aLockSize <= mImageSurface->GetSize())) { - mImageSurface = new gfxImageSurface( - aLockSize, - SurfaceFormatToImageFormat(WindowBackBuffer::GetSurfaceFormat())); - if (mImageSurface->CairoStatus()) { -@@ -552,20 +669,28 @@ already_AddRefed Window - - // Are we asked for entire nsWindow to draw? - mDrawToWaylandBufferDirectly = - (aRegion.GetNumRects() == 1 && bounds.x == 0 && bounds.y == 0 && - lockSize.width == screenRect.width && - lockSize.height == screenRect.height); - - if (mDrawToWaylandBufferDirectly) { -- RefPtr dt = -- LockWaylandBuffer(screenRect.width, screenRect.height, -- mWindow->WaylandSurfaceNeedsClear()); -+ // If there's any pending image commit scratch them as we're going -+ // to redraw the whole sceen anyway. -+ mDelayedImageCommits.Clear(); -+ -+ bool needsClear = mWindow->WaylandSurfaceNeedsClear(); -+ RefPtr dt = LockWaylandBuffer( -+ screenRect.width, screenRect.height, needsClear, -+ /* aFullScreenUpdate */ true, /* aNoBackBufferCopy */ true); - if (dt) { -+ if (needsClear) { -+ mWindow->WaylandSurfaceCleared(); -+ } - // When we have a request to update whole screen at once - // (surface was created, resized or changed somehow) - // we also need update scale factor of the screen. - if (mWaitToFullScreenUpdate) { - mWaitToFullScreenUpdate = false; - mNeedScaleFactorUpdate = true; - } - return dt.forget(); -@@ -574,52 +699,94 @@ already_AddRefed Window - // We don't have any front buffer available. Try indirect drawing - // to mImageSurface which is mirrored to front buffer at commit. - mDrawToWaylandBufferDirectly = false; - } - - return LockImageSurface(lockSize); - } - -+void WindowImageSurface::Draw(gfx::SourceSurface* aSurface, -+ gfx::DrawTarget* aDest, -+ const LayoutDeviceIntRegion& aRegion) { -+ uint32_t numRects = aRegion.GetNumRects(); -+ if (numRects != 1) { -+ AutoTArray rects; -+ rects.SetCapacity(numRects); -+ for (auto iter = aRegion.RectIter(); !iter.Done(); iter.Next()) { -+ rects.AppendElement(iter.Get().ToUnknownRect()); -+ } -+ aDest->PushDeviceSpaceClipRects(rects.Elements(), rects.Length()); -+ } -+ -+ gfx::IntRect bounds = aRegion.GetBounds().ToUnknownRect(); -+ gfx::Rect rect(bounds); -+ aDest->DrawSurface(aSurface, rect, rect); -+ -+ if (numRects != 1) { -+ aDest->PopClip(); -+ } -+} -+ -+void WindowImageSurface::Draw(gfx::DrawTarget* aDest, -+ LayoutDeviceIntRegion& aWaylandBufferDamage) { -+ Draw(mSurface.get(), aDest, mUpdateRegion); -+ aWaylandBufferDamage.OrWith(mUpdateRegion); -+} -+ -+WindowImageSurface::WindowImageSurface( -+ gfx::SourceSurface* aSurface, const LayoutDeviceIntRegion& aUpdateRegion) -+ : mSurface(aSurface), mUpdateRegion(aUpdateRegion){}; -+ -+void WindowSurfaceWayland::DrawDelayedImageCommits( -+ gfx::DrawTarget* aDrawTarget, LayoutDeviceIntRegion& aWaylandBufferDamage) { -+ for (unsigned int i = 0; i < mDelayedImageCommits.Length(); i++) { -+ mDelayedImageCommits[i].Draw(aDrawTarget, aWaylandBufferDamage); -+ } -+ mDelayedImageCommits.Clear(); -+} -+ - bool WindowSurfaceWayland::CommitImageSurfaceToWaylandBuffer( -- const LayoutDeviceIntRegion& aRegion) { -+ const LayoutDeviceIntRegion& aRegion, -+ LayoutDeviceIntRegion& aWaylandBufferDamage) { - MOZ_ASSERT(!mDrawToWaylandBufferDirectly); - - LayoutDeviceIntRect screenRect = mWindow->GetBounds(); - gfx::IntRect bounds = aRegion.GetBounds().ToUnknownRect(); - - gfx::Rect rect(bounds); - if (rect.IsEmpty()) { - return false; - } - -- RefPtr dt = LockWaylandBuffer( -- screenRect.width, screenRect.height, mWindow->WaylandSurfaceNeedsClear()); - RefPtr surf = - gfx::Factory::CreateSourceSurfaceForCairoSurface( - mImageSurface->CairoSurface(), mImageSurface->GetSize(), - mImageSurface->Format()); -- if (!dt || !surf) { -+ if (!surf) { - return false; - } - -- uint32_t numRects = aRegion.GetNumRects(); -- if (numRects != 1) { -- AutoTArray rects; -- rects.SetCapacity(numRects); -- for (auto iter = aRegion.RectIter(); !iter.Done(); iter.Next()) { -- rects.AppendElement(iter.Get().ToUnknownRect()); -+ bool needsClear = mWindow->WaylandSurfaceNeedsClear(); -+ RefPtr dt = LockWaylandBuffer( -+ screenRect.width, screenRect.height, needsClear, -+ /* fullscreenDrawing */ false, /* aNoBackBufferCopy */ true); -+ if (dt) { -+ if (needsClear) { -+ mWindow->WaylandSurfaceCleared(); - } -- dt->PushDeviceSpaceClipRects(rects.Elements(), rects.Length()); -- } -- -- dt->DrawSurface(surf, rect, rect); -- -- if (numRects != 1) { -- dt->PopClip(); -+ // Draw any delayed image commits first -+ DrawDelayedImageCommits(dt, aWaylandBufferDamage); -+ WindowImageSurface::Draw(surf, dt, aRegion); -+ // Submit all drawing to final Wayland buffer upload -+ aWaylandBufferDamage.OrWith(aRegion); -+ UnlockWaylandBuffer(); -+ } else { -+ mDelayedImageCommits.AppendElement(WindowImageSurface(surf, aRegion)); -+ return false; - } - - return true; - } - - static void WaylandBufferDelayCommitHandler(WindowSurfaceWayland** aSurface) { - if (*aSurface) { - (*aSurface)->DelayedCommitHandler(); -@@ -643,16 +810,34 @@ void WindowSurfaceWayland::CalcRectScale - - void WindowSurfaceWayland::CommitWaylandBuffer() { - MOZ_ASSERT(mPendingCommit, "Committing empty surface!"); - - if (mWaitToFullScreenUpdate) { - return; - } - -+ if (!mDrawToWaylandBufferDirectly) { -+ // There's some cached drawings - try to flush them now. -+ LayoutDeviceIntRect screenRect = mWindow->GetBounds(); -+ bool needsClear = mWindow->WaylandSurfaceNeedsClear(); -+ RefPtr dt = -+ LockWaylandBuffer(screenRect.width, screenRect.height, needsClear, -+ /* fullscreenInvalidate */ false, -+ /* aNoBackBufferCopy */ true); -+ if (dt) { -+ if (needsClear) { -+ mWindow->WaylandSurfaceCleared(); -+ } -+ DrawDelayedImageCommits(dt, mWaylandBufferDamage); -+ UnlockWaylandBuffer(); -+ mDrawToWaylandBufferDirectly = true; -+ } -+ } -+ - wl_surface* waylandSurface = mWindow->GetWaylandSurface(); - if (!waylandSurface) { - // Target window is not created yet - delay the commit. This can happen only - // when the window is newly created and there's no active - // frame callback pending. - MOZ_ASSERT(!mFrameCallback || waylandSurface != mLastCommittedSurface, - "Missing wayland surface at frame callback!"); - -@@ -735,24 +920,31 @@ void WindowSurfaceWayland::Commit(const - gfx::IntSize lockSize(bounds.XMost(), bounds.YMost()); - - LOGWAYLAND(("%s [%p] lockSize [%d x %d] screenSize [%d x %d]\n", - __PRETTY_FUNCTION__, (void*)this, lockSize.width, - lockSize.height, screenRect.width, lockSize.height)); - } - #endif - -- // We have new content at mImageSurface - copy data to mWaylandBuffer first. -- if (!mDrawToWaylandBufferDirectly) { -- CommitImageSurfaceToWaylandBuffer(aInvalidRegion); -- } -- -- // If we're not at fullscreen damage add drawing area from aInvalidRegion -- if (!mWaylandBufferFullScreenDamage) { -- mWaylandBufferDamage.OrWith(aInvalidRegion); -+ if (mDrawToWaylandBufferDirectly) { -+ MOZ_ASSERT(mWaylandBuffer->IsLocked()); -+ // If we're not at fullscreen damage add drawing area from aInvalidRegion -+ if (!mWaylandBufferFullScreenDamage) { -+ mWaylandBufferDamage.OrWith(aInvalidRegion); -+ } -+ UnlockWaylandBuffer(); -+ } else { -+ MOZ_ASSERT(!mWaylandBuffer->IsLocked(), -+ "Drawing to already locked buffer?"); -+ if (CommitImageSurfaceToWaylandBuffer(aInvalidRegion, -+ mWaylandBufferDamage)) { -+ // Our cached drawing is flushed, we can draw fullscreen again. -+ mDrawToWaylandBufferDirectly = true; -+ } - } - - // We're ready to commit. - mPendingCommit = true; - CommitWaylandBuffer(); - } - - void WindowSurfaceWayland::FrameCallbackHandler() { -diff --git a/widget/gtk/WindowSurfaceWayland.h b/widget/gtk/WindowSurfaceWayland.h ---- a/widget/gtk/WindowSurfaceWayland.h -+++ b/widget/gtk/WindowSurfaceWayland.h -@@ -5,16 +5,19 @@ - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - - #ifndef _MOZILLA_WIDGET_GTK_WINDOW_SURFACE_WAYLAND_H - #define _MOZILLA_WIDGET_GTK_WINDOW_SURFACE_WAYLAND_H - - #include - #include "mozilla/gfx/Types.h" - #include "nsWaylandDisplay.h" -+#ifdef HAVE_LIBDRM -+# include "mozilla/gfx/WaylandDMABufSurface.h" -+#endif - - #define BACK_BUFFER_NUM 2 - - namespace mozilla { - namespace widget { - - // Allocates and owns shared memory for Wayland drawing surface - class WaylandShmPool { -@@ -35,94 +38,192 @@ class WaylandShmPool { - int mShmPoolFd; - int mAllocatedSize; - void* mImageData; - }; - - // Holds actual graphics data for wl_surface - class WindowBackBuffer { - public: -- WindowBackBuffer(nsWaylandDisplay* aDisplay, int aWidth, int aHeight); -- ~WindowBackBuffer(); -+ virtual already_AddRefed Lock() = 0; -+ virtual void Unlock(){}; -+ virtual bool IsLocked() { return false; }; -+ -+ void Attach(wl_surface* aSurface); -+ virtual void Detach(wl_buffer* aBuffer) = 0; -+ virtual bool IsAttached() = 0; -+ -+ virtual void Clear() = 0; -+ virtual bool Resize(int aWidth, int aHeight) = 0; -+ -+ virtual int GetWidth() = 0; -+ virtual int GetHeight() = 0; -+ virtual wl_buffer* GetWlBuffer() = 0; -+ virtual void SetAttached() = 0; -+ -+ virtual bool SetImageDataFromBuffer( -+ class WindowBackBuffer* aSourceBuffer) = 0; -+ -+ bool IsMatchingSize(int aWidth, int aHeight) { -+ return aWidth == GetWidth() && aHeight == GetHeight(); -+ } -+ bool IsMatchingSize(class WindowBackBuffer* aBuffer) { -+ return aBuffer->IsMatchingSize(GetWidth(), GetHeight()); -+ } -+ -+ static gfx::SurfaceFormat GetSurfaceFormat() { return mFormat; } -+ -+ nsWaylandDisplay* GetWaylandDisplay() { return mWaylandDisplay; }; -+ -+ WindowBackBuffer(nsWaylandDisplay* aWaylandDisplay) -+ : mWaylandDisplay(aWaylandDisplay){}; -+ virtual ~WindowBackBuffer(){}; -+ -+ private: -+ static gfx::SurfaceFormat mFormat; -+ nsWaylandDisplay* mWaylandDisplay; -+}; -+ -+class WindowBackBufferShm : public WindowBackBuffer { -+ public: -+ WindowBackBufferShm(nsWaylandDisplay* aWaylandDisplay, int aWidth, -+ int aHeight); -+ ~WindowBackBufferShm(); - - already_AddRefed Lock(); - -- void Attach(wl_surface* aSurface); - void Detach(wl_buffer* aBuffer); - bool IsAttached() { return mAttached; } - - void Clear(); - bool Resize(int aWidth, int aHeight); - bool SetImageDataFromBuffer(class WindowBackBuffer* aSourceBuffer); - -- bool IsMatchingSize(int aWidth, int aHeight) { -- return aWidth == mWidth && aHeight == mHeight; -- } -- bool IsMatchingSize(class WindowBackBuffer* aBuffer) { -- return aBuffer->mWidth == mWidth && aBuffer->mHeight == mHeight; -- } -+ int GetWidth() { return mWidth; }; -+ int GetHeight() { return mHeight; }; - -- static gfx::SurfaceFormat GetSurfaceFormat() { return mFormat; } -+ wl_buffer* GetWlBuffer() { return mWaylandBuffer; }; -+ void SetAttached() { mAttached = true; }; - - private: - void Create(int aWidth, int aHeight); - void Release(); - - // WaylandShmPool provides actual shared memory we draw into - WaylandShmPool mShmPool; - - // wl_buffer is a wayland object that encapsulates the shared memory - // and passes it to wayland compositor by wl_surface object. - wl_buffer* mWaylandBuffer; - int mWidth; - int mHeight; - bool mAttached; -- nsWaylandDisplay* mWaylandDisplay; -- static gfx::SurfaceFormat mFormat; -+}; -+ -+#ifdef HAVE_LIBDRM -+class WindowBackBufferDMABuf : public WindowBackBuffer { -+ public: -+ WindowBackBufferDMABuf(nsWaylandDisplay* aWaylandDisplay, int aWidth, -+ int aHeight); -+ ~WindowBackBufferDMABuf(); -+ -+ bool IsAttached(); -+ void SetAttached(); -+ -+ int GetWidth(); -+ int GetHeight(); -+ wl_buffer* GetWlBuffer(); -+ -+ bool SetImageDataFromBuffer(class WindowBackBuffer* aSourceBuffer); -+ -+ already_AddRefed Lock(); -+ bool IsLocked(); -+ void Unlock(); -+ -+ void Clear(); -+ void Detach(wl_buffer* aBuffer); -+ bool Resize(int aWidth, int aHeight); -+ -+ private: -+ WaylandDMABufSurface mDMAbufSurface; -+}; -+#endif -+ -+class WindowImageSurface { -+ public: -+ static void Draw(gfx::SourceSurface* aSurface, gfx::DrawTarget* aDest, -+ const LayoutDeviceIntRegion& aRegion); -+ -+ void Draw(gfx::DrawTarget* aDest, -+ LayoutDeviceIntRegion& aWaylandBufferDamage); -+ -+ WindowImageSurface(gfx::SourceSurface* aSurface, -+ const LayoutDeviceIntRegion& aUpdateRegion); -+ -+ private: -+ RefPtr mSurface; -+ const LayoutDeviceIntRegion mUpdateRegion; - }; - - // WindowSurfaceWayland is an abstraction for wl_surface - // and related management - class WindowSurfaceWayland : public WindowSurface { - public: - explicit WindowSurfaceWayland(nsWindow* aWindow); - ~WindowSurfaceWayland(); - - already_AddRefed Lock( - const LayoutDeviceIntRegion& aRegion) override; - void Commit(const LayoutDeviceIntRegion& aInvalidRegion) final; - void FrameCallbackHandler(); - void DelayedCommitHandler(); - - private: -- WindowBackBuffer* GetWaylandBufferToDraw(int aWidth, int aHeight); -+ WindowBackBuffer* CreateWaylandBuffer(int aWidth, int aHeight); -+ WindowBackBuffer* GetWaylandBufferToDraw(int aWidth, int aHeight, -+ bool aFullScreenUpdate, -+ bool aNoBackBufferCopy); - - already_AddRefed LockWaylandBuffer(int aWidth, int aHeight, -- bool aClearBuffer); -+ bool aClearBuffer, -+ bool aFullScreenUpdate, -+ bool aNoBackBufferCopy); -+ void UnlockWaylandBuffer(); -+ - already_AddRefed LockImageSurface( - const gfx::IntSize& aLockSize); -- bool CommitImageSurfaceToWaylandBuffer(const LayoutDeviceIntRegion& aRegion); -+ bool CommitImageSurfaceToWaylandBuffer( -+ const LayoutDeviceIntRegion& aRegion, -+ LayoutDeviceIntRegion& aWaylandBufferDamage); - void CommitWaylandBuffer(); - void CalcRectScale(LayoutDeviceIntRect& aRect, int scale); - -+ void DrawDelayedImageCommits(gfx::DrawTarget* aDrawTarget, -+ LayoutDeviceIntRegion& aWaylandBufferDamage); -+ - // TODO: Do we need to hold a reference to nsWindow object? - nsWindow* mWindow; - nsWaylandDisplay* mWaylandDisplay; - WindowBackBuffer* mWaylandBuffer; - LayoutDeviceIntRegion mWaylandBufferDamage; - WindowBackBuffer* mBackupBuffer[BACK_BUFFER_NUM]; -- RefPtr mImageSurface; - wl_callback* mFrameCallback; - wl_surface* mLastCommittedSurface; - MessageLoop* mDisplayThreadMessageLoop; - WindowSurfaceWayland** mDelayedCommitHandle; -+ RefPtr mImageSurface; -+ AutoTArray mDelayedImageCommits; - bool mDrawToWaylandBufferDirectly; - bool mPendingCommit; - bool mWaylandBufferFullScreenDamage; - bool mIsMainThread; - bool mNeedScaleFactorUpdate; - bool mWaitToFullScreenUpdate; -+ -+ static bool UseDMABufBackend(); -+ static bool mUseDMABufInitialized; -+ static bool mUseDMABuf; - }; - - } // namespace widget - } // namespace mozilla - - #endif // _MOZILLA_WIDGET_GTK_WINDOW_SURFACE_WAYLAND_H -diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build ---- a/widget/gtk/moz.build -+++ b/widget/gtk/moz.build -@@ -97,17 +97,18 @@ if CONFIG['MOZ_X11']: - - if CONFIG['MOZ_WAYLAND']: - UNIFIED_SOURCES += [ - 'nsClipboardWayland.cpp', - 'nsWaylandDisplay.cpp', - 'WindowSurfaceWayland.cpp', - ] - EXPORTS.mozilla.widget += [ -- 'nsWaylandDisplayShutdown.h' -+ 'nsWaylandDisplay.h', -+ 'nsWaylandDisplayShutdown.h', - ] - - if CONFIG['ACCESSIBILITY']: - UNIFIED_SOURCES += [ - 'maiRedundantObjectFactory.c', - ] - - UNIFIED_SOURCES += [ -diff --git a/widget/gtk/mozcontainer.cpp b/widget/gtk/mozcontainer.cpp ---- a/widget/gtk/mozcontainer.cpp -+++ b/widget/gtk/mozcontainer.cpp -@@ -641,17 +641,19 @@ struct wl_egl_window* moz_container_get_ - return container->eglwindow; - } - - gboolean moz_container_has_wl_egl_window(MozContainer* container) { - return container->eglwindow ? true : false; - } - - gboolean moz_container_surface_needs_clear(MozContainer* container) { -- gboolean state = container->surface_needs_clear; -+ return container->surface_needs_clear; -+} -+ -+void moz_container_surface_cleared(MozContainer* container) { - container->surface_needs_clear = false; -- return state; - } - #endif - - void moz_container_force_default_visual(MozContainer* container) { - container->force_default_visual = true; - } -diff --git a/widget/gtk/mozcontainer.h b/widget/gtk/mozcontainer.h ---- a/widget/gtk/mozcontainer.h -+++ b/widget/gtk/mozcontainer.h -@@ -96,15 +96,16 @@ void moz_container_put(MozContainer* con - void moz_container_force_default_visual(MozContainer* container); - - #ifdef MOZ_WAYLAND - struct wl_surface* moz_container_get_wl_surface(MozContainer* container); - struct wl_egl_window* moz_container_get_wl_egl_window(MozContainer* container); - - gboolean moz_container_has_wl_egl_window(MozContainer* container); - gboolean moz_container_surface_needs_clear(MozContainer* container); -+void moz_container_surface_cleared(MozContainer* container); - void moz_container_scale_changed(MozContainer* container, - GtkAllocation* aAllocation); - void moz_container_set_initial_draw_callback( - MozContainer* container, std::function inital_draw_cb); - #endif - - #endif /* __MOZ_CONTAINER_H__ */ -diff --git a/widget/gtk/mozwayland/moz.build b/widget/gtk/mozwayland/moz.build ---- a/widget/gtk/mozwayland/moz.build -+++ b/widget/gtk/mozwayland/moz.build -@@ -2,12 +2,16 @@ - # vim: set filetype=python: - # This Source Code Form is subject to the terms of the Mozilla Public - # License, v. 2.0. If a copy of the MPL was not distributed with this - # file, You can obtain one at http://mozilla.org/MPL/2.0/. - - SOURCES += [ - 'mozwayland.c', - ] -+EXPORTS.mozilla.widget += [ -+ 'mozwayland.h', -+] - - SharedLibrary('mozwayland') - - CFLAGS += CONFIG['TK_CFLAGS'] -+ -diff --git a/widget/gtk/nsWaylandDisplay.cpp b/widget/gtk/nsWaylandDisplay.cpp ---- a/widget/gtk/nsWaylandDisplay.cpp -+++ b/widget/gtk/nsWaylandDisplay.cpp -@@ -2,20 +2,16 @@ - /* vim:expandtab:shiftwidth=4:tabstop=4: - */ - /* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - - #include "nsWaylandDisplay.h" - --#include "base/message_loop.h" // for MessageLoop --#include "base/task.h" // for NewRunnableMethod, etc --#include "mozilla/StaticMutex.h" -- - namespace mozilla { - namespace widget { - - // nsWaylandDisplay needs to be created for each calling thread(main thread, - // compositor thread and render thread) - #define MAX_DISPLAY_CONNECTIONS 3 - - static nsWaylandDisplay* gWaylandDisplays[MAX_DISPLAY_CONNECTIONS]; -@@ -107,16 +103,67 @@ void nsWaylandDisplay::SetDataDeviceMana - - void nsWaylandDisplay::SetSeat(wl_seat* aSeat) { mSeat = aSeat; } - - void nsWaylandDisplay::SetPrimarySelectionDeviceManager( - gtk_primary_selection_device_manager* aPrimarySelectionDeviceManager) { - mPrimarySelectionDeviceManager = aPrimarySelectionDeviceManager; - } - -+#ifdef HAVE_LIBDRM -+void nsWaylandDisplay::SetDmabuf(zwp_linux_dmabuf_v1* aDmabuf) { -+ mDmabuf = aDmabuf; -+} -+ -+GbmFormat* nsWaylandDisplay::GetGbmFormat(bool aHasAlpha) { -+ GbmFormat* format = aHasAlpha ? &mARGBFormat : &mXRGBFormat; -+ return format->mIsSupported ? format : nullptr; -+} -+ -+void nsWaylandDisplay::AddFormatModifier(bool aHasAlpha, int aFormat, -+ uint32_t mModifierHi, -+ uint32_t mModifierLo) { -+ GbmFormat* format = aHasAlpha ? &mARGBFormat : &mXRGBFormat; -+ format->mIsSupported = true; -+ format->mHasAlpha = aHasAlpha; -+ format->mFormat = aFormat; -+ format->mModifiersCount++; -+ format->mModifiers = -+ (uint64_t*)realloc(format->mModifiers, -+ format->mModifiersCount * sizeof(*format->mModifiers)); -+ format->mModifiers[format->mModifiersCount - 1] = -+ ((uint64_t)mModifierHi << 32) | mModifierLo; -+} -+ -+static void dmabuf_modifiers(void* data, -+ struct zwp_linux_dmabuf_v1* zwp_linux_dmabuf, -+ uint32_t format, uint32_t modifier_hi, -+ uint32_t modifier_lo) { -+ auto display = reinterpret_cast(data); -+ switch (format) { -+ case DRM_FORMAT_ARGB8888: -+ display->AddFormatModifier(true, format, modifier_hi, modifier_lo); -+ break; -+ case DRM_FORMAT_XRGB8888: -+ display->AddFormatModifier(false, format, modifier_hi, modifier_lo); -+ break; -+ default: -+ break; -+ } -+} -+ -+static void dmabuf_format(void* data, -+ struct zwp_linux_dmabuf_v1* zwp_linux_dmabuf, -+ uint32_t format) { -+ // XXX: deprecated -+} -+ -+static const struct zwp_linux_dmabuf_v1_listener dmabuf_listener = { -+ dmabuf_format, dmabuf_modifiers}; -+ - static void global_registry_handler(void* data, wl_registry* registry, - uint32_t id, const char* interface, - uint32_t version) { - auto display = reinterpret_cast(data); - if (!display) return; - - if (strcmp(interface, "wl_shm") == 0) { - auto shm = static_cast( -@@ -144,16 +191,21 @@ static void global_registry_handler(void - display->GetEventQueue()); - display->SetPrimarySelectionDeviceManager(primary_selection_device_manager); - } else if (strcmp(interface, "wl_subcompositor") == 0) { - auto subcompositor = static_cast( - wl_registry_bind(registry, id, &wl_subcompositor_interface, 1)); - wl_proxy_set_queue((struct wl_proxy*)subcompositor, - display->GetEventQueue()); - display->SetSubcompositor(subcompositor); -+ } else if (strcmp(interface, "zwp_linux_dmabuf_v1") == 0 && version > 2) { -+ auto dmabuf = static_cast( -+ wl_registry_bind(registry, id, &zwp_linux_dmabuf_v1_interface, 3)); -+ display->SetDmabuf(dmabuf); -+ zwp_linux_dmabuf_v1_add_listener(dmabuf, &dmabuf_listener, data); - } - } - - static void global_registry_remover(void* data, wl_registry* registry, - uint32_t id) {} - - static const struct wl_registry_listener registry_listener = { - global_registry_handler, global_registry_remover}; -@@ -162,27 +214,85 @@ bool nsWaylandDisplay::DispatchEventQueu - wl_display_dispatch_queue_pending(mDisplay, mEventQueue); - return true; - } - - bool nsWaylandDisplay::Matches(wl_display* aDisplay) { - return mThreadId == PR_GetCurrentThread() && aDisplay == mDisplay; - } - -+bool nsWaylandDisplay::ConfigureGbm() { -+ if (!nsGbmLib::IsAvailable()) { -+ return false; -+ } -+ -+ // TODO -+ const char* drm_render_node = getenv("MOZ_WAYLAND_DRM_DEVICE"); -+ if (!drm_render_node) { -+ drm_render_node = "/dev/dri/renderD128"; -+ } -+ -+ mGbmFd = open(drm_render_node, O_RDWR); -+ if (mGbmFd < 0) { -+ NS_WARNING( -+ nsPrintfCString("Failed to open drm render node %s\n", drm_render_node) -+ .get()); -+ return false; -+ } -+ -+ mGbmDevice = nsGbmLib::CreateDevice(mGbmFd); -+ if (mGbmDevice == nullptr) { -+ NS_WARNING(nsPrintfCString("Failed to create drm render device %s\n", -+ drm_render_node) -+ .get()); -+ close(mGbmFd); -+ return false; -+ } -+ -+ return true; -+} -+ -+gbm_device* nsWaylandDisplay::GetGbmDevice() { -+ if (!mGdmConfigured) { -+ ConfigureGbm(); -+ mGdmConfigured = true; -+ } -+ return mGbmDevice; -+} -+ -+int nsWaylandDisplay::GetGbmDeviceFd() { -+ if (!mGdmConfigured) { -+ ConfigureGbm(); -+ mGdmConfigured = true; -+ } -+ return mGbmFd; -+} -+#endif -+ - nsWaylandDisplay::nsWaylandDisplay(wl_display* aDisplay) - : mDispatcherThreadLoop(nullptr), - mThreadId(PR_GetCurrentThread()), - mDisplay(aDisplay), - mEventQueue(nullptr), - mDataDeviceManager(nullptr), - mSubcompositor(nullptr), - mSeat(nullptr), - mShm(nullptr), - mPrimarySelectionDeviceManager(nullptr), -- mRegistry(nullptr) { -+ mRegistry(nullptr) -+#ifdef HAVE_LIBDRM -+ , -+ mGbmDevice(nullptr), -+ mGbmFd(-1), -+ mGdmConfigured(false), -+ mExplicitSync(false), -+ mXRGBFormat({false, false, -1, nullptr, 0}), -+ mARGBFormat({false, false, -1, nullptr, 0}) -+#endif -+{ - mRegistry = wl_display_get_registry(mDisplay); - wl_registry_add_listener(mRegistry, ®istry_listener, this); - - if (NS_IsMainThread()) { - // Use default event queue in main thread operated by Gtk+. - mEventQueue = nullptr; - wl_display_roundtrip(mDisplay); - wl_display_roundtrip(mDisplay); -@@ -205,10 +315,84 @@ nsWaylandDisplay::~nsWaylandDisplay() { - mRegistry = nullptr; - - if (mEventQueue) { - wl_event_queue_destroy(mEventQueue); - mEventQueue = nullptr; - } - } - -+#ifdef HAVE_LIBDRM -+void* nsGbmLib::sGbmLibHandle = nullptr; -+void* nsGbmLib::sXf86DrmLibHandle = nullptr; -+bool nsGbmLib::sLibLoaded = false; -+CreateDeviceFunc nsGbmLib::sCreateDevice; -+CreateFunc nsGbmLib::sCreate; -+CreateWithModifiersFunc nsGbmLib::sCreateWithModifiers; -+GetModifierFunc nsGbmLib::sGetModifier; -+GetStrideFunc nsGbmLib::sGetStride; -+GetFdFunc nsGbmLib::sGetFd; -+DestroyFunc nsGbmLib::sDestroy; -+MapFunc nsGbmLib::sMap; -+UnmapFunc nsGbmLib::sUnmap; -+GetPlaneCountFunc nsGbmLib::sGetPlaneCount; -+GetHandleForPlaneFunc nsGbmLib::sGetHandleForPlane; -+GetStrideForPlaneFunc nsGbmLib::sGetStrideForPlane; -+GetOffsetFunc nsGbmLib::sGetOffset; -+DrmPrimeHandleToFDFunc nsGbmLib::sDrmPrimeHandleToFD; -+ -+bool nsGbmLib::IsAvailable() { -+ if (!Load()) { -+ return false; -+ } -+ return sCreateDevice != nullptr && sCreate != nullptr && -+ sCreateWithModifiers != nullptr && sGetModifier != nullptr && -+ sGetStride != nullptr && sGetFd != nullptr && sDestroy != nullptr && -+ sMap != nullptr && sUnmap != nullptr; -+} -+ -+bool nsGbmLib::IsModifierAvailable() { -+ if (!Load()) { -+ return false; -+ } -+ return sDrmPrimeHandleToFD != nullptr; -+} -+ -+bool nsGbmLib::Load() { -+ if (!sGbmLibHandle && !sLibLoaded) { -+ sLibLoaded = true; -+ -+ sGbmLibHandle = dlopen("libgbm.so", RTLD_LAZY | RTLD_LOCAL); -+ if (!sGbmLibHandle) { -+ return false; -+ } -+ -+ sCreateDevice = (CreateDeviceFunc)dlsym(sGbmLibHandle, "gbm_create_device"); -+ sCreate = (CreateFunc)dlsym(sGbmLibHandle, "gbm_bo_create"); -+ sCreateWithModifiers = (CreateWithModifiersFunc)dlsym( -+ sGbmLibHandle, "gbm_bo_create_with_modifiers"); -+ sGetModifier = (GetModifierFunc)dlsym(sGbmLibHandle, "gbm_bo_get_modifier"); -+ sGetStride = (GetStrideFunc)dlsym(sGbmLibHandle, "gbm_bo_get_stride"); -+ sGetFd = (GetFdFunc)dlsym(sGbmLibHandle, "gbm_bo_get_fd"); -+ sDestroy = (DestroyFunc)dlsym(sGbmLibHandle, "gbm_bo_destroy"); -+ sMap = (MapFunc)dlsym(sGbmLibHandle, "gbm_bo_map"); -+ sUnmap = (UnmapFunc)dlsym(sGbmLibHandle, "gbm_bo_unmap"); -+ sGetPlaneCount = -+ (GetPlaneCountFunc)dlsym(sGbmLibHandle, "gbm_bo_get_plane_count"); -+ sGetHandleForPlane = (GetHandleForPlaneFunc)dlsym( -+ sGbmLibHandle, "gbm_bo_get_handle_for_plane"); -+ sGetStrideForPlane = (GetStrideForPlaneFunc)dlsym( -+ sGbmLibHandle, "gbm_bo_get_stride_for_plane"); -+ sGetOffset = (GetOffsetFunc)dlsym(sGbmLibHandle, "gbm_bo_get_offset"); -+ -+ sXf86DrmLibHandle = dlopen("libdrm.so", RTLD_LAZY | RTLD_LOCAL); -+ if (sXf86DrmLibHandle) { -+ sDrmPrimeHandleToFD = (DrmPrimeHandleToFDFunc)dlsym(sXf86DrmLibHandle, -+ "drmPrimeHandleToFD"); -+ } -+ } -+ -+ return sGbmLibHandle; -+} -+#endif -+ - } // namespace widget - } // namespace mozilla -diff --git a/widget/gtk/nsWaylandDisplay.h b/widget/gtk/nsWaylandDisplay.h ---- a/widget/gtk/nsWaylandDisplay.h -+++ b/widget/gtk/nsWaylandDisplay.h -@@ -1,24 +1,43 @@ - /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ - /* vim:expandtab:shiftwidth=4:tabstop=4: - */ - /* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - --#ifndef __MOZ_WAYLAND_REGISTRY_H__ --#define __MOZ_WAYLAND_REGISTRY_H__ -+#ifndef __MOZ_WAYLAND_DISPLAY_H__ -+#define __MOZ_WAYLAND_DISPLAY_H__ -+ -+#include "mozilla/widget/mozwayland.h" -+#include "mozilla/widget/gtk-primary-selection-client-protocol.h" - --#include "mozwayland/mozwayland.h" --#include "wayland/gtk-primary-selection-client-protocol.h" -+#include "base/message_loop.h" // for MessageLoop -+#include "base/task.h" // for NewRunnableMethod, etc -+#include "mozilla/StaticMutex.h" -+ -+#ifdef HAVE_LIBDRM -+# include -+# include -+# include -+# include "mozilla/widget/linux-dmabuf-unstable-v1-client-protocol.h" -+#endif - - namespace mozilla { - namespace widget { - -+struct GbmFormat { -+ bool mIsSupported; -+ bool mHasAlpha; -+ int mFormat; -+ uint64_t* mModifiers; -+ int mModifiersCount; -+}; -+ - // Our general connection to Wayland display server, - // holds our display connection and runs event loop. - class nsWaylandDisplay { - public: - explicit nsWaylandDisplay(wl_display* aDisplay); - virtual ~nsWaylandDisplay(); - - bool DispatchEventQueue(); -@@ -41,28 +60,143 @@ class nsWaylandDisplay { - void SetSubcompositor(wl_subcompositor* aSubcompositor); - void SetDataDeviceManager(wl_data_device_manager* aDataDeviceManager); - void SetSeat(wl_seat* aSeat); - void SetPrimarySelectionDeviceManager( - gtk_primary_selection_device_manager* aPrimarySelectionDeviceManager); - - void Shutdown(); - -+#ifdef HAVE_LIBDRM -+ void SetDmabuf(zwp_linux_dmabuf_v1* aDmabuf); -+ zwp_linux_dmabuf_v1* GetDmabuf() { return mDmabuf; }; -+ gbm_device* GetGbmDevice(); -+ int GetGbmDeviceFd(); -+ bool IsExplicitSyncEnabled() { return mExplicitSync; } -+ GbmFormat* GetGbmFormat(bool aHasAlpha); -+ void AddFormatModifier(bool aHasAlpha, int aFormat, uint32_t mModifierHi, -+ uint32_t mModifierLo); -+#endif -+ - private: -+#ifdef HAVE_LIBDRM -+ bool ConfigureGbm(); -+#endif -+ - MessageLoop* mDispatcherThreadLoop; - PRThread* mThreadId; - wl_display* mDisplay; - wl_event_queue* mEventQueue; - wl_data_device_manager* mDataDeviceManager; - wl_subcompositor* mSubcompositor; - wl_seat* mSeat; - wl_shm* mShm; - gtk_primary_selection_device_manager* mPrimarySelectionDeviceManager; - wl_registry* mRegistry; -+#ifdef HAVE_LIBDRM -+ zwp_linux_dmabuf_v1* mDmabuf; -+ gbm_device* mGbmDevice; -+ int mGbmFd; -+ bool mGdmConfigured; -+ bool mExplicitSync; -+ GbmFormat mXRGBFormat; -+ GbmFormat mARGBFormat; -+#endif - }; - - void WaylandDispatchDisplays(); - nsWaylandDisplay* WaylandDisplayGet(GdkDisplay* aGdkDisplay = nullptr); - -+#ifdef HAVE_LIBDRM -+typedef struct gbm_device* (*CreateDeviceFunc)(int); -+typedef struct gbm_bo* (*CreateFunc)(struct gbm_device*, uint32_t, uint32_t, -+ uint32_t, uint32_t); -+typedef struct gbm_bo* (*CreateFunc)(struct gbm_device*, uint32_t, uint32_t, -+ uint32_t, uint32_t); -+typedef struct gbm_bo* (*CreateWithModifiersFunc)(struct gbm_device*, uint32_t, -+ uint32_t, uint32_t, -+ const uint64_t*, -+ const unsigned int); -+typedef uint64_t (*GetModifierFunc)(struct gbm_bo*); -+typedef uint32_t (*GetStrideFunc)(struct gbm_bo*); -+typedef int (*GetFdFunc)(struct gbm_bo*); -+typedef void (*DestroyFunc)(struct gbm_bo*); -+typedef void* (*MapFunc)(struct gbm_bo*, uint32_t, uint32_t, uint32_t, uint32_t, -+ uint32_t, uint32_t*, void**); -+typedef void (*UnmapFunc)(struct gbm_bo*, void*); -+typedef int (*GetPlaneCountFunc)(struct gbm_bo*); -+typedef union gbm_bo_handle (*GetHandleForPlaneFunc)(struct gbm_bo*, int); -+typedef uint32_t (*GetStrideForPlaneFunc)(struct gbm_bo*, int); -+typedef uint32_t (*GetOffsetFunc)(struct gbm_bo*, int); -+ -+typedef int (*DrmPrimeHandleToFDFunc)(int, uint32_t, uint32_t, int*); -+ -+class nsGbmLib { -+ public: -+ static bool Load(); -+ static bool IsAvailable(); -+ static bool IsModifierAvailable(); -+ -+ static struct gbm_device* CreateDevice(int fd) { return sCreateDevice(fd); }; -+ static struct gbm_bo* Create(struct gbm_device* gbm, uint32_t width, -+ uint32_t height, uint32_t format, -+ uint32_t flags) { -+ return sCreate(gbm, width, height, format, flags); -+ } -+ static void Destroy(struct gbm_bo* bo) { sDestroy(bo); } -+ static uint32_t GetStride(struct gbm_bo* bo) { return sGetStride(bo); } -+ static int GetFd(struct gbm_bo* bo) { return sGetFd(bo); } -+ static void* Map(struct gbm_bo* bo, uint32_t x, uint32_t y, uint32_t width, -+ uint32_t height, uint32_t flags, uint32_t* stride, -+ void** map_data) { -+ return sMap(bo, x, y, width, height, flags, stride, map_data); -+ } -+ static void Unmap(struct gbm_bo* bo, void* map_data) { sUnmap(bo, map_data); } -+ static struct gbm_bo* CreateWithModifiers(struct gbm_device* gbm, -+ uint32_t width, uint32_t height, -+ uint32_t format, -+ const uint64_t* modifiers, -+ const unsigned int count) { -+ return sCreateWithModifiers(gbm, width, height, format, modifiers, count); -+ } -+ static uint64_t GetModifier(struct gbm_bo* bo) { return sGetModifier(bo); } -+ static int GetPlaneCount(struct gbm_bo* bo) { return sGetPlaneCount(bo); } -+ static union gbm_bo_handle GetHandleForPlane(struct gbm_bo* bo, int plane) { -+ return sGetHandleForPlane(bo, plane); -+ } -+ static uint32_t GetStrideForPlane(struct gbm_bo* bo, int plane) { -+ return sGetStrideForPlane(bo, plane); -+ } -+ static uint32_t GetOffset(struct gbm_bo* bo, int plane) { -+ return sGetOffset(bo, plane); -+ } -+ -+ static int DrmPrimeHandleToFD(int fd, uint32_t handle, uint32_t flags, -+ int* prime_fd) { -+ return sDrmPrimeHandleToFD(fd, handle, flags, prime_fd); -+ } -+ -+ private: -+ static CreateDeviceFunc sCreateDevice; -+ static CreateFunc sCreate; -+ static CreateWithModifiersFunc sCreateWithModifiers; -+ static GetModifierFunc sGetModifier; -+ static GetStrideFunc sGetStride; -+ static GetFdFunc sGetFd; -+ static DestroyFunc sDestroy; -+ static MapFunc sMap; -+ static UnmapFunc sUnmap; -+ static GetPlaneCountFunc sGetPlaneCount; -+ static GetHandleForPlaneFunc sGetHandleForPlane; -+ static GetStrideForPlaneFunc sGetStrideForPlane; -+ static GetOffsetFunc sGetOffset; -+ static DrmPrimeHandleToFDFunc sDrmPrimeHandleToFD; -+ -+ static void* sGbmLibHandle; -+ static void* sXf86DrmLibHandle; -+ static bool sLibLoaded; -+}; -+#endif -+ - } // namespace widget - } // namespace mozilla - --#endif // __MOZ_WAYLAND_REGISTRY_H__ -+#endif // __MOZ_WAYLAND_DISPLAY_H__ -diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp ---- a/widget/gtk/nsWindow.cpp -+++ b/widget/gtk/nsWindow.cpp -@@ -4237,17 +4237,18 @@ LayoutDeviceIntSize nsWindow::GetSafeWin - // reads it as CARD16. Sizes of pixmaps, used for drawing, are (unsigned) - // CARD16 in the protocol, but the server's ProcCreatePixmap returns - // BadAlloc if dimensions cannot be represented by signed shorts. - // Because we are creating Cairo surfaces to represent window buffers, - // we also must ensure that the window can fit in a Cairo surface. - LayoutDeviceIntSize result = aSize; - int32_t maxSize = 32767; - if (mLayerManager && mLayerManager->AsKnowsCompositor()) { -- maxSize = std::min(maxSize, mLayerManager->AsKnowsCompositor()->GetMaxTextureSize()); -+ maxSize = std::min(maxSize, -+ mLayerManager->AsKnowsCompositor()->GetMaxTextureSize()); - } - if (result.width > maxSize) { - result.width = maxSize; - } - if (result.height > maxSize) { - result.height = maxSize; - } - return result; -@@ -6827,21 +6828,24 @@ wl_surface* nsWindow::GetWaylandSurface( - "drawing!"); - return nullptr; - } - - bool nsWindow::WaylandSurfaceNeedsClear() { - if (mContainer) { - return moz_container_surface_needs_clear(MOZ_CONTAINER(mContainer)); - } -- -- NS_WARNING( -- "nsWindow::WaylandSurfaceNeedsClear(): We don't have any mContainer!"); - return false; - } -+ -+void nsWindow::WaylandSurfaceCleared() { -+ if (mContainer) { -+ return moz_container_surface_cleared(MOZ_CONTAINER(mContainer)); -+ } -+} - #endif - - #ifdef MOZ_X11 - /* XApp progress support currently works by setting a property - * on a window with this Atom name. A supporting window manager - * will notice this and pass it along to whatever handling has - * been implemented on that end (e.g. passing it on to a taskbar - * widget.) There is no issue if WM support is lacking, this is -diff --git a/widget/gtk/nsWindow.h b/widget/gtk/nsWindow.h ---- a/widget/gtk/nsWindow.h -+++ b/widget/gtk/nsWindow.h -@@ -341,16 +341,17 @@ class nsWindow final : public nsBaseWidg - - #ifdef MOZ_X11 - Display* XDisplay() { return mXDisplay; } - #endif - #ifdef MOZ_WAYLAND - wl_display* GetWaylandDisplay(); - wl_surface* GetWaylandSurface(); - bool WaylandSurfaceNeedsClear(); -+ void WaylandSurfaceCleared(); - #endif - virtual void GetCompositorWidgetInitData( - mozilla::widget::CompositorWidgetInitData* aInitData) override; - - virtual nsresult SetNonClientMargins( - LayoutDeviceIntMargin& aMargins) override; - void SetDrawsInTitlebar(bool aState) override; - virtual void UpdateWindowDraggingRegion( -diff --git a/widget/gtk/wayland/linux-dmabuf-unstable-v1-client-protocol.h b/widget/gtk/wayland/linux-dmabuf-unstable-v1-client-protocol.h -new file mode 100644 ---- /dev/null -+++ b/widget/gtk/wayland/linux-dmabuf-unstable-v1-client-protocol.h -@@ -0,0 +1,650 @@ -+/* Generated by wayland-scanner 1.17.0 */ -+ -+#ifndef LINUX_DMABUF_UNSTABLE_V1_CLIENT_PROTOCOL_H -+#define LINUX_DMABUF_UNSTABLE_V1_CLIENT_PROTOCOL_H -+ -+#include -+#include -+#include "wayland-client.h" -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+/** -+ * @page page_linux_dmabuf_unstable_v1 The linux_dmabuf_unstable_v1 protocol -+ * @section page_ifaces_linux_dmabuf_unstable_v1 Interfaces -+ * - @subpage page_iface_zwp_linux_dmabuf_v1 - factory for creating dmabuf-based -+ * wl_buffers -+ * - @subpage page_iface_zwp_linux_buffer_params_v1 - parameters for creating a -+ * dmabuf-based wl_buffer -+ * @section page_copyright_linux_dmabuf_unstable_v1 Copyright -+ *
-+ *
-+ * Copyright © 2014, 2015 Collabora, Ltd.
-+ *
-+ * Permission is hereby granted, free of charge, to any person obtaining a
-+ * copy of this software and associated documentation files (the "Software"),
-+ * to deal in the Software without restriction, including without limitation
-+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-+ * and/or sell copies of the Software, and to permit persons to whom the
-+ * Software is furnished to do so, subject to the following conditions:
-+ *
-+ * The above copyright notice and this permission notice (including the next
-+ * paragraph) shall be included in all copies or substantial portions of the
-+ * Software.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
-+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-+ * DEALINGS IN THE SOFTWARE.
-+ * 
-+ */ -+struct wl_buffer; -+struct zwp_linux_buffer_params_v1; -+struct zwp_linux_dmabuf_v1; -+ -+/** -+ * @page page_iface_zwp_linux_dmabuf_v1 zwp_linux_dmabuf_v1 -+ * @section page_iface_zwp_linux_dmabuf_v1_desc Description -+ * -+ * Following the interfaces from: -+ * https://www.khronos.org/registry/egl/extensions/EXT/EGL_EXT_image_dma_buf_import.txt -+ * and the Linux DRM sub-system's AddFb2 ioctl. -+ * -+ * This interface offers ways to create generic dmabuf-based -+ * wl_buffers. Immediately after a client binds to this interface, -+ * the set of supported formats and format modifiers is sent with -+ * 'format' and 'modifier' events. -+ * -+ * The following are required from clients: -+ * -+ * - Clients must ensure that either all data in the dma-buf is -+ * coherent for all subsequent read access or that coherency is -+ * correctly handled by the underlying kernel-side dma-buf -+ * implementation. -+ * -+ * - Don't make any more attachments after sending the buffer to the -+ * compositor. Making more attachments later increases the risk of -+ * the compositor not being able to use (re-import) an existing -+ * dmabuf-based wl_buffer. -+ * -+ * The underlying graphics stack must ensure the following: -+ * -+ * - The dmabuf file descriptors relayed to the server will stay valid -+ * for the whole lifetime of the wl_buffer. This means the server may -+ * at any time use those fds to import the dmabuf into any kernel -+ * sub-system that might accept it. -+ * -+ * To create a wl_buffer from one or more dmabufs, a client creates a -+ * zwp_linux_dmabuf_params_v1 object with a zwp_linux_dmabuf_v1.create_params -+ * request. All planes required by the intended format are added with -+ * the 'add' request. Finally, a 'create' or 'create_immed' request is -+ * issued, which has the following outcome depending on the import success. -+ * -+ * The 'create' request, -+ * - on success, triggers a 'created' event which provides the final -+ * wl_buffer to the client. -+ * - on failure, triggers a 'failed' event to convey that the server -+ * cannot use the dmabufs received from the client. -+ * -+ * For the 'create_immed' request, -+ * - on success, the server immediately imports the added dmabufs to -+ * create a wl_buffer. No event is sent from the server in this case. -+ * - on failure, the server can choose to either: -+ * - terminate the client by raising a fatal error. -+ * - mark the wl_buffer as failed, and send a 'failed' event to the -+ * client. If the client uses a failed wl_buffer as an argument to any -+ * request, the behaviour is compositor implementation-defined. -+ * -+ * Warning! The protocol described in this file is experimental and -+ * backward incompatible changes may be made. Backward compatible changes -+ * may be added together with the corresponding interface version bump. -+ * Backward incompatible changes are done by bumping the version number in -+ * the protocol and interface names and resetting the interface version. -+ * Once the protocol is to be declared stable, the 'z' prefix and the -+ * version number in the protocol and interface names are removed and the -+ * interface version number is reset. -+ * @section page_iface_zwp_linux_dmabuf_v1_api API -+ * See @ref iface_zwp_linux_dmabuf_v1. -+ */ -+/** -+ * @defgroup iface_zwp_linux_dmabuf_v1 The zwp_linux_dmabuf_v1 interface -+ * -+ * Following the interfaces from: -+ * https://www.khronos.org/registry/egl/extensions/EXT/EGL_EXT_image_dma_buf_import.txt -+ * and the Linux DRM sub-system's AddFb2 ioctl. -+ * -+ * This interface offers ways to create generic dmabuf-based -+ * wl_buffers. Immediately after a client binds to this interface, -+ * the set of supported formats and format modifiers is sent with -+ * 'format' and 'modifier' events. -+ * -+ * The following are required from clients: -+ * -+ * - Clients must ensure that either all data in the dma-buf is -+ * coherent for all subsequent read access or that coherency is -+ * correctly handled by the underlying kernel-side dma-buf -+ * implementation. -+ * -+ * - Don't make any more attachments after sending the buffer to the -+ * compositor. Making more attachments later increases the risk of -+ * the compositor not being able to use (re-import) an existing -+ * dmabuf-based wl_buffer. -+ * -+ * The underlying graphics stack must ensure the following: -+ * -+ * - The dmabuf file descriptors relayed to the server will stay valid -+ * for the whole lifetime of the wl_buffer. This means the server may -+ * at any time use those fds to import the dmabuf into any kernel -+ * sub-system that might accept it. -+ * -+ * To create a wl_buffer from one or more dmabufs, a client creates a -+ * zwp_linux_dmabuf_params_v1 object with a zwp_linux_dmabuf_v1.create_params -+ * request. All planes required by the intended format are added with -+ * the 'add' request. Finally, a 'create' or 'create_immed' request is -+ * issued, which has the following outcome depending on the import success. -+ * -+ * The 'create' request, -+ * - on success, triggers a 'created' event which provides the final -+ * wl_buffer to the client. -+ * - on failure, triggers a 'failed' event to convey that the server -+ * cannot use the dmabufs received from the client. -+ * -+ * For the 'create_immed' request, -+ * - on success, the server immediately imports the added dmabufs to -+ * create a wl_buffer. No event is sent from the server in this case. -+ * - on failure, the server can choose to either: -+ * - terminate the client by raising a fatal error. -+ * - mark the wl_buffer as failed, and send a 'failed' event to the -+ * client. If the client uses a failed wl_buffer as an argument to any -+ * request, the behaviour is compositor implementation-defined. -+ * -+ * Warning! The protocol described in this file is experimental and -+ * backward incompatible changes may be made. Backward compatible changes -+ * may be added together with the corresponding interface version bump. -+ * Backward incompatible changes are done by bumping the version number in -+ * the protocol and interface names and resetting the interface version. -+ * Once the protocol is to be declared stable, the 'z' prefix and the -+ * version number in the protocol and interface names are removed and the -+ * interface version number is reset. -+ */ -+extern const struct wl_interface zwp_linux_dmabuf_v1_interface; -+/** -+ * @page page_iface_zwp_linux_buffer_params_v1 zwp_linux_buffer_params_v1 -+ * @section page_iface_zwp_linux_buffer_params_v1_desc Description -+ * -+ * This temporary object is a collection of dmabufs and other -+ * parameters that together form a single logical buffer. The temporary -+ * object may eventually create one wl_buffer unless cancelled by -+ * destroying it before requesting 'create'. -+ * -+ * Single-planar formats only require one dmabuf, however -+ * multi-planar formats may require more than one dmabuf. For all -+ * formats, an 'add' request must be called once per plane (even if the -+ * underlying dmabuf fd is identical). -+ * -+ * You must use consecutive plane indices ('plane_idx' argument for 'add') -+ * from zero to the number of planes used by the drm_fourcc format code. -+ * All planes required by the format must be given exactly once, but can -+ * be given in any order. Each plane index can be set only once. -+ * @section page_iface_zwp_linux_buffer_params_v1_api API -+ * See @ref iface_zwp_linux_buffer_params_v1. -+ */ -+/** -+ * @defgroup iface_zwp_linux_buffer_params_v1 The zwp_linux_buffer_params_v1 -+ * interface -+ * -+ * This temporary object is a collection of dmabufs and other -+ * parameters that together form a single logical buffer. The temporary -+ * object may eventually create one wl_buffer unless cancelled by -+ * destroying it before requesting 'create'. -+ * -+ * Single-planar formats only require one dmabuf, however -+ * multi-planar formats may require more than one dmabuf. For all -+ * formats, an 'add' request must be called once per plane (even if the -+ * underlying dmabuf fd is identical). -+ * -+ * You must use consecutive plane indices ('plane_idx' argument for 'add') -+ * from zero to the number of planes used by the drm_fourcc format code. -+ * All planes required by the format must be given exactly once, but can -+ * be given in any order. Each plane index can be set only once. -+ */ -+extern const struct wl_interface zwp_linux_buffer_params_v1_interface; -+ -+/** -+ * @ingroup iface_zwp_linux_dmabuf_v1 -+ * @struct zwp_linux_dmabuf_v1_listener -+ */ -+struct zwp_linux_dmabuf_v1_listener { -+ /** -+ * supported buffer format -+ * -+ * This event advertises one buffer format that the server -+ * supports. All the supported formats are advertised once when the -+ * client binds to this interface. A roundtrip after binding -+ * guarantees that the client has received all supported formats. -+ * -+ * For the definition of the format codes, see the -+ * zwp_linux_buffer_params_v1::create request. -+ * -+ * Warning: the 'format' event is likely to be deprecated and -+ * replaced with the 'modifier' event introduced in -+ * zwp_linux_dmabuf_v1 version 3, described below. Please refrain -+ * from using the information received from this event. -+ * @param format DRM_FORMAT code -+ */ -+ void (*format)(void* data, struct zwp_linux_dmabuf_v1* zwp_linux_dmabuf_v1, -+ uint32_t format); -+ /** -+ * supported buffer format modifier -+ * -+ * This event advertises the formats that the server supports, -+ * along with the modifiers supported for each format. All the -+ * supported modifiers for all the supported formats are advertised -+ * once when the client binds to this interface. A roundtrip after -+ * binding guarantees that the client has received all supported -+ * format-modifier pairs. -+ * -+ * For the definition of the format and modifier codes, see the -+ * zwp_linux_buffer_params_v1::create request. -+ * @param format DRM_FORMAT code -+ * @param modifier_hi high 32 bits of layout modifier -+ * @param modifier_lo low 32 bits of layout modifier -+ * @since 3 -+ */ -+ void (*modifier)(void* data, struct zwp_linux_dmabuf_v1* zwp_linux_dmabuf_v1, -+ uint32_t format, uint32_t modifier_hi, uint32_t modifier_lo); -+}; -+ -+/** -+ * @ingroup iface_zwp_linux_dmabuf_v1 -+ */ -+static inline int zwp_linux_dmabuf_v1_add_listener( -+ struct zwp_linux_dmabuf_v1* zwp_linux_dmabuf_v1, -+ const struct zwp_linux_dmabuf_v1_listener* listener, void* data) { -+ return wl_proxy_add_listener((struct wl_proxy*)zwp_linux_dmabuf_v1, -+ (void (**)(void))listener, data); -+} -+ -+#define ZWP_LINUX_DMABUF_V1_DESTROY 0 -+#define ZWP_LINUX_DMABUF_V1_CREATE_PARAMS 1 -+ -+/** -+ * @ingroup iface_zwp_linux_dmabuf_v1 -+ */ -+#define ZWP_LINUX_DMABUF_V1_FORMAT_SINCE_VERSION 1 -+/** -+ * @ingroup iface_zwp_linux_dmabuf_v1 -+ */ -+#define ZWP_LINUX_DMABUF_V1_MODIFIER_SINCE_VERSION 3 -+ -+/** -+ * @ingroup iface_zwp_linux_dmabuf_v1 -+ */ -+#define ZWP_LINUX_DMABUF_V1_DESTROY_SINCE_VERSION 1 -+/** -+ * @ingroup iface_zwp_linux_dmabuf_v1 -+ */ -+#define ZWP_LINUX_DMABUF_V1_CREATE_PARAMS_SINCE_VERSION 1 -+ -+/** @ingroup iface_zwp_linux_dmabuf_v1 */ -+static inline void zwp_linux_dmabuf_v1_set_user_data( -+ struct zwp_linux_dmabuf_v1* zwp_linux_dmabuf_v1, void* user_data) { -+ wl_proxy_set_user_data((struct wl_proxy*)zwp_linux_dmabuf_v1, user_data); -+} -+ -+/** @ingroup iface_zwp_linux_dmabuf_v1 */ -+static inline void* zwp_linux_dmabuf_v1_get_user_data( -+ struct zwp_linux_dmabuf_v1* zwp_linux_dmabuf_v1) { -+ return wl_proxy_get_user_data((struct wl_proxy*)zwp_linux_dmabuf_v1); -+} -+ -+static inline uint32_t zwp_linux_dmabuf_v1_get_version( -+ struct zwp_linux_dmabuf_v1* zwp_linux_dmabuf_v1) { -+ return wl_proxy_get_version((struct wl_proxy*)zwp_linux_dmabuf_v1); -+} -+ -+/** -+ * @ingroup iface_zwp_linux_dmabuf_v1 -+ * -+ * Objects created through this interface, especially wl_buffers, will -+ * remain valid. -+ */ -+static inline void zwp_linux_dmabuf_v1_destroy( -+ struct zwp_linux_dmabuf_v1* zwp_linux_dmabuf_v1) { -+ wl_proxy_marshal((struct wl_proxy*)zwp_linux_dmabuf_v1, -+ ZWP_LINUX_DMABUF_V1_DESTROY); -+ -+ wl_proxy_destroy((struct wl_proxy*)zwp_linux_dmabuf_v1); -+} -+ -+/** -+ * @ingroup iface_zwp_linux_dmabuf_v1 -+ * -+ * This temporary object is used to collect multiple dmabuf handles into -+ * a single batch to create a wl_buffer. It can only be used once and -+ * should be destroyed after a 'created' or 'failed' event has been -+ * received. -+ */ -+static inline struct zwp_linux_buffer_params_v1* -+zwp_linux_dmabuf_v1_create_params( -+ struct zwp_linux_dmabuf_v1* zwp_linux_dmabuf_v1) { -+ struct wl_proxy* params_id; -+ -+ params_id = wl_proxy_marshal_constructor( -+ (struct wl_proxy*)zwp_linux_dmabuf_v1, ZWP_LINUX_DMABUF_V1_CREATE_PARAMS, -+ &zwp_linux_buffer_params_v1_interface, NULL); -+ -+ return (struct zwp_linux_buffer_params_v1*)params_id; -+} -+ -+#ifndef ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_ENUM -+# define ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_ENUM -+enum zwp_linux_buffer_params_v1_error { -+ /** -+ * the dmabuf_batch object has already been used to create a wl_buffer -+ */ -+ ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_ALREADY_USED = 0, -+ /** -+ * plane index out of bounds -+ */ -+ ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_PLANE_IDX = 1, -+ /** -+ * the plane index was already set -+ */ -+ ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_PLANE_SET = 2, -+ /** -+ * missing or too many planes to create a buffer -+ */ -+ ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INCOMPLETE = 3, -+ /** -+ * format not supported -+ */ -+ ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INVALID_FORMAT = 4, -+ /** -+ * invalid width or height -+ */ -+ ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INVALID_DIMENSIONS = 5, -+ /** -+ * offset + stride * height goes out of dmabuf bounds -+ */ -+ ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_OUT_OF_BOUNDS = 6, -+ /** -+ * invalid wl_buffer resulted from importing dmabufs via the -+ * create_immed request on given buffer_params -+ */ -+ ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INVALID_WL_BUFFER = 7, -+}; -+#endif /* ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_ENUM */ -+ -+#ifndef ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_ENUM -+# define ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_ENUM -+enum zwp_linux_buffer_params_v1_flags { -+ /** -+ * contents are y-inverted -+ */ -+ ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_Y_INVERT = 1, -+ /** -+ * content is interlaced -+ */ -+ ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_INTERLACED = 2, -+ /** -+ * bottom field first -+ */ -+ ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_BOTTOM_FIRST = 4, -+}; -+#endif /* ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_ENUM */ -+ -+/** -+ * @ingroup iface_zwp_linux_buffer_params_v1 -+ * @struct zwp_linux_buffer_params_v1_listener -+ */ -+struct zwp_linux_buffer_params_v1_listener { -+ /** -+ * buffer creation succeeded -+ * -+ * This event indicates that the attempted buffer creation was -+ * successful. It provides the new wl_buffer referencing the -+ * dmabuf(s). -+ * -+ * Upon receiving this event, the client should destroy the -+ * zlinux_dmabuf_params object. -+ * @param buffer the newly created wl_buffer -+ */ -+ void (*created)(void* data, -+ struct zwp_linux_buffer_params_v1* zwp_linux_buffer_params_v1, -+ struct wl_buffer* buffer); -+ /** -+ * buffer creation failed -+ * -+ * This event indicates that the attempted buffer creation has -+ * failed. It usually means that one of the dmabuf constraints has -+ * not been fulfilled. -+ * -+ * Upon receiving this event, the client should destroy the -+ * zlinux_buffer_params object. -+ */ -+ void (*failed)(void* data, -+ struct zwp_linux_buffer_params_v1* zwp_linux_buffer_params_v1); -+}; -+ -+/** -+ * @ingroup iface_zwp_linux_buffer_params_v1 -+ */ -+static inline int zwp_linux_buffer_params_v1_add_listener( -+ struct zwp_linux_buffer_params_v1* zwp_linux_buffer_params_v1, -+ const struct zwp_linux_buffer_params_v1_listener* listener, void* data) { -+ return wl_proxy_add_listener((struct wl_proxy*)zwp_linux_buffer_params_v1, -+ (void (**)(void))listener, data); -+} -+ -+#define ZWP_LINUX_BUFFER_PARAMS_V1_DESTROY 0 -+#define ZWP_LINUX_BUFFER_PARAMS_V1_ADD 1 -+#define ZWP_LINUX_BUFFER_PARAMS_V1_CREATE 2 -+#define ZWP_LINUX_BUFFER_PARAMS_V1_CREATE_IMMED 3 -+ -+/** -+ * @ingroup iface_zwp_linux_buffer_params_v1 -+ */ -+#define ZWP_LINUX_BUFFER_PARAMS_V1_CREATED_SINCE_VERSION 1 -+/** -+ * @ingroup iface_zwp_linux_buffer_params_v1 -+ */ -+#define ZWP_LINUX_BUFFER_PARAMS_V1_FAILED_SINCE_VERSION 1 -+ -+/** -+ * @ingroup iface_zwp_linux_buffer_params_v1 -+ */ -+#define ZWP_LINUX_BUFFER_PARAMS_V1_DESTROY_SINCE_VERSION 1 -+/** -+ * @ingroup iface_zwp_linux_buffer_params_v1 -+ */ -+#define ZWP_LINUX_BUFFER_PARAMS_V1_ADD_SINCE_VERSION 1 -+/** -+ * @ingroup iface_zwp_linux_buffer_params_v1 -+ */ -+#define ZWP_LINUX_BUFFER_PARAMS_V1_CREATE_SINCE_VERSION 1 -+/** -+ * @ingroup iface_zwp_linux_buffer_params_v1 -+ */ -+#define ZWP_LINUX_BUFFER_PARAMS_V1_CREATE_IMMED_SINCE_VERSION 2 -+ -+/** @ingroup iface_zwp_linux_buffer_params_v1 */ -+static inline void zwp_linux_buffer_params_v1_set_user_data( -+ struct zwp_linux_buffer_params_v1* zwp_linux_buffer_params_v1, -+ void* user_data) { -+ wl_proxy_set_user_data((struct wl_proxy*)zwp_linux_buffer_params_v1, -+ user_data); -+} -+ -+/** @ingroup iface_zwp_linux_buffer_params_v1 */ -+static inline void* zwp_linux_buffer_params_v1_get_user_data( -+ struct zwp_linux_buffer_params_v1* zwp_linux_buffer_params_v1) { -+ return wl_proxy_get_user_data((struct wl_proxy*)zwp_linux_buffer_params_v1); -+} -+ -+static inline uint32_t zwp_linux_buffer_params_v1_get_version( -+ struct zwp_linux_buffer_params_v1* zwp_linux_buffer_params_v1) { -+ return wl_proxy_get_version((struct wl_proxy*)zwp_linux_buffer_params_v1); -+} -+ -+/** -+ * @ingroup iface_zwp_linux_buffer_params_v1 -+ * -+ * Cleans up the temporary data sent to the server for dmabuf-based -+ * wl_buffer creation. -+ */ -+static inline void zwp_linux_buffer_params_v1_destroy( -+ struct zwp_linux_buffer_params_v1* zwp_linux_buffer_params_v1) { -+ wl_proxy_marshal((struct wl_proxy*)zwp_linux_buffer_params_v1, -+ ZWP_LINUX_BUFFER_PARAMS_V1_DESTROY); -+ -+ wl_proxy_destroy((struct wl_proxy*)zwp_linux_buffer_params_v1); -+} -+ -+/** -+ * @ingroup iface_zwp_linux_buffer_params_v1 -+ * -+ * This request adds one dmabuf to the set in this -+ * zwp_linux_buffer_params_v1. -+ * -+ * The 64-bit unsigned value combined from modifier_hi and modifier_lo -+ * is the dmabuf layout modifier. DRM AddFB2 ioctl calls this the -+ * fb modifier, which is defined in drm_mode.h of Linux UAPI. -+ * This is an opaque token. Drivers use this token to express tiling, -+ * compression, etc. driver-specific modifications to the base format -+ * defined by the DRM fourcc code. -+ * -+ * This request raises the PLANE_IDX error if plane_idx is too large. -+ * The error PLANE_SET is raised if attempting to set a plane that -+ * was already set. -+ */ -+static inline void zwp_linux_buffer_params_v1_add( -+ struct zwp_linux_buffer_params_v1* zwp_linux_buffer_params_v1, int32_t fd, -+ uint32_t plane_idx, uint32_t offset, uint32_t stride, uint32_t modifier_hi, -+ uint32_t modifier_lo) { -+ wl_proxy_marshal((struct wl_proxy*)zwp_linux_buffer_params_v1, -+ ZWP_LINUX_BUFFER_PARAMS_V1_ADD, fd, plane_idx, offset, -+ stride, modifier_hi, modifier_lo); -+} -+ -+/** -+ * @ingroup iface_zwp_linux_buffer_params_v1 -+ * -+ * This asks for creation of a wl_buffer from the added dmabuf -+ * buffers. The wl_buffer is not created immediately but returned via -+ * the 'created' event if the dmabuf sharing succeeds. The sharing -+ * may fail at runtime for reasons a client cannot predict, in -+ * which case the 'failed' event is triggered. -+ * -+ * The 'format' argument is a DRM_FORMAT code, as defined by the -+ * libdrm's drm_fourcc.h. The Linux kernel's DRM sub-system is the -+ * authoritative source on how the format codes should work. -+ * -+ * The 'flags' is a bitfield of the flags defined in enum "flags". -+ * 'y_invert' means the that the image needs to be y-flipped. -+ * -+ * Flag 'interlaced' means that the frame in the buffer is not -+ * progressive as usual, but interlaced. An interlaced buffer as -+ * supported here must always contain both top and bottom fields. -+ * The top field always begins on the first pixel row. The temporal -+ * ordering between the two fields is top field first, unless -+ * 'bottom_first' is specified. It is undefined whether 'bottom_first' -+ * is ignored if 'interlaced' is not set. -+ * -+ * This protocol does not convey any information about field rate, -+ * duration, or timing, other than the relative ordering between the -+ * two fields in one buffer. A compositor may have to estimate the -+ * intended field rate from the incoming buffer rate. It is undefined -+ * whether the time of receiving wl_surface.commit with a new buffer -+ * attached, applying the wl_surface state, wl_surface.frame callback -+ * trigger, presentation, or any other point in the compositor cycle -+ * is used to measure the frame or field times. There is no support -+ * for detecting missed or late frames/fields/buffers either, and -+ * there is no support whatsoever for cooperating with interlaced -+ * compositor output. -+ * -+ * The composited image quality resulting from the use of interlaced -+ * buffers is explicitly undefined. A compositor may use elaborate -+ * hardware features or software to deinterlace and create progressive -+ * output frames from a sequence of interlaced input buffers, or it -+ * may produce substandard image quality. However, compositors that -+ * cannot guarantee reasonable image quality in all cases are recommended -+ * to just reject all interlaced buffers. -+ * -+ * Any argument errors, including non-positive width or height, -+ * mismatch between the number of planes and the format, bad -+ * format, bad offset or stride, may be indicated by fatal protocol -+ * errors: INCOMPLETE, INVALID_FORMAT, INVALID_DIMENSIONS, -+ * OUT_OF_BOUNDS. -+ * -+ * Dmabuf import errors in the server that are not obvious client -+ * bugs are returned via the 'failed' event as non-fatal. This -+ * allows attempting dmabuf sharing and falling back in the client -+ * if it fails. -+ * -+ * This request can be sent only once in the object's lifetime, after -+ * which the only legal request is destroy. This object should be -+ * destroyed after issuing a 'create' request. Attempting to use this -+ * object after issuing 'create' raises ALREADY_USED protocol error. -+ * -+ * It is not mandatory to issue 'create'. If a client wants to -+ * cancel the buffer creation, it can just destroy this object. -+ */ -+static inline void zwp_linux_buffer_params_v1_create( -+ struct zwp_linux_buffer_params_v1* zwp_linux_buffer_params_v1, -+ int32_t width, int32_t height, uint32_t format, uint32_t flags) { -+ wl_proxy_marshal((struct wl_proxy*)zwp_linux_buffer_params_v1, -+ ZWP_LINUX_BUFFER_PARAMS_V1_CREATE, width, height, format, -+ flags); -+} -+ -+/** -+ * @ingroup iface_zwp_linux_buffer_params_v1 -+ * -+ * This asks for immediate creation of a wl_buffer by importing the -+ * added dmabufs. -+ * -+ * In case of import success, no event is sent from the server, and the -+ * wl_buffer is ready to be used by the client. -+ * -+ * Upon import failure, either of the following may happen, as seen fit -+ * by the implementation: -+ * - the client is terminated with one of the following fatal protocol -+ * errors: -+ * - INCOMPLETE, INVALID_FORMAT, INVALID_DIMENSIONS, OUT_OF_BOUNDS, -+ * in case of argument errors such as mismatch between the number -+ * of planes and the format, bad format, non-positive width or -+ * height, or bad offset or stride. -+ * - INVALID_WL_BUFFER, in case the cause for failure is unknown or -+ * plaform specific. -+ * - the server creates an invalid wl_buffer, marks it as failed and -+ * sends a 'failed' event to the client. The result of using this -+ * invalid wl_buffer as an argument in any request by the client is -+ * defined by the compositor implementation. -+ * -+ * This takes the same arguments as a 'create' request, and obeys the -+ * same restrictions. -+ */ -+static inline struct wl_buffer* zwp_linux_buffer_params_v1_create_immed( -+ struct zwp_linux_buffer_params_v1* zwp_linux_buffer_params_v1, -+ int32_t width, int32_t height, uint32_t format, uint32_t flags) { -+ struct wl_proxy* buffer_id; -+ -+ buffer_id = wl_proxy_marshal_constructor( -+ (struct wl_proxy*)zwp_linux_buffer_params_v1, -+ ZWP_LINUX_BUFFER_PARAMS_V1_CREATE_IMMED, &wl_buffer_interface, NULL, -+ width, height, format, flags); -+ -+ return (struct wl_buffer*)buffer_id; -+} -+ -+#ifdef __cplusplus -+} -+#endif -+ -+#endif -diff --git a/widget/gtk/wayland/linux-dmabuf-unstable-v1-protocol.c b/widget/gtk/wayland/linux-dmabuf-unstable-v1-protocol.c -new file mode 100644 ---- /dev/null -+++ b/widget/gtk/wayland/linux-dmabuf-unstable-v1-protocol.c -@@ -0,0 +1,81 @@ -+/* Generated by wayland-scanner 1.17.0 */ -+ -+/* -+ * Copyright © 2014, 2015 Collabora, Ltd. -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the "Software"), -+ * to deal in the Software without restriction, including without limitation -+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, -+ * and/or sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice (including the next -+ * paragraph) shall be included in all copies or substantial portions of the -+ * Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -+ * DEALINGS IN THE SOFTWARE. -+ */ -+ -+#include -+#include -+#include "wayland-util.h" -+ -+#pragma GCC visibility push(default) -+extern const struct wl_interface wl_buffer_interface; -+extern const struct wl_interface zwp_linux_buffer_params_v1_interface; -+#pragma GCC visibility pop -+ -+static const struct wl_interface* types[] = { -+ NULL, -+ NULL, -+ NULL, -+ NULL, -+ NULL, -+ NULL, -+ &zwp_linux_buffer_params_v1_interface, -+ &wl_buffer_interface, -+ NULL, -+ NULL, -+ NULL, -+ NULL, -+ &wl_buffer_interface, -+}; -+ -+static const struct wl_message zwp_linux_dmabuf_v1_requests[] = { -+ {"destroy", "", types + 0}, -+ {"create_params", "n", types + 6}, -+}; -+ -+static const struct wl_message zwp_linux_dmabuf_v1_events[] = { -+ {"format", "u", types + 0}, -+ {"modifier", "3uuu", types + 0}, -+}; -+ -+const struct wl_interface zwp_linux_dmabuf_v1_interface = { -+ "zwp_linux_dmabuf_v1", 3, 2, -+ zwp_linux_dmabuf_v1_requests, 2, zwp_linux_dmabuf_v1_events, -+}; -+ -+static const struct wl_message zwp_linux_buffer_params_v1_requests[] = { -+ {"destroy", "", types + 0}, -+ {"add", "huuuuu", types + 0}, -+ {"create", "iiuu", types + 0}, -+ {"create_immed", "2niiuu", types + 7}, -+}; -+ -+static const struct wl_message zwp_linux_buffer_params_v1_events[] = { -+ {"created", "n", types + 12}, -+ {"failed", "", types + 0}, -+}; -+ -+const struct wl_interface zwp_linux_buffer_params_v1_interface = { -+ "zwp_linux_buffer_params_v1", 3, 4, -+ zwp_linux_buffer_params_v1_requests, 2, zwp_linux_buffer_params_v1_events, -+}; -diff --git a/widget/gtk/wayland/moz.build b/widget/gtk/wayland/moz.build ---- a/widget/gtk/wayland/moz.build -+++ b/widget/gtk/wayland/moz.build -@@ -4,16 +4,22 @@ - # License, v. 2.0. If a copy of the MPL was not distributed with this - # file, You can obtain one at http://mozilla.org/MPL/2.0/. - - with Files("**"): - BUG_COMPONENT = ("Core", "Widget: Gtk") - - SOURCES += [ - 'gtk-primary-selection-protocol.c', -+ 'linux-dmabuf-unstable-v1-protocol.c' -+] -+ -+EXPORTS.mozilla.widget += [ -+ 'gtk-primary-selection-client-protocol.h', -+ 'linux-dmabuf-unstable-v1-client-protocol.h', - ] - - include('/ipc/chromium/chromium-config.mozbuild') - - FINAL_LIBRARY = 'xul' - - CFLAGS += CONFIG['TK_CFLAGS'] - CXXFLAGS += CONFIG['TK_CFLAGS'] - diff --git a/mozilla-1667096.patch b/mozilla-1667096.patch new file mode 100644 index 0000000..d26be4d --- /dev/null +++ b/mozilla-1667096.patch @@ -0,0 +1,550 @@ +diff -up firefox-127.0/media/ffvpx/libavcodec/codec_list.c.1667096 firefox-127.0/media/ffvpx/libavcodec/codec_list.c +--- firefox-127.0/media/ffvpx/libavcodec/codec_list.c.1667096 2024-06-06 23:33:57.000000000 +0200 ++++ firefox-127.0/media/ffvpx/libavcodec/codec_list.c 2024-06-10 12:42:39.353913204 +0200 +@@ -11,6 +11,9 @@ static const FFCodec * const codec_list[ + #if CONFIG_MP3_DECODER + &ff_mp3_decoder, + #endif ++#ifdef CONFIG_LIBFDK_AAC ++ &ff_libfdk_aac_decoder, ++#endif + #if CONFIG_LIBDAV1D + &ff_libdav1d_decoder, + #endif +diff -up firefox-127.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 firefox-127.0/media/ffvpx/libavcodec/libfdk-aacdec.c +--- firefox-127.0/media/ffvpx/libavcodec/libfdk-aacdec.c.1667096 2024-06-10 12:42:39.354913201 +0200 ++++ firefox-127.0/media/ffvpx/libavcodec/libfdk-aacdec.c 2024-06-10 16:28:30.332367814 +0200 +@@ -0,0 +1,498 @@ ++/* ++ * AAC decoder wrapper ++ * Copyright (c) 2012 Martin Storsjo ++ * ++ * This file is part of FFmpeg. ++ * ++ * Permission to use, copy, modify, and/or distribute this software for any ++ * purpose with or without fee is hereby granted, provided that the above ++ * copyright notice and this permission notice appear in all copies. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES ++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF ++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES ++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF ++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ++ */ ++ ++#include ++ ++#include "libavutil/channel_layout.h" ++#include "libavutil/common.h" ++#include "libavutil/opt.h" ++#include "libavutil/mem.h" ++#include "avcodec.h" ++#include "codec_internal.h" ++#include "decode.h" ++ ++#ifdef AACDECODER_LIB_VL0 ++#define FDKDEC_VER_AT_LEAST(vl0, vl1) \ ++ ((AACDECODER_LIB_VL0 > vl0) || \ ++ (AACDECODER_LIB_VL0 == vl0 && AACDECODER_LIB_VL1 >= vl1)) ++#else ++#define FDKDEC_VER_AT_LEAST(vl0, vl1) 0 ++#endif ++ ++#if !FDKDEC_VER_AT_LEAST(2, 5) // < 2.5.10 ++#define AAC_PCM_MAX_OUTPUT_CHANNELS AAC_PCM_OUTPUT_CHANNELS ++#endif ++ ++enum ConcealMethod { ++ CONCEAL_METHOD_SPECTRAL_MUTING = 0, ++ CONCEAL_METHOD_NOISE_SUBSTITUTION = 1, ++ CONCEAL_METHOD_ENERGY_INTERPOLATION = 2, ++ CONCEAL_METHOD_NB, ++}; ++ ++typedef struct FDKAACDecContext { ++ const AVClass *class; ++ HANDLE_AACDECODER handle; ++ uint8_t *decoder_buffer; ++ int decoder_buffer_size; ++ uint8_t *anc_buffer; ++ int conceal_method; ++ int drc_level; ++ int drc_boost; ++ int drc_heavy; ++ int drc_effect; ++ int drc_cut; ++ int album_mode; ++ int level_limit; ++#if FDKDEC_VER_AT_LEAST(2, 5) // 2.5.10 ++ int output_delay_set; ++ int flush_samples; ++ int delay_samples; ++#endif ++ AVChannelLayout downmix_layout; ++} FDKAACDecContext; ++ ++ ++#define DMX_ANC_BUFFSIZE 128 ++#define DECODER_MAX_CHANNELS 8 ++#define DECODER_BUFFSIZE 2048 * sizeof(INT_PCM) ++ ++#define OFFSET(x) offsetof(FDKAACDecContext, x) ++#define AD AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_DECODING_PARAM ++static const AVOption fdk_aac_dec_options[] = { ++ { "conceal", "Error concealment method", OFFSET(conceal_method), AV_OPT_TYPE_INT, { .i64 = CONCEAL_METHOD_NOISE_SUBSTITUTION }, CONCEAL_METHOD_SPECTRAL_MUTING, CONCEAL_METHOD_NB - 1, AD, "conceal" }, ++ { "spectral", "Spectral muting", 0, AV_OPT_TYPE_CONST, { .i64 = CONCEAL_METHOD_SPECTRAL_MUTING }, INT_MIN, INT_MAX, AD, "conceal" }, ++ { "noise", "Noise Substitution", 0, AV_OPT_TYPE_CONST, { .i64 = CONCEAL_METHOD_NOISE_SUBSTITUTION }, INT_MIN, INT_MAX, AD, "conceal" }, ++ { "energy", "Energy Interpolation", 0, AV_OPT_TYPE_CONST, { .i64 = CONCEAL_METHOD_ENERGY_INTERPOLATION }, INT_MIN, INT_MAX, AD, "conceal" }, ++ { "drc_boost", "Dynamic Range Control: boost, where [0] is none and [127] is max boost", ++ OFFSET(drc_boost), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 127, AD, NULL }, ++ { "drc_cut", "Dynamic Range Control: attenuation factor, where [0] is none and [127] is max compression", ++ OFFSET(drc_cut), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 127, AD, NULL }, ++ { "drc_level", "Dynamic Range Control: reference level, quantized to 0.25dB steps where [0] is 0dB and [127] is -31.75dB, -1 for auto, and -2 for disabled", ++ OFFSET(drc_level), AV_OPT_TYPE_INT, { .i64 = -1}, -2, 127, AD, NULL }, ++ { "drc_heavy", "Dynamic Range Control: heavy compression, where [1] is on (RF mode) and [0] is off", ++ OFFSET(drc_heavy), AV_OPT_TYPE_INT, { .i64 = -1}, -1, 1, AD, NULL }, ++#if FDKDEC_VER_AT_LEAST(2, 5) // 2.5.10 ++ { "level_limit", "Signal level limiting", ++ OFFSET(level_limit), AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, AD }, ++#endif ++#if FDKDEC_VER_AT_LEAST(3, 0) // 3.0.0 ++ { "drc_effect","Dynamic Range Control: effect type, where e.g. [0] is none and [6] is general", ++ OFFSET(drc_effect), AV_OPT_TYPE_INT, { .i64 = -1}, -1, 8, AD, NULL }, ++#endif ++#if FDKDEC_VER_AT_LEAST(3, 1) // 3.1.0 ++ { "album_mode","Dynamic Range Control: album mode, where [0] is off and [1] is on", ++ OFFSET(album_mode), AV_OPT_TYPE_INT, { .i64 = -1}, -1, 1, AD, NULL }, ++#endif ++ { "downmix", "Request a specific channel layout from the decoder", OFFSET(downmix_layout), AV_OPT_TYPE_CHLAYOUT, {.str = NULL}, .flags = AD }, ++ { NULL } ++}; ++ ++static const AVClass fdk_aac_dec_class = { ++ .class_name = "libfdk-aac decoder", ++ .item_name = av_default_item_name, ++ .option = fdk_aac_dec_options, ++ .version = LIBAVUTIL_VERSION_INT, ++}; ++ ++static int get_stream_info(AVCodecContext *avctx) ++{ ++ FDKAACDecContext *s = avctx->priv_data; ++ CStreamInfo *info = aacDecoder_GetStreamInfo(s->handle); ++ int channel_counts[0x24] = { 0 }; ++ int i, ch_error = 0; ++ uint64_t ch_layout = 0; ++ ++ if (!info) { ++ av_log(avctx, AV_LOG_ERROR, "Unable to get stream info\n"); ++ return AVERROR_UNKNOWN; ++ } ++ ++ if (info->sampleRate <= 0) { ++ av_log(avctx, AV_LOG_ERROR, "Stream info not initialized\n"); ++ return AVERROR_UNKNOWN; ++ } ++ avctx->sample_rate = info->sampleRate; ++ avctx->frame_size = info->frameSize; ++#if FDKDEC_VER_AT_LEAST(2, 5) // 2.5.10 ++ if (!s->output_delay_set && info->outputDelay) { ++ // Set this only once. ++ s->flush_samples = info->outputDelay; ++ s->delay_samples = info->outputDelay; ++ s->output_delay_set = 1; ++ } ++#endif ++ ++ for (i = 0; i < info->numChannels; i++) { ++ AUDIO_CHANNEL_TYPE ctype = info->pChannelType[i]; ++ if (ctype <= ACT_NONE || ctype >= FF_ARRAY_ELEMS(channel_counts)) { ++ av_log(avctx, AV_LOG_WARNING, "unknown channel type\n"); ++ break; ++ } ++ channel_counts[ctype]++; ++ } ++ av_log(avctx, AV_LOG_DEBUG, ++ "%d channels - front:%d side:%d back:%d lfe:%d top:%d\n", ++ info->numChannels, ++ channel_counts[ACT_FRONT], channel_counts[ACT_SIDE], ++ channel_counts[ACT_BACK], channel_counts[ACT_LFE], ++ channel_counts[ACT_FRONT_TOP] + channel_counts[ACT_SIDE_TOP] + ++ channel_counts[ACT_BACK_TOP] + channel_counts[ACT_TOP]); ++ ++ switch (channel_counts[ACT_FRONT]) { ++ case 4: ++ ch_layout |= AV_CH_LAYOUT_STEREO | AV_CH_FRONT_LEFT_OF_CENTER | ++ AV_CH_FRONT_RIGHT_OF_CENTER; ++ break; ++ case 3: ++ ch_layout |= AV_CH_LAYOUT_STEREO | AV_CH_FRONT_CENTER; ++ break; ++ case 2: ++ ch_layout |= AV_CH_LAYOUT_STEREO; ++ break; ++ case 1: ++ ch_layout |= AV_CH_FRONT_CENTER; ++ break; ++ default: ++ av_log(avctx, AV_LOG_WARNING, ++ "unsupported number of front channels: %d\n", ++ channel_counts[ACT_FRONT]); ++ ch_error = 1; ++ break; ++ } ++ if (channel_counts[ACT_SIDE] > 0) { ++ if (channel_counts[ACT_SIDE] == 2) { ++ ch_layout |= AV_CH_SIDE_LEFT | AV_CH_SIDE_RIGHT; ++ } else { ++ av_log(avctx, AV_LOG_WARNING, ++ "unsupported number of side channels: %d\n", ++ channel_counts[ACT_SIDE]); ++ ch_error = 1; ++ } ++ } ++ if (channel_counts[ACT_BACK] > 0) { ++ switch (channel_counts[ACT_BACK]) { ++ case 3: ++ ch_layout |= AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT | AV_CH_BACK_CENTER; ++ break; ++ case 2: ++ ch_layout |= AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT; ++ break; ++ case 1: ++ ch_layout |= AV_CH_BACK_CENTER; ++ break; ++ default: ++ av_log(avctx, AV_LOG_WARNING, ++ "unsupported number of back channels: %d\n", ++ channel_counts[ACT_BACK]); ++ ch_error = 1; ++ break; ++ } ++ } ++ if (channel_counts[ACT_LFE] > 0) { ++ if (channel_counts[ACT_LFE] == 1) { ++ ch_layout |= AV_CH_LOW_FREQUENCY; ++ } else { ++ av_log(avctx, AV_LOG_WARNING, ++ "unsupported number of LFE channels: %d\n", ++ channel_counts[ACT_LFE]); ++ ch_error = 1; ++ } ++ } ++ ++ av_channel_layout_uninit(&avctx->ch_layout); ++ av_channel_layout_from_mask(&avctx->ch_layout, ch_layout); ++ if (!ch_error && avctx->ch_layout.nb_channels != info->numChannels) { ++ av_log(avctx, AV_LOG_WARNING, "unsupported channel configuration\n"); ++ ch_error = 1; ++ } ++ if (ch_error) ++ avctx->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; ++ ++ return 0; ++} ++ ++static av_cold int fdk_aac_decode_close(AVCodecContext *avctx) ++{ ++ FDKAACDecContext *s = avctx->priv_data; ++ ++ if (s->handle) ++ aacDecoder_Close(s->handle); ++ av_freep(&s->decoder_buffer); ++ av_freep(&s->anc_buffer); ++ ++ return 0; ++} ++ ++static av_cold int fdk_aac_decode_init(AVCodecContext *avctx) ++{ ++ FDKAACDecContext *s = avctx->priv_data; ++ AAC_DECODER_ERROR err; ++ ++ s->handle = aacDecoder_Open(avctx->extradata_size ? TT_MP4_RAW : TT_MP4_ADTS, 1); ++ if (!s->handle) { ++ av_log(avctx, AV_LOG_ERROR, "Error opening decoder\n"); ++ return AVERROR_UNKNOWN; ++ } ++ ++ if (avctx->extradata_size) { ++ if ((err = aacDecoder_ConfigRaw(s->handle, &avctx->extradata, ++ &avctx->extradata_size)) != AAC_DEC_OK) { ++ av_log(avctx, AV_LOG_ERROR, "Unable to set extradata\n"); ++ return AVERROR_INVALIDDATA; ++ } ++ } ++ ++ if ((err = aacDecoder_SetParam(s->handle, AAC_CONCEAL_METHOD, ++ s->conceal_method)) != AAC_DEC_OK) { ++ av_log(avctx, AV_LOG_ERROR, "Unable to set error concealment method\n"); ++ return AVERROR_UNKNOWN; ++ } ++ ++#if FF_API_OLD_CHANNEL_LAYOUT ++FF_DISABLE_DEPRECATION_WARNINGS ++ if (avctx->request_channel_layout) { ++ av_channel_layout_uninit(&s->downmix_layout); ++ av_channel_layout_from_mask(&s->downmix_layout, avctx->request_channel_layout); ++ } ++FF_ENABLE_DEPRECATION_WARNINGS ++#endif ++ if (s->downmix_layout.nb_channels > 0 && ++ s->downmix_layout.order != AV_CHANNEL_ORDER_NATIVE) { ++ int downmix_channels = -1; ++ ++ switch (s->downmix_layout.u.mask) { ++ case AV_CH_LAYOUT_STEREO: ++ case AV_CH_LAYOUT_STEREO_DOWNMIX: ++ downmix_channels = 2; ++ break; ++ case AV_CH_LAYOUT_MONO: ++ downmix_channels = 1; ++ break; ++ default: ++ av_log(avctx, AV_LOG_WARNING, "Invalid downmix option\n"); ++ break; ++ } ++ ++ if (downmix_channels != -1) { ++ if (aacDecoder_SetParam(s->handle, AAC_PCM_MAX_OUTPUT_CHANNELS, ++ downmix_channels) != AAC_DEC_OK) { ++ av_log(avctx, AV_LOG_WARNING, "Unable to set output channels in the decoder\n"); ++ } else { ++ s->anc_buffer = av_malloc(DMX_ANC_BUFFSIZE); ++ if (!s->anc_buffer) { ++ av_log(avctx, AV_LOG_ERROR, "Unable to allocate ancillary buffer for the decoder\n"); ++ return AVERROR(ENOMEM); ++ } ++ if (aacDecoder_AncDataInit(s->handle, s->anc_buffer, DMX_ANC_BUFFSIZE)) { ++ av_log(avctx, AV_LOG_ERROR, "Unable to register downmix ancillary buffer in the decoder\n"); ++ return AVERROR_UNKNOWN; ++ } ++ } ++ } ++ } ++ ++ if (s->drc_boost != -1) { ++ if (aacDecoder_SetParam(s->handle, AAC_DRC_BOOST_FACTOR, s->drc_boost) != AAC_DEC_OK) { ++ av_log(avctx, AV_LOG_ERROR, "Unable to set DRC boost factor in the decoder\n"); ++ return AVERROR_UNKNOWN; ++ } ++ } ++ ++ if (s->drc_cut != -1) { ++ if (aacDecoder_SetParam(s->handle, AAC_DRC_ATTENUATION_FACTOR, s->drc_cut) != AAC_DEC_OK) { ++ av_log(avctx, AV_LOG_ERROR, "Unable to set DRC attenuation factor in the decoder\n"); ++ return AVERROR_UNKNOWN; ++ } ++ } ++ ++ if (s->drc_level != -1) { ++ // This option defaults to -1, i.e. not calling ++ // aacDecoder_SetParam(AAC_DRC_REFERENCE_LEVEL) at all, which defaults ++ // to the level from DRC metadata, if available. The user can set ++ // -drc_level -2, which calls aacDecoder_SetParam( ++ // AAC_DRC_REFERENCE_LEVEL) with a negative value, which then ++ // explicitly disables the feature. ++ if (aacDecoder_SetParam(s->handle, AAC_DRC_REFERENCE_LEVEL, s->drc_level) != AAC_DEC_OK) { ++ av_log(avctx, AV_LOG_ERROR, "Unable to set DRC reference level in the decoder\n"); ++ return AVERROR_UNKNOWN; ++ } ++ } ++ ++ if (s->drc_heavy != -1) { ++ if (aacDecoder_SetParam(s->handle, AAC_DRC_HEAVY_COMPRESSION, s->drc_heavy) != AAC_DEC_OK) { ++ av_log(avctx, AV_LOG_ERROR, "Unable to set DRC heavy compression in the decoder\n"); ++ return AVERROR_UNKNOWN; ++ } ++ } ++ ++#if FDKDEC_VER_AT_LEAST(2, 5) // 2.5.10 ++ // Setting this parameter to -1 enables the auto behaviour in the library. ++ if (aacDecoder_SetParam(s->handle, AAC_PCM_LIMITER_ENABLE, s->level_limit) != AAC_DEC_OK) { ++ av_log(avctx, AV_LOG_ERROR, "Unable to set in signal level limiting in the decoder\n"); ++ return AVERROR_UNKNOWN; ++ } ++#endif ++ ++#if FDKDEC_VER_AT_LEAST(3, 0) // 3.0.0 ++ if (s->drc_effect != -1) { ++ if (aacDecoder_SetParam(s->handle, AAC_UNIDRC_SET_EFFECT, s->drc_effect) != AAC_DEC_OK) { ++ av_log(avctx, AV_LOG_ERROR, "Unable to set DRC effect type in the decoder\n"); ++ return AVERROR_UNKNOWN; ++ } ++ } ++#endif ++ ++#if FDKDEC_VER_AT_LEAST(3, 1) // 3.1.0 ++ if (s->album_mode != -1) { ++ if (aacDecoder_SetParam(s->handle, AAC_UNIDRC_ALBUM_MODE, s->album_mode) != AAC_DEC_OK) { ++ av_log(avctx, AV_LOG_ERROR, "Unable to set album mode in the decoder\n"); ++ return AVERROR_UNKNOWN; ++ } ++ } ++#endif ++ ++ avctx->sample_fmt = AV_SAMPLE_FMT_S16; ++ ++ s->decoder_buffer_size = DECODER_BUFFSIZE * DECODER_MAX_CHANNELS; ++ s->decoder_buffer = av_malloc(s->decoder_buffer_size); ++ if (!s->decoder_buffer) ++ return AVERROR(ENOMEM); ++ ++ return 0; ++} ++ ++static int fdk_aac_decode_frame(AVCodecContext *avctx, AVFrame *frame, ++ int *got_frame_ptr, AVPacket *avpkt) ++{ ++ FDKAACDecContext *s = avctx->priv_data; ++ int ret; ++ AAC_DECODER_ERROR err; ++ UINT valid = avpkt->size; ++ UINT flags = 0; ++ int input_offset = 0; ++ ++ if (avpkt->size) { ++ err = aacDecoder_Fill(s->handle, &avpkt->data, &avpkt->size, &valid); ++ if (err != AAC_DEC_OK) { ++ av_log(avctx, AV_LOG_ERROR, "aacDecoder_Fill() failed: %x\n", err); ++ return AVERROR_INVALIDDATA; ++ } ++ } else { ++#if FDKDEC_VER_AT_LEAST(2, 5) // 2.5.10 ++ /* Handle decoder draining */ ++ if (s->flush_samples > 0) { ++ flags |= AACDEC_FLUSH; ++ } else { ++ return AVERROR_EOF; ++ } ++#else ++ return AVERROR_EOF; ++#endif ++ } ++ ++ err = aacDecoder_DecodeFrame(s->handle, (INT_PCM *) s->decoder_buffer, ++ s->decoder_buffer_size / sizeof(INT_PCM), ++ flags); ++ if (err == AAC_DEC_NOT_ENOUGH_BITS) { ++ ret = avpkt->size - valid; ++ goto end; ++ } ++ if (err != AAC_DEC_OK) { ++ av_log(avctx, AV_LOG_ERROR, ++ "aacDecoder_DecodeFrame() failed: %x\n", err); ++ ret = AVERROR_UNKNOWN; ++ goto end; ++ } ++ ++ if ((ret = get_stream_info(avctx)) < 0) ++ goto end; ++ frame->nb_samples = avctx->frame_size; ++ ++#if FDKDEC_VER_AT_LEAST(2, 5) // 2.5.10 ++ if (flags & AACDEC_FLUSH) { ++ // Only return the right amount of samples at the end; if calling the ++ // decoder with AACDEC_FLUSH, it will keep returning frames indefinitely. ++ frame->nb_samples = FFMIN(s->flush_samples, frame->nb_samples); ++ av_log(s, AV_LOG_DEBUG, "Returning %d/%d delayed samples.\n", ++ frame->nb_samples, s->flush_samples); ++ s->flush_samples -= frame->nb_samples; ++ } else { ++ // Trim off samples from the start to compensate for extra decoder ++ // delay. We could also just adjust the pts, but this avoids ++ // including the extra samples in the output altogether. ++ if (s->delay_samples) { ++ int drop_samples = FFMIN(s->delay_samples, frame->nb_samples); ++ av_log(s, AV_LOG_DEBUG, "Dropping %d/%d delayed samples.\n", ++ drop_samples, s->delay_samples); ++ s->delay_samples -= drop_samples; ++ frame->nb_samples -= drop_samples; ++ input_offset = drop_samples * avctx->ch_layout.nb_channels; ++ if (frame->nb_samples <= 0) ++ return 0; ++ } ++ } ++#endif ++ ++ if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) ++ goto end; ++ ++ memcpy(frame->extended_data[0], s->decoder_buffer + input_offset, ++ avctx->ch_layout.nb_channels * frame->nb_samples * ++ av_get_bytes_per_sample(avctx->sample_fmt)); ++ ++ *got_frame_ptr = 1; ++ ret = avpkt->size - valid; ++ ++end: ++ return ret; ++} ++ ++static av_cold void fdk_aac_decode_flush(AVCodecContext *avctx) ++{ ++ FDKAACDecContext *s = avctx->priv_data; ++ AAC_DECODER_ERROR err; ++ ++ if (!s->handle) ++ return; ++ ++ if ((err = aacDecoder_SetParam(s->handle, ++ AAC_TPDEC_CLEAR_BUFFER, 1)) != AAC_DEC_OK) ++ av_log(avctx, AV_LOG_WARNING, "failed to clear buffer when flushing\n"); ++} ++ ++const FFCodec ff_libfdk_aac_decoder = { ++ .p.name = "libfdk_aac", ++ CODEC_LONG_NAME("Fraunhofer FDK AAC"), ++ .p.type = AVMEDIA_TYPE_AUDIO, ++ .p.id = AV_CODEC_ID_AAC, ++ .priv_data_size = sizeof(FDKAACDecContext), ++ .init = fdk_aac_decode_init, ++ FF_CODEC_DECODE_CB(fdk_aac_decode_frame), ++ .close = fdk_aac_decode_close, ++ .flush = fdk_aac_decode_flush, ++ .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF ++#if FDKDEC_VER_AT_LEAST(2, 5) // 2.5.10 ++ | AV_CODEC_CAP_DELAY ++#endif ++ , ++ .p.priv_class = &fdk_aac_dec_class, ++ .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, ++ .p.wrapper_name = "libfdk", ++}; +diff -up firefox-127.0/media/ffvpx/libavcodec/moz.build.1667096 firefox-127.0/media/ffvpx/libavcodec/moz.build +--- firefox-127.0/media/ffvpx/libavcodec/moz.build.1667096 2024-06-06 23:33:58.000000000 +0200 ++++ firefox-127.0/media/ffvpx/libavcodec/moz.build 2024-06-10 12:42:39.354913201 +0200 +@@ -151,6 +151,12 @@ else: + CXXFLAGS += CONFIG["MOZ_LIBVPX_CFLAGS"] + OS_LIBS += CONFIG["MOZ_LIBVPX_LIBS"] + ++if CONFIG['MOZ_FDK_AAC']: ++ SOURCES += [ ++ 'libfdk-aacdec.c', ++ ] ++ OS_LIBS += CONFIG['MOZ_FDK_AAC_LIBS'] ++ + SYMBOLS_FILE = 'avcodec.symbols' + NoVisibilityFlags() + +diff -up firefox-127.0/toolkit/moz.configure.1667096 firefox-127.0/toolkit/moz.configure +--- firefox-127.0/toolkit/moz.configure.1667096 2024-06-10 12:42:39.312913316 +0200 ++++ firefox-127.0/toolkit/moz.configure 2024-06-10 12:42:39.355913199 +0200 +@@ -2412,6 +2412,15 @@ with only_when(compile_environment): + + set_config("MOZ_SYSTEM_PNG", True, when="--with-system-png") + ++# FDK AAC support ++# ============================================================== ++option('--with-system-fdk-aac', ++ help='Use system libfdk-aac (located with pkgconfig)') ++ ++system_fdk_aac = pkg_check_modules('MOZ_FDK_AAC', 'fdk-aac', ++ when='--with-system-fdk-aac') ++ ++set_config('MOZ_FDK_AAC', depends(when=system_fdk_aac)(lambda: True)) + + # FFmpeg's ffvpx configuration + # ============================================================== diff --git a/mozilla-440908.patch b/mozilla-440908.patch deleted file mode 100644 index cce5248..0000000 --- a/mozilla-440908.patch +++ /dev/null @@ -1,111 +0,0 @@ -diff -up firefox-56.0/modules/libpref/prefapi.cpp.440908 firefox-56.0/modules/libpref/prefapi.cpp ---- firefox-56.0/modules/libpref/prefapi.cpp.440908 2017-09-14 22:15:52.000000000 +0200 -+++ firefox-56.0/modules/libpref/prefapi.cpp 2017-09-25 10:39:39.266572792 +0200 -@@ -1036,8 +1036,8 @@ void PREF_ReaderCallback(void *clo - PrefValue value, - PrefType type, - bool isDefault, -- bool isStickyDefault) -- -+ bool isStickyDefault, -+ bool isLocked) - { - uint32_t flags = 0; - if (isDefault) { -@@ -1049,4 +1049,6 @@ void PREF_ReaderCallback(void *clo - flags |= kPrefForceSet; - } - pref_HashPref(pref, value, type, flags); -+ if (isLocked) -+ PREF_LockPref(pref, true); - } -diff -up firefox-56.0/modules/libpref/prefapi.h.440908 firefox-56.0/modules/libpref/prefapi.h ---- firefox-56.0/modules/libpref/prefapi.h.440908 2017-07-31 18:20:51.000000000 +0200 -+++ firefox-56.0/modules/libpref/prefapi.h 2017-09-25 10:39:39.267572789 +0200 -@@ -246,8 +246,8 @@ void PREF_ReaderCallback( void *closure, - PrefValue value, - PrefType type, - bool isDefault, -- bool isStickyDefault); -- -+ bool isStickyDefault, -+ bool isLocked); - - /* - * Callback whenever we change a preference -diff -up firefox-56.0/modules/libpref/prefread.cpp.440908 firefox-56.0/modules/libpref/prefread.cpp ---- firefox-56.0/modules/libpref/prefread.cpp.440908 2017-09-14 22:15:52.000000000 +0200 -+++ firefox-56.0/modules/libpref/prefread.cpp 2017-09-25 10:39:39.267572789 +0200 -@@ -43,6 +43,7 @@ enum { - #define BITS_PER_HEX_DIGIT 4 - - static const char kUserPref[] = "user_pref"; -+static const char kLockPref[] = "lockPref"; - static const char kPref[] = "pref"; - static const char kPrefSticky[] = "sticky_pref"; - static const char kTrue[] = "true"; -@@ -146,7 +147,7 @@ pref_DoCallback(PrefParseState *ps) - break; - } - (*ps->reader)(ps->closure, ps->lb, value, ps->vtype, ps->fdefault, -- ps->fstickydefault); -+ ps->fstickydefault, ps->flock); - return true; - } - -@@ -215,6 +216,7 @@ PREF_ParseBuf(PrefParseState *ps, const - ps->vtype = PrefType::Invalid; - ps->fdefault = false; - ps->fstickydefault = false; -+ ps->flock = false; - } - switch (c) { - case '/': /* begin comment block or line? */ -@@ -225,11 +227,14 @@ PREF_ParseBuf(PrefParseState *ps, const - break; - case 'u': /* indicating user_pref */ - case 's': /* indicating sticky_pref */ -+ case 'l': /* indicating lockPref */ - case 'p': /* indicating pref */ - if (c == 'u') { - ps->smatch = kUserPref; - } else if (c == 's') { - ps->smatch = kPrefSticky; -+ } else if (c == 'l') { -+ ps->smatch = kLockPref; - } else { - ps->smatch = kPref; - } -@@ -277,8 +282,10 @@ PREF_ParseBuf(PrefParseState *ps, const - /* name parsing */ - case PREF_PARSE_UNTIL_NAME: - if (c == '\"' || c == '\'') { -- ps->fdefault = (ps->smatch == kPref || ps->smatch == kPrefSticky); -+ ps->fdefault = (ps->smatch == kPref || ps->smatch == kPrefSticky -+ || ps->smatch == kLockPref); - ps->fstickydefault = (ps->smatch == kPrefSticky); -+ ps->flock = (ps->smatch == kLockPref); - ps->quotechar = c; - ps->nextstate = PREF_PARSE_UNTIL_COMMA; /* return here when done */ - state = PREF_PARSE_QUOTED_STRING; -diff -up firefox-56.0/modules/libpref/prefread.h.440908 firefox-56.0/modules/libpref/prefread.h ---- firefox-56.0/modules/libpref/prefread.h.440908 2017-09-14 22:15:52.000000000 +0200 -+++ firefox-56.0/modules/libpref/prefread.h 2017-09-25 10:39:39.267572789 +0200 -@@ -34,7 +34,8 @@ typedef void (*PrefReader)(void *c - PrefValue val, - PrefType type, - bool defPref, -- bool stickyPref); -+ bool stickyPref, -+ bool lockPref); - - /** - * Report any errors or warnings we encounter during parsing. -@@ -62,6 +63,7 @@ typedef struct PrefParseState { - PrefType vtype; /* PREF_STRING,INT,BOOL */ - bool fdefault; /* true if (default) pref */ - bool fstickydefault; /* true if (sticky) pref */ -+ bool flock; /* true if pref to be locked */ - } PrefParseState; - - /** diff --git a/mozilla-build-arm.patch b/mozilla-build-arm.patch deleted file mode 100644 index e390a28..0000000 --- a/mozilla-build-arm.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -up firefox-52.0/gfx/skia/skia/include/core/SkPreConfig.h.arm firefox-52.0/gfx/skia/skia/include/core/SkPreConfig.h ---- firefox-52.0/gfx/skia/skia/include/core/SkPreConfig.h.arm 2017-03-03 13:53:52.480754536 +0100 -+++ firefox-52.0/gfx/skia/skia/include/core/SkPreConfig.h 2017-03-03 13:56:01.476018102 +0100 -@@ -203,6 +203,10 @@ - #define SK_ARM_HAS_CRC32 - #endif - -+#if defined(__aarch64__) -+ #undef SK_ARM_HAS_NEON -+#endif -+ - ////////////////////////////////////////////////////////////////////// - - #if !defined(SKIA_IMPLEMENTATION) diff --git a/node-stdout-nonblocking-wrapper b/node-stdout-nonblocking-wrapper new file mode 100755 index 0000000..b2814b8 --- /dev/null +++ b/node-stdout-nonblocking-wrapper @@ -0,0 +1,2 @@ +#!/bin/sh +exec /usr/bin/node "$@" 2>&1 | cat - diff --git a/org.mozilla.firefox.SearchProvider.service b/org.mozilla.firefox.SearchProvider.service new file mode 100644 index 0000000..6b2bd1b --- /dev/null +++ b/org.mozilla.firefox.SearchProvider.service @@ -0,0 +1,3 @@ +[D-BUS Service] +Name=org.mozilla.firefox.SearchProvider +Exec=/usr/lib64/firefox/firefox --dbus-service /usr/bin/firefox diff --git a/org.mozilla.firefox.appdata.xml.in b/org.mozilla.firefox.appdata.xml.in new file mode 100644 index 0000000..3c086a1 --- /dev/null +++ b/org.mozilla.firefox.appdata.xml.in @@ -0,0 +1,61 @@ + + + + org.mozilla.firefox + CC0-1.0 + Firefox + Web Browser + Navegador web + Webový prohlížeč + Navegador web + مرورگر اینترنتی + WWW-selain + Navigateur Web + Webböngésző + Browser Web + ウェブ・ブラウザ + 웹 브라우저 + Nettleser + Webbrowser + Nettlesar + Nettleser + Przeglądarka WWW + Navegador Web + Navegador Web + Internetový prehliadač + Webbläsare + +

+ Bringing together all kinds of awesomeness to make browsing better for you. + Get to your favorite sites quickly – even if you don’t remember the URLs. + Type your term into the location bar (aka the Awesome Bar) and the autocomplete + function will include possible matches from your browsing history, bookmarked + sites and open tabs. +

+
+ https://www.mozilla.org + stransky@redhat.com + + ModernToolkit + SearchProvider + + Mozilla + GPL-3.0+ + Mozilla Corporation + https://bugzilla.mozilla.org/ + https://support.mozilla.org/ + firefox + org.mozilla.firefox.desktop + + firefox.desktop + + + https://raw.githubusercontent.com/hughsie/fedora-appstream/master/screenshots-extra/firefox/a.png + https://raw.githubusercontent.com/hughsie/fedora-appstream/master/screenshots-extra/firefox/b.png + https://raw.githubusercontent.com/hughsie/fedora-appstream/master/screenshots-extra/firefox/c.png + + + + + +
diff --git a/org.mozilla.firefox.desktop b/org.mozilla.firefox.desktop new file mode 100644 index 0000000..02e156d --- /dev/null +++ b/org.mozilla.firefox.desktop @@ -0,0 +1,276 @@ +[Desktop Entry] +Version=1.0 +Name=Firefox +GenericName=Web Browser +GenericName[ca]=Navegador web +GenericName[cs]=Webový prohlížeč +GenericName[es]=Navegador web +GenericName[fa]=مرورگر اینترنتی +GenericName[fi]=WWW-selain +GenericName[fr]=Navigateur Web +GenericName[hu]=Webböngésző +GenericName[it]=Browser Web +GenericName[ja]=ウェブ・ブラウザ +GenericName[ko]=웹 브라우저 +GenericName[nb]=Nettleser +GenericName[nl]=Webbrowser +GenericName[nn]=Nettlesar +GenericName[no]=Nettleser +GenericName[pl]=Przeglądarka WWW +GenericName[pt]=Navegador Web +GenericName[pt_BR]=Navegador Web +GenericName[sk]=Internetový prehliadač +GenericName[sv]=Webbläsare +Comment=Browse the Web +Comment[ca]=Navegueu per el web +Comment[cs]=Prohlížení stránek World Wide Webu +Comment[de]=Im Internet surfen +Comment[es]=Navegue por la web +Comment[fa]=صفحات شبکه جهانی اینترنت را مرور نمایید +Comment[fi]=Selaa Internetin WWW-sivuja +Comment[fr]=Navigue sur Internet +Comment[hu]=A világháló böngészése +Comment[it]=Esplora il web +Comment[ja]=ウェブを閲覧します +Comment[ko]=웹을 돌아 다닙니다 +Comment[nb]=Surf på nettet +Comment[nl]=Verken het internet +Comment[nn]=Surf på nettet +Comment[no]=Surf på nettet +Comment[pl]=Przeglądanie stron WWW +Comment[pt]=Navegue na Internet +Comment[pt_BR]=Navegue na Internet +Comment[sk]=Prehliadanie internetu +Comment[sv]=Surfa på webben +Exec=firefox %u +Icon=firefox +Terminal=false +Type=Application +MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https; +StartupNotify=true +Categories=Network;WebBrowser; +Keywords=web;browser;internet; +Actions=new-window;new-private-window;profile-manager-window; + +[Desktop Action new-window] +Name=Open a New Window +Name[ach]=Dirica manyen +Name[af]=Nuwe venster +Name[an]=Nueva finestra +Name[ar]=نافذة جديدة +Name[as]=নতুন উইন্ডো +Name[ast]=Ventana nueva +Name[az]=Yeni Pəncərə +Name[be]=Новае акно +Name[bg]=Нов прозорец +Name[bn_BD]=নতুন উইন্ডো (N) +Name[bn_IN]=নতুন উইন্ডো +Name[br]=Prenestr nevez +Name[brx]=गोदान उइन्ड'(N) +Name[bs]=Novi prozor +Name[ca]=Finestra nova +Name[cak]=K'ak'a' tzuwäch +Name[cs]=Nové okno +Name[cy]=Ffenestr Newydd +Name[da]=Nyt vindue +Name[de]=Neues Fenster +Name[dsb]=Nowe wokno +Name[el]=Νέο παράθυρο +Name[en_GB]=New Window +Name[en_US]=New Window +Name[en_ZA]=New Window +Name[eo]=Nova fenestro +Name[es_AR]=Nueva ventana +Name[es_CL]=Nueva ventana +Name[es_ES]=Nueva ventana +Name[es_MX]=Nueva ventana +Name[et]=Uus aken +Name[eu]=Leiho berria +Name[fa]=پنجره جدید‌ +Name[ff]=Henorde Hesere +Name[fi]=Uusi ikkuna +Name[fr]=Nouvelle fenêtre +Name[fy_NL]=Nij finster +Name[ga_IE]=Fuinneog Nua +Name[gd]=Uinneag ùr +Name[gl]=Nova xanela +Name[gn]=Ovetã pyahu +Name[gu_IN]=નવી વિન્ડો +Name[he]=חלון חדש +Name[hi_IN]=नया विंडो +Name[hr]=Novi prozor +Name[hsb]=Nowe wokno +Name[hu]=Új ablak +Name[hy_AM]=Նոր Պատուհան +Name[id]=Jendela Baru +Name[is]=Nýr gluggi +Name[it]=Nuova finestra +Name[ja]=新しいウィンドウ +Name[ja_JP-mac]=新規ウインドウ +Name[ka]=ახალი ფანჯარა +Name[kk]=Жаңа терезе +Name[km]=បង្អួច​​​ថ្មី +Name[kn]=ಹೊಸ ಕಿಟಕಿ +Name[ko]=새 창 +Name[kok]=नवें जनेल +Name[ks]=نئئ وِنڈو +Name[lij]=Neuvo barcon +Name[lo]=ຫນ້າຕ່າງໃຫມ່ +Name[lt]=Naujas langas +Name[ltg]=Jauns lūgs +Name[lv]=Jauns logs +Name[mai]=नव विंडो +Name[mk]=Нов прозорец +Name[ml]=പുതിയ ജാലകം +Name[mr]=नवीन पटल +Name[ms]=Tetingkap Baru +Name[my]=ဝင်းဒိုးအသစ် +Name[nb_NO]=Nytt vindu +Name[ne_NP]=नयाँ सञ्झ्याल +Name[nl]=Nieuw venster +Name[nn_NO]=Nytt vindauge +Name[or]=ନୂତନ ୱିଣ୍ଡୋ +Name[pa_IN]=ਨਵੀਂ ਵਿੰਡੋ +Name[pl]=Nowe okno +Name[pt_BR]=Nova janela +Name[pt_PT]=Nova janela +Name[rm]=Nova fanestra +Name[ro]=Fereastră nouă +Name[ru]=Новое окно +Name[sat]=नावा विंडो (N) +Name[si]=නව කවුළුවක් +Name[sk]=Nové okno +Name[sl]=Novo okno +Name[son]=Zanfun taaga +Name[sq]=Dritare e Re +Name[sr]=Нови прозор +Name[sv_SE]=Nytt fönster +Name[ta]=புதிய சாளரம் +Name[te]=కొత్త విండో +Name[th]=หน้าต่างใหม่ +Name[tr]=Yeni pencere +Name[tsz]=Eraatarakua jimpani +Name[uk]=Нове вікно +Name[ur]=نیا دریچہ +Name[uz]=Yangi oyna +Name[vi]=Cửa sổ mới +Name[wo]=Palanteer bu bees +Name[xh]=Ifestile entsha +Name[zh_CN]=新建窗口 +Name[zh_TW]=開新視窗 +Exec=firefox --new-window %u + +[Desktop Action new-private-window] +Name=Open a New Private Window +Name[ach]=Dirica manyen me mung +Name[af]=Nuwe privaatvenster +Name[an]=Nueva finestra privada +Name[ar]=نافذة خاصة جديدة +Name[as]=নতুন ব্যক্তিগত উইন্ডো +Name[ast]=Ventana privada nueva +Name[az]=Yeni Məxfi Pəncərə +Name[be]=Новае акно адасаблення +Name[bg]=Нов прозорец за поверително сърфиране +Name[bn_BD]=নতুন ব্যক্তিগত উইন্ডো +Name[bn_IN]=নতুন ব্যক্তিগত উইন্ডো +Name[br]=Prenestr merdeiñ prevez nevez +Name[brx]=गोदान प्राइभेट उइन्ड' +Name[bs]=Novi privatni prozor +Name[ca]=Finestra privada nova +Name[cak]=K'ak'a' ichinan tzuwäch +Name[cs]=Nové anonymní okno +Name[cy]=Ffenestr Breifat Newydd +Name[da]=Nyt privat vindue +Name[de]=Neues privates Fenster +Name[dsb]=Nowe priwatne wokno +Name[el]=Νέο παράθυρο ιδιωτικής περιήγησης +Name[en_GB]=New Private Window +Name[en_US]=New Private Window +Name[en_ZA]=New Private Window +Name[eo]=Nova privata fenestro +Name[es_AR]=Nueva ventana privada +Name[es_CL]=Nueva ventana privada +Name[es_ES]=Nueva ventana privada +Name[es_MX]=Nueva ventana privada +Name[et]=Uus privaatne aken +Name[eu]=Leiho pribatu berria +Name[fa]=پنجره ناشناس جدید +Name[ff]=Henorde Suturo Hesere +Name[fi]=Uusi yksityinen ikkuna +Name[fr]=Nouvelle fenêtre de navigation privée +Name[fy_NL]=Nij priveefinster +Name[ga_IE]=Fuinneog Nua Phríobháideach +Name[gd]=Uinneag phrìobhaideach ùr +Name[gl]=Nova xanela privada +Name[gn]=Ovetã ñemi pyahu +Name[gu_IN]=નવી ખાનગી વિન્ડો +Name[he]=חלון פרטי חדש +Name[hi_IN]=नयी निजी विंडो +Name[hr]=Novi privatni prozor +Name[hsb]=Nowe priwatne wokno +Name[hu]=Új privát ablak +Name[hy_AM]=Սկսել Գաղտնի դիտարկում +Name[id]=Jendela Mode Pribadi Baru +Name[is]=Nýr huliðsgluggi +Name[it]=Nuova finestra anonima +Name[ja]=新しいプライベートウィンドウ +Name[ja_JP-mac]=新規プライベートウインドウ +Name[ka]=ახალი პირადი ფანჯარა +Name[kk]=Жаңа жекелік терезе +Name[km]=បង្អួច​ឯកជន​ថ្មី +Name[kn]=ಹೊಸ ಖಾಸಗಿ ಕಿಟಕಿ +Name[ko]=새 사생활 보호 모드 +Name[kok]=नवो खाजगी विंडो +Name[ks]=نْو پرایوٹ وینڈو& +Name[lij]=Neuvo barcon privou +Name[lo]=ເປີດຫນ້າຕ່າງສວນຕົວຂື້ນມາໃຫມ່ +Name[lt]=Naujas privataus naršymo langas +Name[ltg]=Jauns privatais lūgs +Name[lv]=Jauns privātais logs +Name[mai]=नया निज विंडो (W) +Name[mk]=Нов приватен прозорец +Name[ml]=പുതിയ സ്വകാര്യ ജാലകം +Name[mr]=नवीन वैयक्तिक पटल +Name[ms]=Tetingkap Persendirian Baharu +Name[my]=New Private Window +Name[nb_NO]=Nytt privat vindu +Name[ne_NP]=नयाँ निजी सञ्झ्याल +Name[nl]=Nieuw privévenster +Name[nn_NO]=Nytt privat vindauge +Name[or]=ନୂତନ ବ୍ୟକ୍ତିଗତ ୱିଣ୍ଡୋ +Name[pa_IN]=ਨਵੀਂ ਪ੍ਰਾਈਵੇਟ ਵਿੰਡੋ +Name[pl]=Nowe okno prywatne +Name[pt_BR]=Nova janela privativa +Name[pt_PT]=Nova janela privada +Name[rm]=Nova fanestra privata +Name[ro]=Fereastră privată nouă +Name[ru]=Новое приватное окно +Name[sat]=नावा निजेराक् विंडो (W ) +Name[si]=නව පුද්ගලික කවුළුව (W) +Name[sk]=Nové okno v režime Súkromné prehliadanie +Name[sl]=Novo zasebno okno +Name[son]=Sutura zanfun taaga +Name[sq]=Dritare e Re Private +Name[sr]=Нови приватан прозор +Name[sv_SE]=Nytt privat fönster +Name[ta]=புதிய தனிப்பட்ட சாளரம் +Name[te]=కొత్త ఆంతరంగిక విండో +Name[th]=หน้าต่างส่วนตัวใหม่ +Name[tr]=Yeni gizli pencere +Name[tsz]=Juchiiti eraatarakua jimpani +Name[uk]=Приватне вікно +Name[ur]=نیا نجی دریچہ +Name[uz]=Yangi maxfiy oyna +Name[vi]=Cửa sổ riêng tư mới +Name[wo]=Panlanteeru biir bu bees +Name[xh]=Ifestile yangasese entsha +Name[zh_CN]=新建隐私浏览窗口 +Name[zh_TW]=新增隱私視窗 +Exec=firefox --private-window %u + +[Desktop Action profile-manager-window] +Name=Open the Profile Manager +Name[cs]=Správa profilů +Name[de]=Profilverwaltung öffnen +Name[fr]=Ouvrir le gestionnaire de profils +Exec=firefox --ProfileManager diff --git a/org.mozilla.firefox.search-provider.ini b/org.mozilla.firefox.search-provider.ini new file mode 100644 index 0000000..0211665 --- /dev/null +++ b/org.mozilla.firefox.search-provider.ini @@ -0,0 +1,5 @@ +[Shell Search Provider] +DesktopId=org.mozilla.firefox.desktop +BusName=org.mozilla.firefox.SearchProvider +ObjectPath=/org/mozilla/firefox/SearchProvider +Version=2 diff --git a/pgo.patch b/pgo.patch index 20eb98d..c1ae97d 100644 --- a/pgo.patch +++ b/pgo.patch @@ -1,29 +1,128 @@ -diff -up firefox-64.0/build/unix/mozconfig.unix.pgo firefox-64.0/build/unix/mozconfig.unix ---- firefox-64.0/build/unix/mozconfig.unix.pgo 2019-01-03 15:23:16.792980384 +0100 -+++ firefox-64.0/build/unix/mozconfig.unix 2019-01-03 15:24:29.978693550 +0100 -@@ -6,6 +6,15 @@ if [ -n "$FORCE_GCC" ]; then - CC="$TOOLTOOL_DIR/gcc/bin/gcc" - CXX="$TOOLTOOL_DIR/gcc/bin/g++" +diff -up firefox-145.0/build/moz.configure/lto-pgo.configure.pgo firefox-145.0/build/moz.configure/lto-pgo.configure +--- firefox-145.0/build/moz.configure/lto-pgo.configure.pgo 2025-11-03 16:56:55.000000000 +0100 ++++ firefox-145.0/build/moz.configure/lto-pgo.configure 2025-11-05 13:59:53.477443914 +0100 +@@ -96,12 +96,16 @@ set_config("PGO_PROFILE_PATH", pgo_profi -+ if [ -n "$MOZ_PGO" ]; then -+ if [ -z "$USE_ARTIFACT" ]; then -+ ac_add_options --enable-lto -+ fi -+ export AR="$topsrcdir/gcc/bin/gcc-ar" -+ export NM="$topsrcdir/gcc/bin/gcc-nm" -+ export RANLIB="$topsrcdir/gcc/bin/gcc-ranlib" -+ fi + @depends( + "--enable-profile-use", ++ c_compiler, + pgo_profile_path, + llvm_profdata, + llvm_profdata_order, + build_environment, + ) +-def orderfile_path(profile_use, path, profdata, profdata_order, build_env): ++def orderfile_path(profile_use, compiler, path, profdata, profdata_order, build_env): ++ if compiler.type == "gcc": ++ return None + - # We want to make sure we use binutils and other binaries in the tooltool - # package. - mk_add_options "export PATH=$TOOLTOOL_DIR/gcc/bin:$PATH" -diff -up firefox-64.0/extensions/spellcheck/src/moz.build.pgo firefox-64.0/extensions/spellcheck/src/moz.build ---- firefox-64.0/extensions/spellcheck/src/moz.build.pgo 2018-12-07 03:56:27.000000000 +0100 -+++ firefox-64.0/extensions/spellcheck/src/moz.build 2019-01-03 15:21:32.793385074 +0100 -@@ -28,3 +28,5 @@ EXPORTS.mozilla += [ + if not profile_use: + return None - if CONFIG['CC_TYPE'] in ('clang', 'gcc'): - CXXFLAGS += ['-Wno-error=shadow'] +@@ -145,7 +149,7 @@ def pgo_flags( + return namespace( + gen_cflags=["-fprofile-generate"], + gen_ldflags=["-fprofile-generate"], +- use_cflags=["-fprofile-use", "-fprofile-correction", "-Wcoverage-mismatch"], ++ use_cflags=["-fprofile-use", "-fprofile-correction", "-Wno-coverage-mismatch"], + use_ldflags=["-fprofile-use"], + ) + +diff -up firefox-145.0/build/pgo/profileserver.py.pgo firefox-145.0/build/pgo/profileserver.py +--- firefox-145.0/build/pgo/profileserver.py.pgo 2025-11-03 16:56:55.000000000 +0100 ++++ firefox-145.0/build/pgo/profileserver.py 2025-11-05 13:59:53.477602066 +0100 +@@ -10,7 +10,7 @@ import subprocess + import sys + + import mozcrash +-from mozbuild.base import BinaryNotFoundException, MozbuildObject ++from mozbuild.base import BinaryNotFoundException, MozbuildObject, BuildEnvironmentNotFoundException + from mozfile import TemporaryDirectory, json + from mozhttpd import MozHttpd + from mozprofile import FirefoxProfile, Preferences +@@ -96,9 +96,22 @@ if __name__ == "__main__": + locations = ServerLocations() + locations.add_host(host="127.0.0.1", port=PORT, options="primary,privileged") + +- old_profraw_files = glob.glob("*.profraw") +- for f in old_profraw_files: +- os.remove(f) ++ using_gcc = False ++ try: ++ if build.config_environment.substs.get('CC_TYPE') == 'gcc': ++ using_gcc = True ++ except BuildEnvironmentNotFoundException: ++ pass + -+CXXFLAGS += ['-fno-devirtualize'] -\ No newline at end of file ++ if using_gcc: ++ for dirpath, _, filenames in os.walk('.'): ++ for f in filenames: ++ if f.endswith('.gcda'): ++ os.remove(os.path.join(dirpath, f)) ++ else: ++ old_profraw_files = glob.glob('*.profraw') ++ for f in old_profraw_files: ++ os.remove(f) + + with TemporaryDirectory() as profilePath: + # TODO: refactor this into mozprofile +diff -up firefox-145.0/gfx/2d/moz.build.pgo firefox-145.0/gfx/2d/moz.build +--- firefox-145.0/gfx/2d/moz.build.pgo 2025-11-03 16:56:57.000000000 +0100 ++++ firefox-145.0/gfx/2d/moz.build 2025-11-05 14:21:20.485610837 +0100 +@@ -137,11 +137,11 @@ if CONFIG["INTEL_ARCHITECTURE"]: + DEFINES["USE_SSE2"] = True + # The file uses SSE2 intrinsics, so it needs special compile flags on some + # compilers. +- SOURCES["ConvolutionFilterAVX2.cpp"].flags += ["-mavx2"] ++ SOURCES["ConvolutionFilterAVX2.cpp"].flags += ["-mavx2", "-fno-lto"] + SOURCES["ConvolutionFilterSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"] + SOURCES["FilterProcessingSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"] + SOURCES["ImageScalingSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"] +- SOURCES["SwizzleAVX2.cpp"].flags += ["-mavx2"] ++ SOURCES["SwizzleAVX2.cpp"].flags += ["-mavx2", "-fno-lto"] + SOURCES["SwizzleSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"] + SOURCES["SwizzleSSSE3.cpp"].flags += CONFIG["SSSE3_FLAGS"] + +diff -up firefox-145.0/gfx/skia/generate_mozbuild.py.pgo firefox-145.0/gfx/skia/generate_mozbuild.py +--- firefox-145.0/gfx/skia/generate_mozbuild.py.pgo 2025-11-03 16:56:57.000000000 +0100 ++++ firefox-145.0/gfx/skia/generate_mozbuild.py 2025-11-05 13:59:53.477947055 +0100 +@@ -50,8 +50,8 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind + if CONFIG['INTEL_ARCHITECTURE']: + SOURCES['skia/modules/skcms/skcms.cc'].flags += ['-DSKCMS_DISABLE_SKX'] + skia_ssse3_flags = ['-Dskvx=skvx_ssse3', '-mssse3'] +- skia_avx_flags = ['-Dskvx=skvx_avx', '-mavx'] +- skia_hsw_flags = ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma'] ++ skia_avx_flags = ['-Dskvx=skvx_avx', '-mavx', '-fno-lto'] ++ skia_hsw_flags = ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma', '-fno-lto'] + SOURCES['skia/src/core/SkBitmapProcState_opts_ssse3.cpp'].flags += skia_ssse3_flags + SOURCES['skia/src/core/SkBlitMask_opts_ssse3.cpp'].flags += skia_ssse3_flags + SOURCES['skia/src/core/SkSwizzler_opts_ssse3.cpp'].flags += ['-Dskvx=skvx_ssse3'] +diff -up firefox-145.0/gfx/skia/moz.build.pgo firefox-145.0/gfx/skia/moz.build +--- firefox-145.0/gfx/skia/moz.build.pgo 2025-11-03 16:56:57.000000000 +0100 ++++ firefox-145.0/gfx/skia/moz.build 2025-11-05 13:59:53.478077484 +0100 +@@ -597,8 +597,8 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind + if CONFIG['INTEL_ARCHITECTURE']: + SOURCES['skia/modules/skcms/skcms.cc'].flags += ['-DSKCMS_DISABLE_SKX'] + skia_ssse3_flags = ['-Dskvx=skvx_ssse3', '-mssse3'] +- skia_avx_flags = ['-Dskvx=skvx_avx', '-mavx'] +- skia_hsw_flags = ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma'] ++ skia_avx_flags = ['-Dskvx=skvx_avx', '-mavx', '-fno-lto'] ++ skia_hsw_flags = ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma', '-fno-lto'] + SOURCES['skia/src/core/SkBitmapProcState_opts_ssse3.cpp'].flags += skia_ssse3_flags + SOURCES['skia/src/core/SkBlitMask_opts_ssse3.cpp'].flags += skia_ssse3_flags + SOURCES['skia/src/core/SkSwizzler_opts_ssse3.cpp'].flags += ['-Dskvx=skvx_ssse3'] +diff -up firefox-145.0/toolkit/components/terminator/nsTerminator.cpp.pgo firefox-145.0/toolkit/components/terminator/nsTerminator.cpp +--- firefox-145.0/toolkit/components/terminator/nsTerminator.cpp.pgo 2025-11-03 16:57:15.000000000 +0100 ++++ firefox-145.0/toolkit/components/terminator/nsTerminator.cpp 2025-11-05 13:59:53.478238011 +0100 +@@ -330,6 +330,11 @@ void nsTerminator::StartWatchdog() { + } + #endif + ++ // Disable watchdog for PGO train builds - writting profile information at ++ // exit may take time and it is better to make build hang rather than ++ // silently produce poorly performing binary. ++ crashAfterMS = INT32_MAX; ++ + UniquePtr options(new Options()); + // crashAfterTicks is guaranteed to be > 0 as + // crashAfterMS >= ADDITIONAL_WAIT_BEFORE_CRASH_MS >> HEARTBEAT_INTERVAL_MS diff --git a/print-error-reftest b/print-error-reftest new file mode 100755 index 0000000..7a58c1c --- /dev/null +++ b/print-error-reftest @@ -0,0 +1,13 @@ +#!/usr/bin/bash +# Print reftest failures and compose them to html + +TEST_DIR="$1" +TEST_FLAVOUR="$2" +OUTPUT_FILE="failures-reftest$TEST_FLAVOUR.html" + +grep --text -e "REFTEST TEST-UNEXPECTED-PASS" -e "REFTEST TEST-UNEXPECTED-FAIL" -e "IMAGE 1 (TEST):" -e "IMAGE 2 (REFERENCE):" $TEST_DIR/reftest$TEST_FLAVOUR 2>&1 > $OUTPUT_FILE +sed -i '/REFTEST IMAGE 1/a ">' $OUTPUT_FILE +sed -i '/REFTEST IMAGE 2/a ">

' $OUTPUT_FILE +sed -i '/REFTEST TEST/a
' $OUTPUT_FILE +sed -i -e 's/^REFTEST IMAGE 1 (TEST): /&1 > failures-mochitest$TEST_FLAVOUR.txt +grep --text -e " FAIL " -e " TIMEOUT " $TEST_DIR/xpcshell$TEST_FLAVOUR 2>&1 > failures-xpcshell$TEST_FLAVOUR.txt +grep --text -e "REFTEST TEST-UNEXPECTED-PASS" -e "REFTEST TEST-UNEXPECTED-FAIL" $TEST_DIR/reftest$TEST_FLAVOUR 2>&1 > failures-reftest$TEST_FLAVOUR.txt diff --git a/print_failures b/print_failures new file mode 100755 index 0000000..bc92b0c --- /dev/null +++ b/print_failures @@ -0,0 +1,9 @@ +#!/usr/bin/bash +# Analyze and print test failures + +export TEST_DIR="test_results" + +#./print-errors $TEST_DIR "" +./print-errors $TEST_DIR "-wr" +#./print-error-reftest $TEST_DIR "" +./print-error-reftest $TEST_DIR "-wr" diff --git a/print_results b/print_results new file mode 100755 index 0000000..d0b1307 --- /dev/null +++ b/print_results @@ -0,0 +1,10 @@ +#!/usr/bin/bash +# Analyze and print general test results + +export TEST_DIR="test_results" + +echo "Test results" +#echo "Basic compositor" +#./psummary $TEST_DIR "" +echo "WebRender" +./psummary $TEST_DIR "-wr" diff --git a/psummary b/psummary new file mode 100755 index 0000000..f64fc8f --- /dev/null +++ b/psummary @@ -0,0 +1,23 @@ +#!/usr/bin/bash +# Analyze and print specialized (basic/webrender) test results + +TEST_DIR=$1 +TEST_FLAVOUR=$2 + +MPASS=`grep "TEST_END: Test OK" $TEST_DIR/mochitest$TEST_FLAVOUR | wc -l` +MERR=`grep "TEST_END: Test ERROR" $TEST_DIR/mochitest$TEST_FLAVOUR | wc -l` +MUNEX=`grep "TEST-UNEXPECTED-FAIL" $TEST_DIR/mochitest$TEST_FLAVOUR | wc -l` +echo "Mochitest PASSED: $MPASS FAILED: $MERR UNEXPECTED-FAILURES: $MUNEX" + +XPCPASS=`grep --text "Expected results:" $TEST_DIR/xpcshell$TEST_FLAVOUR | cut -d ' ' -f 3` +XPCFAIL=`grep --text "Unexpected results:" $TEST_DIR/xpcshell$TEST_FLAVOUR | cut -d ' ' -f 3` +echo "XPCShell: PASSED: $XPCPASS FAILED: $XPCFAIL" + +CRPASS=`grep "REFTEST INFO | Successful:" $TEST_DIR/crashtest$TEST_FLAVOUR | cut -d ' ' -f 5` +CRFAIL=`grep "^REFTEST INFO | Unexpected:" $TEST_DIR/crashtest$TEST_FLAVOUR | cut -d ' ' -f 5` +echo "Crashtest: PASSED: $CRPASS FAILED: $CRFAIL" + +RFPASS=`grep --text "REFTEST INFO | Successful:" $TEST_DIR/reftest$TEST_FLAVOUR | cut -d ' ' -f 5` +RFUN=`grep --text "^REFTEST INFO | Unexpected:" $TEST_DIR/reftest$TEST_FLAVOUR | cut -d ' ' -f 5` +RFKNOWN=`grep --text "REFTEST INFO | Known problems:" $TEST_DIR/reftest$TEST_FLAVOUR | cut -d ' ' -f 6` +echo "Reftest: PASSED: $RFPASS FAILED: $RFUN Known issues: $RFKNOWN" diff --git a/rhbz-1173156.patch b/rhbz-1173156.patch index c35d901..067b561 100644 --- a/rhbz-1173156.patch +++ b/rhbz-1173156.patch @@ -1,12 +1,12 @@ -diff -up firefox-60.5.0/extensions/auth/nsAuthSambaNTLM.cpp.rhbz-1173156 firefox-60.5.0/extensions/auth/nsAuthSambaNTLM.cpp ---- firefox-60.5.0/extensions/auth/nsAuthSambaNTLM.cpp.rhbz-1173156 2019-01-22 10:36:09.284069020 +0100 -+++ firefox-60.5.0/extensions/auth/nsAuthSambaNTLM.cpp 2019-01-22 10:37:12.669757744 +0100 -@@ -161,7 +161,7 @@ nsresult nsAuthSambaNTLM::SpawnNTLMAuthH - const char* username = PR_GetEnv("USER"); - if (!username) return NS_ERROR_FAILURE; +diff -up firefox-132.0/extensions/auth/nsAuthSambaNTLM.cpp.rhbz-1173156 firefox-132.0/extensions/auth/nsAuthSambaNTLM.cpp +--- firefox-132.0/extensions/auth/nsAuthSambaNTLM.cpp.rhbz-1173156 2024-10-23 09:26:41.433895188 +0200 ++++ firefox-132.0/extensions/auth/nsAuthSambaNTLM.cpp 2024-10-23 10:05:11.025801336 +0200 +@@ -153,7 +153,7 @@ nsresult nsAuthSambaNTLM::SpawnNTLMAuthH + options.fds_to_remap.push_back( + std::pair{fromChildPipeWrite.get(), STDOUT_FILENO}); + +- std::vector argvVec{"ntlm_auth", "--helper-protocol", ++ std::vector argvVec{"/usr/bin/ntlm_auth", "--helper-protocol", + "ntlmssp-client-1", "--use-cached-creds", + "--username", username}; -- const char* const args[] = {"ntlm_auth", -+ const char* const args[] = {"/usr/bin/ntlm_auth", - "--helper-protocol", - "ntlmssp-client-1", - "--use-cached-creds", diff --git a/rhbz-1219542-s390-build.patch b/rhbz-1219542-s390-build.patch deleted file mode 100644 index f94e43a..0000000 --- a/rhbz-1219542-s390-build.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff -up firefox-55.0/js/src/old-configure.in.rhbz-1219542-s390 firefox-55.0/js/src/old-configure.in ---- firefox-55.0/js/src/old-configure.in.rhbz-1219542-s390 2017-07-31 18:20:48.000000000 +0200 -+++ firefox-55.0/js/src/old-configure.in 2017-08-02 14:31:32.190243669 +0200 -@@ -541,7 +541,7 @@ case "$host" in - - *-linux*|*-kfreebsd*-gnu|*-gnu*) - HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX" -- HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}" -+ HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O1}" - ;; - - *) -@@ -617,8 +617,8 @@ case "$target" in - - *-*linux*) - if test "$GNU_CC" -o "$GNU_CXX"; then -- MOZ_PGO_OPTIMIZE_FLAGS="-O3" -- MOZ_OPTIMIZE_FLAGS="-O3" -+ MOZ_PGO_OPTIMIZE_FLAGS="-O1" -+ MOZ_OPTIMIZE_FLAGS="-O1" - if test -z "$CLANG_CC"; then - MOZ_OPTIMIZE_FLAGS="-freorder-blocks $MOZ_OPTIMIZE_FLAGS" - fi diff --git a/rhbz-1354671.patch b/rhbz-1354671.patch index 0e22dab..b6e8bbd 100644 --- a/rhbz-1354671.patch +++ b/rhbz-1354671.patch @@ -1,12 +1,12 @@ -diff -up firefox-65.0/layout/base/nsIPresShell.h.1354671 firefox-65.0/layout/base/nsIPresShell.h ---- firefox-65.0/layout/base/nsIPresShell.h.1354671 2019-01-29 11:50:08.516649643 +0100 -+++ firefox-65.0/layout/base/nsIPresShell.h 2019-01-29 11:51:48.930258629 +0100 -@@ -205,7 +205,7 @@ class nsIPresShell : public nsStubDocume +diff -up firefox-70.0/layout/base/PresShell.h.1354671 firefox-70.0/layout/base/PresShell.h +--- firefox-70.0/layout/base/PresShell.h.1354671 2019-10-22 12:33:12.987775587 +0200 ++++ firefox-70.0/layout/base/PresShell.h 2019-10-22 12:36:39.999366086 +0200 +@@ -257,7 +257,7 @@ class PresShell final : public nsStubDoc * to the same aSize value. AllocateFrame is infallible and will abort * on out-of-memory. */ - void* AllocateFrame(nsQueryFrame::FrameIID aID, size_t aSize) { + void* __attribute__((optimize("no-lifetime-dse"))) AllocateFrame(nsQueryFrame::FrameIID aID, size_t aSize) { - void* result = mFrameArena.AllocateByFrameID(aID, aSize); - RecordAlloc(result); - return result; + #define FRAME_ID(classname, ...) \ + static_assert(size_t(nsQueryFrame::FrameIID::classname##_id) == \ + size_t(eArenaObjectID_##classname), \ diff --git a/rhbz-1400293-fix-mozilla-1324096.patch b/rhbz-1400293-fix-mozilla-1324096.patch deleted file mode 100644 index 4a2691e..0000000 --- a/rhbz-1400293-fix-mozilla-1324096.patch +++ /dev/null @@ -1,72 +0,0 @@ -diff --git a/security/certverifier/CertVerifier.cpp b/security/certverifier/CertVerifier.cpp ---- a/security/certverifier/CertVerifier.cpp -+++ b/security/certverifier/CertVerifier.cpp -@@ -120,16 +120,20 @@ IsCertChainRootBuiltInRoot(const UniqueC - } - CERTCertificate* root = rootNode->cert; - if (!root) { - return Result::FATAL_ERROR_LIBRARY_FAILURE; - } - return IsCertBuiltInRoot(root, result); - } - -+// The term "builtin root" traditionally refers to a root CA certificate that -+// has been added to the NSS trust store, because it has been approved -+// for inclusion according to the Mozilla CA policy, and might be accepted -+// by Mozilla applications as an issuer for certificates seen on the public web. - Result - IsCertBuiltInRoot(CERTCertificate* cert, bool& result) - { - result = false; - #ifdef DEBUG - nsCOMPtr component(do_GetService(PSM_COMPONENT_CONTRACTID)); - if (!component) { - return Result::FATAL_ERROR_LIBRARY_FAILURE; -@@ -142,25 +146,38 @@ IsCertBuiltInRoot(CERTCertificate* cert, - return Success; - } - #endif // DEBUG - AutoSECMODListReadLock lock; - for (SECMODModuleList* list = SECMOD_GetDefaultModuleList(); list; - list = list->next) { - for (int i = 0; i < list->module->slotCount; i++) { - PK11SlotInfo* slot = list->module->slots[i]; -- // PK11_HasRootCerts should return true if and only if the given slot has -- // an object with a CKA_CLASS of CKO_NETSCAPE_BUILTIN_ROOT_LIST, which -- // should be true only of the builtin root list. -- // If we can find a copy of the given certificate on the slot with the -- // builtin root list, that certificate must be a builtin. -- if (PK11_IsPresent(slot) && PK11_HasRootCerts(slot) && -- PK11_FindCertInSlot(slot, cert, nullptr) != CK_INVALID_HANDLE) { -- result = true; -- return Success; -+ // We're searching for the "builtin root module", which is a module that -+ // contains an object with a CKA_CLASS of CKO_NETSCAPE_BUILTIN_ROOT_LIST. -+ // We use PK11_HasRootCerts() to identify a module with that property. -+ // In the past, we exclusively used the PKCS#11 module named nssckbi, -+ // which is provided by the NSS library. -+ // Nowadays, some distributions use a replacement module, which contains -+ // the builtin roots, but which also contains additional CA certificates, -+ // such as CAs trusted in a local deployment. -+ // We want to be able to distinguish between these two categories, -+ // because a CA, which may issue certificates for the public web, -+ // is expected to comply with additional requirements. -+ // If the certificate has attribute CKA_NSS_MOZILLA_CA_POLICY set to true, -+ // then we treat it as a "builtin root". -+ if (PK11_IsPresent(slot) && PK11_HasRootCerts(slot)) { -+ CK_OBJECT_HANDLE handle = PK11_FindCertInSlot(slot, cert, nullptr); -+ if (handle != CK_INVALID_HANDLE && -+ PK11_HasAttributeSet(slot, handle, CKA_NSS_MOZILLA_CA_POLICY, -+ false)) { -+ // Attribute was found, and is set to true -+ result = true; -+ break; -+ } - } - } - } - return Success; - } - - static Result - BuildCertChainForOneKeyUsage(NSSCertDBTrustDomain& trustDomain, Input certDER, diff --git a/run-tests-wayland b/run-tests-wayland new file mode 100755 index 0000000..95ee6f6 --- /dev/null +++ b/run-tests-wayland @@ -0,0 +1,80 @@ +#!/usr/bin/bash +# usage: run-tests-wayland [test flavour] + +set -x + +RUN_XPCSHELL_TEST=1 +RUN_REFTEST=1 +RUN_MOCHITEST=1 +RUN_CRASHTEST=1 + +while (( "$#" )); do + SELECTED_TEST=$1 + if [ "$SELECTED_TEST" = "xpcshell" ] ; then + RUN_XPCSHELL_TEST=1 + elif [ "$SELECTED_TEST" = "reftest" ] ; then + RUN_REFTEST=1 + elif [ "$SELECTED_TEST" = "mochitest" ] ; then + RUN_MOCHITEST=1 + elif [ "$SELECTED_TEST" = "crashtest" ] ; then + RUN_CRASHTEST=1 + fi + shift +done + +export MACH_USE_SYSTEM_PYTHON=1 +export MOZ_NODE_PATH=/usr/bin/node + +MOCHITEST_PARAMS="--timeout 1 --chunk-by-dir 4" +TEST_DIR="test_results" +mkdir $TEST_DIR + +env | grep "DISPLAY" + +# Fix for system nss +ln -s /usr/bin/certutil objdir/dist/bin/certutil +ln -s /usr/bin/pk12util objdir/dist/bin/pk12util + +NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`" + +export MOZ_ENABLE_WAYLAND=1 + +if [ $RUN_XPCSHELL_TEST -ne 0 ] ; then +# ./mach xpcshell-test 2>&1 | cat - | tee $TEST_DIR/xpcshell + ./mach xpcshell-test --enable-webrender 2>&1 | cat - | tee $TEST_DIR/xpcshell-wr + sleep 60 +fi + +# Basic render testing +export TEST_PARAMS="--setpref reftest.ignoreWindowSize=true --setpref widget.wayland.test-workarounds.enabled=true" +#export TEST_FLAVOUR="" +#if [ $RUN_REFTEST -ne 0 ] ; then +# ./mach reftest --marionette localhost:$(($(($RANDOM))+2000)) $TEST_PARAMS 2>&1 | tee $TEST_DIR/reftest$TEST_FLAVOUR +#fi +#if [ $RUN_CRASHTEST -ne 0 ] ; then +# ./mach crashtest --marionette localhost:$(($(($RANDOM))+2000)) $TEST_PARAMS 2>&1 | tee $TEST_DIR/crashtest$TEST_FLAVOUR +#fi +#if [ $RUN_MOCHITEST -ne 0 ] ; then +# ./mach mochitest --marionette localhost:$(($(($RANDOM))+2000)) $MOCHITEST_PARAMS $TEST_PARAMS 2>&1 | tee $TEST_DIR/mochitest$TEST_FLAVOUR +#fi + +# WebRender testing +export TEST_PARAMS="--enable-webrender $TEST_PARAMS" +export TEST_FLAVOUR="-wr" +# Use dom/base/test or dom/base/test/chrome for short version +export MOCHITEST_DIR='dom' +if [ $RUN_REFTEST -ne 0 ] ; then + ./mach reftest $TEST_PARAMS 2>&1 | tee $TEST_DIR/reftest$TEST_FLAVOUR + sleep 60 +fi +if [ $RUN_CRASHTEST -ne 0 ] ; then + ./mach crashtest $TEST_PARAMS 2>&1 | tee $TEST_DIR/crashtest$TEST_FLAVOUR + sleep 60 +fi +if [ $RUN_MOCHITEST -ne 0 ] ; then + ./mach mochitest $MOCHITEST_DIR $MOCHITEST_PARAMS $TEST_PARAMS 2>&1 | tee $TEST_DIR/mochitest$TEST_FLAVOUR + sleep 60 +fi + +rm -f objdir/dist/bin/certutil +rm -f objdir/dist/bin/pk12util diff --git a/run-tests-x11 b/run-tests-x11 new file mode 100755 index 0000000..1d4a1c0 --- /dev/null +++ b/run-tests-x11 @@ -0,0 +1,39 @@ +#!/usr/bin/bash +set -x + +export MACH_USE_SYSTEM_PYTHON=1 +export MOZ_NODE_PATH=/usr/bin/node +export X_PARAMS="-screen 0 1600x1200x24" +export MOCHITEST_PARAMS="--timeout 1 --chunk-by-dir 4" +export TEST_DIR="test_results" + +# Fix for system nss +ln -s /usr/bin/certutil objdir/dist/bin/certutil +ln -s /usr/bin/pk12util objdir/dist/bin/pk12util + +NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`" + +# Basic render testing +export TEST_PARAMS="" +export TEST_FLAVOUR="" +#xvfb-run -s "$X_PARAMS" -n 91 ./mach xpcshell-test --sequential $TEST_PARAMS 2>&1 | cat - | tee $TEST_DIR/xpcshell +#xvfb-run -s "$X_PARAMS" -n 92 ./mach reftest --marionette localhost:$(($(($RANDOM))+2000)) $TEST_PARAMS 2>&1 | tee $TEST_DIR/reftest$TEST_FLAVOUR +#xvfb-run -s "$X_PARAMS" -n 93 ./mach crashtest --marionette localhost:$(($(($RANDOM))+2000)) $TEST_PARAMS 2>&1 | tee $TEST_DIR/crashtest$TEST_FLAVOUR +#xvfb-run -s "$X_PARAMS" -n 94 ./mach mochitest --marionette localhost:$(($(($RANDOM))+2000)) $MOCHITEST_PARAMS $TEST_PARAMS 2>&1 | tee $TEST_DIR/mochitest$TEST_FLAVOUR + +# WebRender testing +export TEST_PARAMS="--enable-webrender $TEST_PARAMS" +export TEST_FLAVOUR="-wr" +#xvfb-run -s "$X_PARAMS" -n 95 ./mach xpcshell-test --sequential $TEST_PARAMS 2>&1 | cat - | tee $TEST_DIR/xpcshell-wr +#sleep 60 +#xvfb-run -s "$X_PARAMS" -n 96 ./mach reftest $TEST_PARAMS 2>&1 | tee $TEST_DIR/reftest$TEST_FLAVOUR +#sleep 60 +#xvfb-run -s "$X_PARAMS" -n 97 ./mach crashtest $TEST_PARAMS 2>&1 | tee $TEST_DIR/crashtest$TEST_FLAVOUR +#sleep 60 +#export DISPLAY=:0 +#./mach mochitest dom/base/test/ $MOCHITEST_PARAMS $TEST_PARAMS 2>&1 | tee $TEST_DIR/mochitest$TEST_FLAVOUR +export DISPLAY=:98 +xvfb-run -s "$X_PARAMS" -n 98 ./mach mochitest dom/base/test/ $MOCHITEST_PARAMS $TEST_PARAMS 2>&1 | tee $TEST_DIR/mochitest$TEST_FLAVOUR + +rm -f objdir/dist/bin/certutil +rm -f objdir/dist/bin/pk12util diff --git a/run-wayland-compositor b/run-wayland-compositor new file mode 100755 index 0000000..2ac9f69 --- /dev/null +++ b/run-wayland-compositor @@ -0,0 +1,59 @@ +#!/usr/bin/bash +# Run wayland compositor and set WAYLAND_DISPLAY env variable + +set -x + +echo export DESKTOP_SESSION=gnome > $HOME/.xsessionrc +echo export XDG_CURRENT_DESKTOP=GNOME > $HOME/.xsessionrc +echo export XDG_SESSION_TYPE=wayland >> $HOME/.xsessionrc + +# Turn off the screen saver and screen locking +gsettings set org.gnome.desktop.screensaver idle-activation-enabled false +gsettings set org.gnome.desktop.screensaver lock-enabled false +gsettings set org.gnome.desktop.screensaver lock-delay 3600 + +# Disable the screen saver +# This starts the gnome-keyring-daemon with an unlocked login keyring. libsecret uses this to +# store secrets. Firefox uses libsecret to store a key that protects sensitive information like +# credit card numbers. +if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then + # if not found, launch a new one + eval `dbus-launch --sh-syntax` +fi + +if [ -z "$XDG_RUNTIME_DIR" ]; then + export XDG_RUNTIME_DIR=$HOME +fi + +export WAYLAND_DISPLAY=firefox-pgo-wayland-0 +if [ -S "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY" ]; then + rm -f $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY + rm -f $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY.lock +fi + +echo "Launch mutter for $WAYLAND_DISPLAY" +mutter --headless --virtual-monitor 1920x1080 --wayland-display=$WAYLAND_DISPLAY --no-x11 & MUTTER_PID=$! +export MUTTER_PID +echo "Mutter PID $MUTTER_PID" + +echo "Waiting for mutter to start..." +sleep 5 +retry_count=0 +max_retries=5 +until [ $retry_count -gt $max_retries ]; do + if [ -S "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY" ]; then + retry_count=$(($max_retries + 1)) + else + retry_count=$(($retry_count + 1)) + echo "Waiting for Mutter, retry: $retry_count" + sleep 2 + fi +done + +if [ ! -S "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY" ]; then + echo "Mutter failed to start!" + exit 1 +fi + +echo "Mutter is running, $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY is here." + diff --git a/sources b/sources index 2cd09d2..b87ab2c 100644 --- a/sources +++ b/sources @@ -1,3 +1,7 @@ -SHA512 (cbindgen-vendor.tar.xz) = bdd1535c9923a082cdca263ff2c1765814b00b6a1c74be95bac4dbf7d0b7b29c1c27f0fed6feae99c88521c96e2865f0ea3cf784bd9a32a44cec6ee4df850662 -SHA512 (firefox-67.0.source.tar.xz) = a1000d6ca8146a9a3c74a3f69041b755c0c5014c8a608298d9c4cbe39577939d43139a7ad742983697ae90b635d3f5d8f9a008fcc2b3778adaadc25acc49ca29 -SHA512 (firefox-langpacks-67.0-20190517.tar.xz) = f8406332e5bf841ae78b1ff57a4eebb11110f94b0ecdac629ac6935c9f0feddfde4de33b18310b7693015b7ae5b438df86a67f7a0bdf8fa36a3bcccbea15d13e +SHA512 (mochitest-python.tar.gz) = 089b1593068b76f4572af0086eaccf52a6a1299bfffb58593206d19bf021ae381f2380bbfeb4371586cd53706ff6dde3d240238b2caf19b96c57dfc2f4524e36 +SHA512 (dump_syms-vendor.tar.xz) = ee0ea52aac781b8dd48936a3d13b140bd725a48cc488d23693b68edbe3bcfba5723022dba3c3849d0da1bacf0e37ddd307cfc56304159f91b71495ce8a08b54a +SHA512 (wasi-sdk-25.tar.gz) = 1285981d26aa5eff27f08ed4b409909639ddcd62c94ee0cff7093ef68722f4b024c099ca3aa3ab50411e9aace13b86f1f30c5e08a3fc58b6a46b87369d6904aa +SHA512 (wasm-component-ld-vendor.tar.xz) = 707d942d31455ae0a4f68bf419fb09a20407b6747f831ca554dcd00925b7ea98ef4d03a8652b6d2ae54cf48d7ad15d85aa7eb8d0778ef66b89593eaa8b5c3465 +SHA512 (cbindgen-vendor.tar.xz) = bea420e66bdd1c7c944655dd3e01abd6e7d6ac4b245c7ee190f31d800f7786f21e5cae11715b479bf795f4369d18c40dc12df19e0b643664f2f78e5c8a681415 +SHA512 (firefox-langpacks-147.0-20260106.tar.xz) = 4006c6e8dda8722509c1d1756807373d431d75b20d5a0c3f19e72a2a0dc76df62b15ef871e3fff2d30b2682e6a56b4a4541d8445ea1b83641559a3270e0057b7 +SHA512 (firefox-147.0.source.tar.xz) = ac9017b1a2da7b2f139392c394c36341fd3476e3d4ea1a3c7e5e7bf100dc30d185132ef9256be7e6b0f9dbfc69234ac571ea1fc6db9d84543b15772f4ec85161 diff --git a/wasi.patch b/wasi.patch new file mode 100644 index 0000000..0a83f8c --- /dev/null +++ b/wasi.patch @@ -0,0 +1,35 @@ +diff -up firefox-134.0.1/toolkit/moz.configure.wasi firefox-134.0.1/toolkit/moz.configure +--- firefox-134.0.1/toolkit/moz.configure.wasi 2025-01-13 14:46:04.000000000 +0100 ++++ firefox-134.0.1/toolkit/moz.configure 2025-01-17 08:39:38.870092763 +0100 +@@ -2767,7 +2776,7 @@ with only_when(requires_wasm_sandboxing + def wasi_sysroot_flags(wasi_sysroot): + if wasi_sysroot: + log.info("Using wasi sysroot in %s", wasi_sysroot) +- return ["--sysroot=%s" % wasi_sysroot] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "/raid/CVS/firefox/firefox-147.0-build/firefox-147.0/wasi-sdk-25/build/sysroot/install/wasi-resource-dir/lib/wasi/libclang_rt.builtins-wasm32.a"] + return [] + + set_config("WASI_SYSROOT", wasi_sysroot) +diff -up firefox-134.0.1/wasi-sdk-25/cmake/wasi-sdk-toolchain.cmake.wasi firefox-134.0.1/wasi-sdk-25/cmake/wasi-sdk-toolchain.cmake +--- firefox-134.0.1/wasi-sdk-25/cmake/wasi-sdk-toolchain.cmake.wasi 2025-01-17 08:40:23.004159900 +0100 ++++ firefox-134.0.1/wasi-sdk-25/cmake/wasi-sdk-toolchain.cmake 2025-01-17 08:40:35.478178790 +0100 +@@ -126,7 +126,7 @@ endif() + add_custom_command( + OUTPUT ${wasm_component_ld} + COMMAND +- cargo install --root ${wasm_component_ld_root} ${rust_target_flag} ++ cargo install --offline --root ${wasm_component_ld_root} ${rust_target_flag} + wasm-component-ld@${wasm_component_ld_version} + COMMAND + cmake -E make_directory ${wasi_tmp_install}/bin +diff -up firefox-134.0.2/wasi-sdk-25/version.py.wasi firefox-134.0.2/wasi-sdk-25/version.py +--- firefox-134.0.2/wasi-sdk-25/version.py.wasi 2025-01-16 08:03:26.042654800 +0100 ++++ firefox-134.0.2/wasi-sdk-25/version.py 2025-01-22 14:08:34.563909971 +0100 +@@ -60,6 +60,7 @@ assert parse_git_version( + + + def git_version(): ++ return 25 + version = exec(['git', 'describe', '--long', '--candidates=999', + '--match=wasi-sdk-*', '--dirty=+m', f'--abbrev={GIT_REF_LEN}'], + os.path.dirname(sys.argv[0])) diff --git a/wasi.patch.template b/wasi.patch.template new file mode 100644 index 0000000..fe4aee9 --- /dev/null +++ b/wasi.patch.template @@ -0,0 +1,35 @@ +diff -up firefox-134.0.1/toolkit/moz.configure.wasi firefox-134.0.1/toolkit/moz.configure +--- firefox-134.0.1/toolkit/moz.configure.wasi 2025-01-13 14:46:04.000000000 +0100 ++++ firefox-134.0.1/toolkit/moz.configure 2025-01-17 08:39:38.870092763 +0100 +@@ -2767,7 +2776,7 @@ with only_when(requires_wasm_sandboxing + def wasi_sysroot_flags(wasi_sysroot): + if wasi_sysroot: + log.info("Using wasi sysroot in %s", wasi_sysroot) +- return ["--sysroot=%s" % wasi_sysroot] ++ return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "LIBCLANG_RT_PLACEHOLDER"] + return [] + + set_config("WASI_SYSROOT", wasi_sysroot) +diff -up firefox-134.0.1/wasi-sdk-25/cmake/wasi-sdk-toolchain.cmake.wasi firefox-134.0.1/wasi-sdk-25/cmake/wasi-sdk-toolchain.cmake +--- firefox-134.0.1/wasi-sdk-25/cmake/wasi-sdk-toolchain.cmake.wasi 2025-01-17 08:40:23.004159900 +0100 ++++ firefox-134.0.1/wasi-sdk-25/cmake/wasi-sdk-toolchain.cmake 2025-01-17 08:40:35.478178790 +0100 +@@ -126,7 +126,7 @@ endif() + add_custom_command( + OUTPUT ${wasm_component_ld} + COMMAND +- cargo install --root ${wasm_component_ld_root} ${rust_target_flag} ++ cargo install --offline --root ${wasm_component_ld_root} ${rust_target_flag} + wasm-component-ld@${wasm_component_ld_version} + COMMAND + cmake -E make_directory ${wasi_tmp_install}/bin +diff -up firefox-134.0.2/wasi-sdk-25/version.py.wasi firefox-134.0.2/wasi-sdk-25/version.py +--- firefox-134.0.2/wasi-sdk-25/version.py.wasi 2025-01-16 08:03:26.042654800 +0100 ++++ firefox-134.0.2/wasi-sdk-25/version.py 2025-01-22 14:08:34.563909971 +0100 +@@ -60,6 +60,7 @@ assert parse_git_version( + + + def git_version(): ++ return 25 + version = exec(['git', 'describe', '--long', '--candidates=999', + '--match=wasi-sdk-*', '--dirty=+m', f'--abbrev={GIT_REF_LEN}'], + os.path.dirname(sys.argv[0]))