From 2f14c4ee29db96653b9c5f5f431ac481e357d902 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 6 Apr 2020 15:11:14 +0200 Subject: Added fix for mozbz#1627469 --- firefox.spec | 7 +++- mozilla-1627469.patch | 113 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 mozilla-1627469.patch diff --git a/firefox.spec b/firefox.spec index 1f5c86c..3baeba9 100644 --- a/firefox.spec +++ b/firefox.spec @@ -118,7 +118,7 @@ ExcludeArch: s390x Summary: Mozilla Firefox Web browser Name: firefox Version: 74.0.1 -Release: 2%{?nss_tag}%{?dist} +Release: 3%{?nss_tag}%{?dist} URL: https://www.mozilla.org/firefox/ License: MPLv1.1 or GPLv2+ or LGPLv2+ Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz @@ -192,6 +192,7 @@ Patch574: firefox-pipewire.patch Patch575: mozilla-1609538.patch Patch576: mozilla-1623060.patch Patch577: mozilla-1624745.patch +Patch578: mozilla-1627469.patch # PGO/LTO patches Patch600: pgo.patch @@ -403,6 +404,7 @@ This package contains results of tests executed during build. %patch575 -p1 -b .mozilla-1609538 %patch576 -p1 -b .mozilla-1623060 %patch577 -p1 -b .mozilla-1624745 +%patch578 -p1 -b .mozilla-1627469 # PGO patches %patch600 -p1 -b .pgo @@ -969,6 +971,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : #--------------------------------------------------------------------- %changelog +* 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 diff --git a/mozilla-1627469.patch b/mozilla-1627469.patch new file mode 100644 index 0000000..3e53ec5 --- /dev/null +++ b/mozilla-1627469.patch @@ -0,0 +1,113 @@ +diff -up firefox-74.0.1/widget/gtk/WindowSurfaceWayland.cpp.mozilla-1627469 firefox-74.0.1/widget/gtk/WindowSurfaceWayland.cpp +--- firefox-74.0.1/widget/gtk/WindowSurfaceWayland.cpp.mozilla-1627469 2020-04-06 15:07:16.772431937 +0200 ++++ firefox-74.0.1/widget/gtk/WindowSurfaceWayland.cpp 2020-04-06 15:09:57.037320477 +0200 +@@ -647,13 +647,14 @@ WindowBackBuffer* WindowSurfaceWayland:: + LOGWAYLAND( + ("WindowSurfaceWayland::NewWaylandBuffer [%p] Requested buffer [%d " + "x %d] DMABuf %d\n", +- (void*)this, mWidgetRect.width, mWidgetRect.height, aUseDMABufBackend)); ++ (void*)this, mWLBufferRect.width, mWLBufferRect.height, ++ aUseDMABufBackend)); + + mWaylandBuffer = WaylandBufferFindAvailable( +- mWidgetRect.width, mWidgetRect.height, aUseDMABufBackend); ++ mWLBufferRect.width, mWLBufferRect.height, aUseDMABufBackend); + if (!mWaylandBuffer) { +- mWaylandBuffer = CreateWaylandBuffer(mWidgetRect.width, mWidgetRect.height, +- aUseDMABufBackend); ++ mWaylandBuffer = CreateWaylandBuffer( ++ mWLBufferRect.width, mWLBufferRect.height, aUseDMABufBackend); + } + + return mWaylandBuffer; +@@ -663,7 +664,7 @@ WindowBackBuffer* WindowSurfaceWayland:: + LOGWAYLAND( + ("WindowSurfaceWayland::GetWaylandBufferRecent [%p] Requested buffer [%d " + "x %d]\n", +- (void*)this, mWidgetRect.width, mWidgetRect.height)); ++ (void*)this, mWLBufferRect.width, mWLBufferRect.height)); + + // There's no buffer created yet, create a new one for partial screen updates. + if (!mWaylandBuffer) { +@@ -675,9 +676,10 @@ WindowBackBuffer* WindowSurfaceWayland:: + return nullptr; + } + +- if (mWaylandBuffer->IsMatchingSize(mWidgetRect.width, mWidgetRect.height)) { +- LOGWAYLAND((" Size is ok, use the buffer [%d x %d]\n", mWidgetRect.width, +- mWidgetRect.height)); ++ if (mWaylandBuffer->IsMatchingSize(mWLBufferRect.width, ++ mWLBufferRect.height)) { ++ LOGWAYLAND((" Size is ok, use the buffer [%d x %d]\n", ++ mWLBufferRect.width, mWLBufferRect.height)); + return mWaylandBuffer; + } + +@@ -692,7 +694,7 @@ WindowBackBuffer* WindowSurfaceWayland:: + LOGWAYLAND( + ("WindowSurfaceWayland::GetWaylandBufferWithSwitch [%p] Requested buffer " + "[%d x %d]\n", +- (void*)this, mWidgetRect.width, mWidgetRect.height)); ++ (void*)this, mWLBufferRect.width, mWLBufferRect.height)); + + // There's no buffer created yet or actual buffer is attached, get a new one. + // Use DMABuf for fullscreen updates only. +@@ -701,20 +703,21 @@ WindowBackBuffer* WindowSurfaceWayland:: + } + + // Reuse existing buffer +- LOGWAYLAND((" Reuse buffer with resize [%d x %d]\n", mWidgetRect.width, +- mWidgetRect.height)); ++ LOGWAYLAND((" Reuse buffer with resize [%d x %d]\n", mWLBufferRect.width, ++ mWLBufferRect.height)); + + // OOM here, just return null to skip this frame. +- if (!mWaylandBuffer->Resize(mWidgetRect.width, mWidgetRect.height)) { ++ if (!mWaylandBuffer->Resize(mWLBufferRect.width, mWLBufferRect.height)) { + return nullptr; + } + return mWaylandBuffer; + } + + already_AddRefed WindowSurfaceWayland::LockWaylandBuffer() { +- // Allocated wayland buffer must match widget size, otherwise wayland +- // compositor is confused and may produce various rendering artifacts. +- mWidgetRect = mWindow->GetMozContainerSize(); ++ // Allocated wayland buffer can't be bigger than mozilla widget size. ++ LayoutDeviceIntRegion region; ++ region.And(mLockedScreenRect, mWindow->GetMozContainerSize()); ++ mWLBufferRect = LayoutDeviceIntRect(region.GetBounds()); + + // mCanSwitchWaylandBuffer set means we're getting buffer for fullscreen + // update. We can use DMABuf and we can get a new buffer for drawing. +@@ -882,8 +885,8 @@ already_AddRefed Window + LayoutDeviceIntRect size = mWindow->GetMozContainerSize(); + + // We can draw directly only when widget has the same size as wl_buffer +- mDrawToWaylandBufferDirectly = (size.width == mLockedScreenRect.width && +- size.height == mLockedScreenRect.height); ++ mDrawToWaylandBufferDirectly = (size.width >= mLockedScreenRect.width && ++ size.height >= mLockedScreenRect.height); + + // We can draw directly only when we redraw significant part of the window + // to avoid flickering. +diff -up firefox-74.0.1/widget/gtk/WindowSurfaceWayland.h.mozilla-1627469 firefox-74.0.1/widget/gtk/WindowSurfaceWayland.h +--- firefox-74.0.1/widget/gtk/WindowSurfaceWayland.h.mozilla-1627469 2020-04-06 15:07:16.773431931 +0200 ++++ firefox-74.0.1/widget/gtk/WindowSurfaceWayland.h 2020-04-06 15:07:16.775431919 +0200 +@@ -264,11 +264,11 @@ class WindowSurfaceWayland : public Wind + // mLockedScreenRect is window size when our wayland buffer was allocated. + LayoutDeviceIntRect mLockedScreenRect; + +- // WidgetRect is an actual size of mozcontainer widget. It can be +- // different than mLockedScreenRect during resize when mBounds are updated +- // immediately but actual GtkWidget size is updated asynchronously +- // (see Bug 1489463). +- LayoutDeviceIntRect mWidgetRect; ++ // mWLBufferRect is an intersection of mozcontainer widgetsize and ++ // mLockedScreenRect size. It can be different than mLockedScreenRect ++ // during resize when mBounds are updated immediately but actual ++ // GtkWidget size is updated asynchronously (see Bug 1489463). ++ LayoutDeviceIntRect mWLBufferRect; + nsWaylandDisplay* mWaylandDisplay; + + // Actual buffer (backed by wl_buffer) where all drawings go into. -- cgit