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
Родитель 2863da4ad0
Коммит 8a87d1b582
4 изменённых файлов: 2 добавлений и 29 удалений

Просмотреть файл

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

Просмотреть файл

@ -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;

Просмотреть файл

@ -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;

Просмотреть файл

@ -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.
*/