Backed out changeset 09ccf334001b (bug 1592416) for causing bug 1640077 to fail.

This commit is contained in:
Butkovits Atila 2020-05-22 09:37:16 +03:00
parent 2863da4ad0
commit 8a87d1b582
4 changed files with 2 additions and 29 deletions

View File

@ -245,8 +245,8 @@ nsPopupLevel nsMenuPopupFrame::PopupLevel(bool aIsNoAutoHide) const {
void nsMenuPopupFrame::EnsureWidget(bool aRecreate) {
nsView* ourView = GetView();
if (aRecreate) {
auto* widget = GetWidget();
if (aRecreate || (widget && widget->NeedsRecreateToReshow())) {
if (widget) {
// Widget's WebRender resources needs to be cleared before creating new
// widget.

View File

@ -226,8 +226,6 @@ class nsCocoaWindow final : public nsBaseWidget, public nsPIWidgetCocoa {
virtual void Destroy() override;
virtual void Show(bool aState) override;
virtual bool NeedsRecreateToReshow() override;
virtual nsIWidget* GetSheetWindowParent(void) override;
virtual void Enable(bool aState) override;
virtual bool IsEnabled() const override;

View File

@ -487,14 +487,6 @@ nsresult nsCocoaWindow::CreateNativeWindow(const NSRect& aRect, nsBorderStyle aB
SetPopupWindowLevel();
[mWindow setBackgroundColor:[NSColor clearColor]];
[mWindow setOpaque:NO];
// When multiple spaces are in use and the browser is assigned to a
// particular space, override the "Assign To" space and display popups on
// the active space. Does not work with multiple displays. See
// NeedsRecreateToReshow() for multi-display with multi-space workaround.
NSWindowCollectionBehavior behavior = [mWindow collectionBehavior];
behavior |= NSWindowCollectionBehaviorMoveToActiveSpace;
[mWindow setCollectionBehavior:behavior];
} else {
// Make sure that regular windows are opaque from the start, so that
// nsChildView::WidgetTypeSupportsAcceleration returns true for them.
@ -965,17 +957,6 @@ void nsCocoaWindow::Show(bool bState) {
NS_OBJC_END_TRY_ABORT_BLOCK;
}
// Work around a problem where with multiple displays and multiple spaces
// enabled, where the browser is assigned to a single display or space, popup
// windows that are reshown after being hidden with [NSWindow orderOut] show on
// the assigned space even when opened from another display. Apply the
// workaround whenever more than one display is enabled.
bool nsCocoaWindow::NeedsRecreateToReshow() {
// Limit the workaround to popup windows because only they need to override
// the "Assign To" setting. i.e., to display where the parent window is.
return (mWindowType == eWindowType_popup) && ([[NSScreen screens] count] > 1);
}
struct ShadowParams {
float standardDeviation;
float density;

View File

@ -647,12 +647,6 @@ class nsIWidget : public nsISupports {
*/
virtual void Show(bool aState) = 0;
/**
* Whether or not a widget must be recreated after being hidden to show
* again properly.
*/
virtual bool NeedsRecreateToReshow() { return false; }
/**
* Make the window modal.
*/