From f1f19846f0f229af33ac16bd4e5191587d7c6bc0 Mon Sep 17 00:00:00 2001 From: Jan Horak Date: Thu, 19 Sep 2019 09:28:28 +0000 Subject: [PATCH] Bug 1581773 - Fix disappearing bookmark edit panel when choosing folder under Wayland; r=stransky Differential Revision: https://phabricator.services.mozilla.com/D46440 --HG-- extra : moz-landing-system : lando --- widget/gtk/nsWindow.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp index 1fc5617633e1..b44e4320f1b9 100644 --- a/widget/gtk/nsWindow.cpp +++ b/widget/gtk/nsWindow.cpp @@ -1163,16 +1163,25 @@ 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"))) { + if (popupId && + popupId->Equals(NS_LITERAL_STRING("editBMPanel_tagsAutocomplete"))) { + return true; + } + + nsIFrame* parentFrame = aMenuPopupFrame->GetParent(); + if (!parentFrame) { + return false; + } + + // Check if the popup is in the folder menu list + nsAtom* parentId = parentFrame->GetContent()->GetID(); + if (parentId && + parentId->Equals(NS_LITERAL_STRING("editBMPanel_folderMenuList"))) { 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")) {