Fix for disappearing webrtc popups
This commit is contained in:
parent
25a13aa0dc
commit
b686f27745
@ -152,6 +152,7 @@ Patch418: mozilla-1512162.patch
|
|||||||
Patch419: mozilla-1568569.patch
|
Patch419: mozilla-1568569.patch
|
||||||
Patch420: mozilla-1566876-webrtc-ind.patch
|
Patch420: mozilla-1566876-webrtc-ind.patch
|
||||||
Patch421: mozilla-1579023.patch
|
Patch421: mozilla-1579023.patch
|
||||||
|
Patch422: mozilla-1580174-webrtc-popup.patch
|
||||||
|
|
||||||
# Wayland specific upstream patches
|
# Wayland specific upstream patches
|
||||||
Patch574: firefox-pipewire.patch
|
Patch574: firefox-pipewire.patch
|
||||||
@ -382,6 +383,7 @@ This package contains results of tests executed during build.
|
|||||||
%patch583 -p1 -b .mozilla-1579794-1
|
%patch583 -p1 -b .mozilla-1579794-1
|
||||||
%patch584 -p1 -b .mozilla-1579794-2
|
%patch584 -p1 -b .mozilla-1579794-2
|
||||||
%patch585 -p1 -b .mozilla-1579849
|
%patch585 -p1 -b .mozilla-1579849
|
||||||
|
%patch422 -p1 -b .1580174-webrtc-popup
|
||||||
|
|
||||||
# PGO patches
|
# PGO patches
|
||||||
%patch600 -p1 -b .pgo
|
%patch600 -p1 -b .pgo
|
||||||
|
51
mozilla-1580174-webrtc-popup.patch
Normal file
51
mozilla-1580174-webrtc-popup.patch
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp
|
||||||
|
--- a/widget/gtk/nsWindow.cpp
|
||||||
|
+++ b/widget/gtk/nsWindow.cpp
|
||||||
|
@@ -1155,6 +1155,28 @@
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+bool IsPopupWithoutToplevelParent(nsMenuPopupFrame* aMenuPopupFrame) {
|
||||||
|
+ // Check if the popup is autocomplete (like tags autocomplete
|
||||||
|
+ // in the bookmark edit popup).
|
||||||
|
+ nsAtom* popupId = aMenuPopupFrame->GetContent()->GetID();
|
||||||
|
+ if (popupId && popupId->Equals(NS_LITERAL_STRING("PopupAutoComplete"))) {
|
||||||
|
+ return true;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ // Check if the popup is in popupnotificationcontent (like choosing capture
|
||||||
|
+ // device when starting webrtc session).
|
||||||
|
+ nsIFrame* parentFrame = aMenuPopupFrame->GetParent();
|
||||||
|
+ if (!parentFrame) {
|
||||||
|
+ return false;
|
||||||
|
+ }
|
||||||
|
+ parentFrame = parentFrame->GetParent();
|
||||||
|
+ if (parentFrame && parentFrame->GetContent()->NodeName().EqualsLiteral(
|
||||||
|
+ "popupnotificationcontent")) {
|
||||||
|
+ return true;
|
||||||
|
+ }
|
||||||
|
+ return false;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
// 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
|
||||||
|
@@ -1211,10 +1233,14 @@
|
||||||
|
LOG(("...[%p] GetParentMenuWidget() = %p\n", (void*)this, parentWindow));
|
||||||
|
|
||||||
|
// If the popup is a regular menu but GetParentMenuWidget() returns
|
||||||
|
- // nullptr which means it's connected non-menu parent
|
||||||
|
- // (bookmark toolbar for instance).
|
||||||
|
+ // nullptr which means is not a submenu of any other menu.
|
||||||
|
// In this case use a parent given at nsWindow::Create().
|
||||||
|
- if (!parentWindow && !menuPopupFrame->IsContextMenu()) {
|
||||||
|
+ // But we have to avoid using mToplevelParentWindow in case the popup
|
||||||
|
+ // is in 'popupnotificationcontent' element or autocomplete popup,
|
||||||
|
+ // otherwise the popupnotification would disappear when for
|
||||||
|
+ // example opening a popup with microphone selection.
|
||||||
|
+ if (!parentWindow && !menuPopupFrame->IsContextMenu() &&
|
||||||
|
+ !IsPopupWithoutToplevelParent(menuPopupFrame)) {
|
||||||
|
parentWindow =
|
||||||
|
get_window_for_gtk_widget(GTK_WIDGET(mToplevelParentWindow));
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user