Added fix for WebRTC indicator - mozilla#1705048

This commit is contained in:
Martin Stransky 2021-05-04 15:49:34 +02:00
parent 63a2618a07
commit c213080431
6 changed files with 85 additions and 10 deletions

View File

@ -146,7 +146,7 @@ ExcludeArch: s390x
Summary: Mozilla Firefox Web browser Summary: Mozilla Firefox Web browser
Name: firefox Name: firefox
Version: 88.0 Version: 88.0
Release: 7%{?pre_tag}%{?dist} Release: 8%{?pre_tag}%{?dist}
URL: https://www.mozilla.org/firefox/ URL: https://www.mozilla.org/firefox/
License: MPLv1.1 or GPLv2+ or LGPLv2+ 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 Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz
@ -231,6 +231,7 @@ Patch418: mozilla-1703657.patch
Patch419: mozilla-1703763.patch Patch419: mozilla-1703763.patch
Patch420: mochitest-wayland-workaround.patch Patch420: mochitest-wayland-workaround.patch
Patch421: mozilla-1580595.patch Patch421: mozilla-1580595.patch
Patch422: mozilla-1705048.patch
# PGO/LTO patches # PGO/LTO patches
Patch600: pgo.patch Patch600: pgo.patch
@ -472,6 +473,7 @@ This package contains results of tests executed during build.
%patch419 -p1 -b .1703763 %patch419 -p1 -b .1703763
%patch420 -p1 -b .mochitest-wayland-workaround %patch420 -p1 -b .mochitest-wayland-workaround
%patch421 -p1 -b .1580595 %patch421 -p1 -b .1580595
%patch422 -p1 -b .1705048
# PGO patches # PGO patches
%if %{build_with_pgo} %if %{build_with_pgo}
@ -1027,6 +1029,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
#--------------------------------------------------------------------- #---------------------------------------------------------------------
%changelog %changelog
* Tue May 4 2021 Martin Stransky <stransky@redhat.com> - 88.0-8
- Added fix for mozbz#1705048.
* Fri Apr 30 2021 Martin Stransky <stransky@redhat.com> - 88.0-7 * Fri Apr 30 2021 Martin Stransky <stransky@redhat.com> - 88.0-7
- Added pciutils-libs req (rhbz#1955338) - Added pciutils-libs req (rhbz#1955338)
- Enabled Wayland on KDE (rhbz#1922608) - Enabled Wayland on KDE (rhbz#1922608)

70
mozilla-1705048.patch Normal file
View File

@ -0,0 +1,70 @@
diff -up firefox-88.0/widget/gtk/nsWindow.cpp.1705048 firefox-88.0/widget/gtk/nsWindow.cpp
--- firefox-88.0/widget/gtk/nsWindow.cpp.1705048 2021-05-04 15:43:16.039586526 +0200
+++ firefox-88.0/widget/gtk/nsWindow.cpp 2021-05-04 15:47:26.358614462 +0200
@@ -553,6 +553,7 @@ nsWindow::nsWindow() {
mTitlebarBackdropState = false;
mHasAlphaVisual = false;
+ mIsWaylandPanelWindow = false;
mIsPIPWindow = false;
mAlwaysOnTop = false;
@@ -3713,7 +3714,7 @@ void nsWindow::OnButtonPressEvent(GdkEve
LayoutDeviceIntPoint refPoint =
GdkEventCoordsToDevicePixels(aEvent->x, aEvent->y);
- if (mDraggableRegion.Contains(refPoint.x, refPoint.y) &&
+ if ((mIsWaylandPanelWindow || mDraggableRegion.Contains(refPoint.x, refPoint.y)) &&
domButton == MouseButton::ePrimary &&
eventStatus != nsEventStatus_eConsumeNoDefault) {
mWindowShouldStartDragging = true;
@@ -4614,8 +4615,9 @@ nsresult nsWindow::Create(nsIWidget* aPa
// as a workaround.
mWindowType = eWindowType_toplevel;
} else if (mWindowType == eWindowType_popup && !aNativeParent && !aParent) {
- // Workaround for Wayland where the popup windows always need to have
- // parent window. For example webrtc ui is a popup window without parent.
+ // mIsWaylandPanelWindow is a special toplevel window on Wayland which
+ // emulates X11 popup window without parent.
+ mIsWaylandPanelWindow = true;
mWindowType = eWindowType_toplevel;
}
}
@@ -4642,8 +4644,10 @@ nsresult nsWindow::Create(nsIWidget* aPa
// popup window position.
GtkWindowType type = GTK_WINDOW_TOPLEVEL;
if (mWindowType == eWindowType_popup) {
- type = (mIsX11Display && aInitData->mNoAutoHide) ? GTK_WINDOW_TOPLEVEL
- : GTK_WINDOW_POPUP;
+ type = GTK_WINDOW_POPUP;
+ if (GdkIsX11Display() && aInitData->mNoAutoHide) {
+ type = GTK_WINDOW_TOPLEVEL;
+ }
}
mShell = gtk_window_new(type);
@@ -4890,6 +4894,10 @@ nsresult nsWindow::Create(nsIWidget* aPa
}
#endif
+ if (mIsWaylandPanelWindow) {
+ gtk_window_set_decorated(GTK_WINDOW(mShell), false);
+ }
+
if (mWindowType == eWindowType_popup) {
// gdk does not automatically set the cursor for "temporary"
// windows, which are what gtk uses for popups.
diff -up firefox-88.0/widget/gtk/nsWindow.h.1705048 firefox-88.0/widget/gtk/nsWindow.h
--- firefox-88.0/widget/gtk/nsWindow.h.1705048 2021-05-04 15:43:16.041586502 +0200
+++ firefox-88.0/widget/gtk/nsWindow.h 2021-05-04 15:45:01.703331956 +0200
@@ -591,6 +591,10 @@ class nsWindow final : public nsBaseWidg
LayoutDeviceIntRegion mDraggableRegion;
// It's PictureInPicture window.
bool mIsPIPWindow;
+ // It's undecorated popup utility window, without resizers/titlebar,
+ // movable by mouse. Used on Wayland as a workaround for popups without
+ // parent (for instance WebRTC sharing indicator).
+ bool mIsWaylandPanelWindow;
bool mAlwaysOnTop;
#ifdef ACCESSIBILITY

View File

@ -4,6 +4,6 @@
TEST_DIR=$1 TEST_DIR=$1
TEST_FLAVOUR=$2 TEST_FLAVOUR=$2
#grep "TEST-UNEXPECTED-FAIL" $TEST_DIR/mochitest$TEST_FLAVOUR 2>&1 > failures-mochitest$TEST_FLAVOUR.txt grep "TEST-UNEXPECTED-FAIL" $TEST_DIR/mochitest$TEST_FLAVOUR 2>&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 " 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 grep --text -e "REFTEST TEST-UNEXPECTED-PASS" -e "REFTEST TEST-UNEXPECTED-FAIL" $TEST_DIR/reftest$TEST_FLAVOUR 2>&1 > failures-reftest$TEST_FLAVOUR.txt

View File

@ -3,7 +3,7 @@
export TEST_DIR="test_results" export TEST_DIR="test_results"
./print-errors $TEST_DIR "" #./print-errors $TEST_DIR ""
./print-errors $TEST_DIR "-wr" ./print-errors $TEST_DIR "-wr"
./print-error-reftest $TEST_DIR "" #./print-error-reftest $TEST_DIR ""
./print-error-reftest $TEST_DIR "-wr" ./print-error-reftest $TEST_DIR "-wr"

View File

@ -4,7 +4,7 @@
export TEST_DIR="test_results" export TEST_DIR="test_results"
echo "Test results" echo "Test results"
echo "Basic compositor" #echo "Basic compositor"
./psummary $TEST_DIR "" #./psummary $TEST_DIR ""
echo "WebRender" echo "WebRender"
./psummary $TEST_DIR "-wr" ./psummary $TEST_DIR "-wr"

View File

@ -4,10 +4,10 @@
TEST_DIR=$1 TEST_DIR=$1
TEST_FLAVOUR=$2 TEST_FLAVOUR=$2
#MPASS=`grep "TEST_END: Test OK" $TEST_DIR/mochitest$TEST_FLAVOUR | wc -l` 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` 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` MUNEX=`grep "TEST-UNEXPECTED-FAIL" $TEST_DIR/mochitest$TEST_FLAVOUR | wc -l`
#echo "Mochitest PASSED: $MPASS FAILED: $MERR UNEXPECTED-FAILURES: $MUNEX" echo "Mochitest PASSED: $MPASS FAILED: $MERR UNEXPECTED-FAILURES: $MUNEX"
XPCPASS=`grep --text "Expected results:" $TEST_DIR/xpcshell$TEST_FLAVOUR | cut -d ' ' -f 3` 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` XPCFAIL=`grep --text "Unexpected results:" $TEST_DIR/xpcshell$TEST_FLAVOUR | cut -d ' ' -f 3`