diff options
author | nikatar | 2023-05-04 01:12:00 +0300 |
---|---|---|
committer | nikatar | 2023-05-04 01:12:00 +0300 |
commit | b096d21631ce7c933bd28ccad71a4da08fcb36b3 (patch) | |
tree | c22e781153627071c75e66b614423fd02c3145a2 | |
parent | 5f04c4c461b81c9d486aa8a748c22ef4f3adf204 (diff) | |
download | aur-b096d21631ce7c933bd28ccad71a4da08fcb36b3.tar.gz |
112.0.2-1-prototype
-rw-r--r-- | 0001-Bug-1803016-Wayland-Don-t-commit-wl_buffer-if-buffer.patch | 81 | ||||
-rw-r--r-- | PKGBUILD | 11 |
2 files changed, 89 insertions, 3 deletions
diff --git a/0001-Bug-1803016-Wayland-Don-t-commit-wl_buffer-if-buffer.patch b/0001-Bug-1803016-Wayland-Don-t-commit-wl_buffer-if-buffer.patch new file mode 100644 index 000000000000..37333e253618 --- /dev/null +++ b/0001-Bug-1803016-Wayland-Don-t-commit-wl_buffer-if-buffer.patch @@ -0,0 +1,81 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: stransky <stransky@redhat.com> +Date: Thu, 30 Mar 2023 11:49:53 +0000 +Subject: [PATCH] Bug 1803016 [Wayland] Don't commit wl_buffer if buffer scale + doesn't match its size r=emilio + +Differential Revision: https://phabricator.services.mozilla.com/D173814 +--- + widget/gtk/MozContainerWayland.cpp | 7 +++++++ + widget/gtk/MozContainerWayland.h | 3 +++ + widget/gtk/WindowSurfaceWaylandMultiBuffer.cpp | 17 ++++++++++++++--- + 3 files changed, 24 insertions(+), 3 deletions(-) + +diff --git a/widget/gtk/MozContainerWayland.cpp b/widget/gtk/MozContainerWayland.cpp +index 2a4a492077c3..0d9aacc954b7 100644 +--- a/widget/gtk/MozContainerWayland.cpp ++++ b/widget/gtk/MozContainerWayland.cpp +@@ -597,6 +597,13 @@ void moz_container_wayland_set_scale_factor(MozContainer* container) { + } + } + ++bool moz_container_wayland_size_matches_scale_factor_locked( ++ const MutexAutoLock& aProofOfLock, MozContainer* container, int aWidth, ++ int aHeight) { ++ return aWidth % container->wl_container.buffer_scale == 0 && ++ aHeight % container->wl_container.buffer_scale == 0; ++} ++ + static bool moz_container_wayland_surface_create_locked( + const MutexAutoLock& aProofOfLock, MozContainer* container) { + MozContainerWayland* wl_container = &container->wl_container; +diff --git a/widget/gtk/MozContainerWayland.h b/widget/gtk/MozContainerWayland.h +index d3c49baae8ac..369d40a55250 100644 +--- a/widget/gtk/MozContainerWayland.h ++++ b/widget/gtk/MozContainerWayland.h +@@ -85,6 +85,9 @@ bool moz_container_wayland_egl_window_needs_size_update(MozContainer* container, + void moz_container_wayland_set_scale_factor(MozContainer* container); + void moz_container_wayland_set_scale_factor_locked( + const mozilla::MutexAutoLock& aProofOfLock, MozContainer* container); ++bool moz_container_wayland_size_matches_scale_factor_locked( ++ const mozilla::MutexAutoLock& aProofOfLock, MozContainer* container, ++ int aWidth, int aHeight); + + void moz_container_wayland_add_initial_draw_callback_locked( + MozContainer* container, const std::function<void(void)>& initial_draw_cb); +diff --git a/widget/gtk/WindowSurfaceWaylandMultiBuffer.cpp b/widget/gtk/WindowSurfaceWaylandMultiBuffer.cpp +index 85ab1942d9e6..31091f4b9848 100644 +--- a/widget/gtk/WindowSurfaceWaylandMultiBuffer.cpp ++++ b/widget/gtk/WindowSurfaceWaylandMultiBuffer.cpp +@@ -285,8 +285,8 @@ void WindowSurfaceWaylandMB::Commit( + mFrameInProcess = false; + + MozContainer* container = mWindow->GetMozContainer(); +- MozContainerSurfaceLock lock(container); +- struct wl_surface* waylandSurface = lock.GetSurface(); ++ MozContainerSurfaceLock MozContainerLock(container); ++ struct wl_surface* waylandSurface = MozContainerLock.GetSurface(); + if (!waylandSurface) { + LOGWAYLAND( + "WindowSurfaceWaylandMB::Commit [%p] frame queued: can't lock " +@@ -319,8 +319,19 @@ void WindowSurfaceWaylandMB::Commit( + } + } + ++ // aProofOfLock is a kind of substitution of MozContainerSurfaceLock. ++ // MozContainer is locked but MozContainerSurfaceLock doen't convert to ++ // MutexAutoLock& so we use aProofOfLock here. + moz_container_wayland_set_scale_factor_locked(aProofOfLock, container); +- mInProgressBuffer->AttachAndCommit(waylandSurface); ++ ++ // It's possible that scale factor changed between Lock() and Commit() ++ // but window size is the same. ++ // Don't attach such buffer as it may have incorrect size, ++ // we'll paint new content soon. ++ if (moz_container_wayland_size_matches_scale_factor_locked( ++ aProofOfLock, container, mWindowSize.width, mWindowSize.height)) { ++ mInProgressBuffer->AttachAndCommit(waylandSurface); ++ } + + mInProgressBuffer->ResetBufferAge(); + mFrontBuffer = mInProgressBuffer; @@ -7,8 +7,8 @@ pkgname=firefox-appmenu _pkgname=firefox -pkgver=112.0.1 -pkgrel=1 +pkgver=112.0.2 +pkgrel=2 pkgdesc="Firefox from extra with appmenu patch" arch=(x86_64) license=(MPL GPL LGPL) @@ -30,13 +30,15 @@ options=(!emptydirs !makeflags !strip !lto !debug) source=(https://archive.mozilla.org/pub/firefox/releases/$pkgver/source/firefox-$pkgver.source.tar.xz{,.asc} $_pkgname.desktop identity-icons-brand.svg + 0001-Bug-1803016-Wayland-Don-t-commit-wl_buffer-if-buffer.patch fix-wayland-build.patch unity-menubar.patch fix_csd_window_buttons.patch) -sha256sums=('5d2b2886812fe1bc62b7801495d375e3de94ca160a676057d1df92de87efb649' +sha256sums=('e6a4819a3b82b1ca6c45296e50e6c9ab653306eeb540e50ba8683e339565992e' 'SKIP' '34514a657d6907a159594c51e674eeb81297c431ec26a736417c2fdb995c2c0c' 'a9b8b4a0a1f4a7b4af77d5fc70c2686d624038909263c795ecc81e0aec7711e9' + 'bfe15651a99ac6d0037867c9db00a0d4340353cdc0ac4a39e43ad61cc2589ed6' '46724a625f51c358abaee488a7ce75673078e96ba009459339120b8dd11dec25' '74440d292e76426ac5cba9058a6f86763c37a9aa61b7afc47771140f1f53870b' 'e08d0bc5b7e562f5de6998060e993eddada96d93105384960207f7bdf2e1ed6e') @@ -58,6 +60,9 @@ prepare() { mkdir mozbuild cd firefox-$pkgver + # https://bugzilla.mozilla.org/show_bug.cgi?id=1803016 + patch -Np1 -i ../0001-Bug-1803016-Wayland-Don-t-commit-wl_buffer-if-buffer.patch + #https://aur.archlinux.org/packages/firefox-appmenu nicman32 comment 2021-08-16 patch -Np1 -i ../fix-wayland-build.patch |