Bug 1772432 - Remove nsWidgetInitData::mMouseTransparent. r=stransky

Instead, have the menu popup frame call SetWindowMouseTransparent (since
it needs to anyways to deal with dynamic changes).

Differential Revision: https://phabricator.services.mozilla.com/D148211
This commit is contained in:
Emilio Cobos Álvarez 2022-06-03 09:41:39 +00:00
Родитель b44d1c0376
Коммит 2bd192dbd0
5 изменённых файлов: 1 добавлений и 13 удалений

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

@ -333,8 +333,6 @@ nsresult nsMenuPopupFrame::CreateWidgetForView(nsView* aView) {
nsGkAtoms::drag, eIgnoreCase)) {
widgetData.mIsDragPopup = true;
}
widgetData.mMouseTransparent = IsMouseTransparent();
}
nsAutoString title;
@ -395,6 +393,7 @@ nsresult nsMenuPopupFrame::CreateWidgetForView(nsView* aView) {
nsIWidget* widget = aView->GetWidget();
widget->SetTransparencyMode(mode);
widget->SetWindowMouseTransparent(IsMouseTransparent());
widget->SetWindowShadowStyle(GetShadowStyle());
widget->SetWindowOpacity(StyleUIReset()->mWindowOpacity);
widget->SetWindowTransform(ComputeWidgetTransform());

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

@ -348,7 +348,6 @@ nsresult nsCocoaWindow::Create(nsIWidget* aParent, nsNativeWidget aNativeParent,
NS_ENSURE_SUCCESS(rv, rv);
if (mWindowType == eWindowType_popup) {
SetWindowMouseTransparent(aInitData->mMouseTransparent);
// now we can convert widgetRect to device pixels for the window we created,
// as the child view expects a rect expressed in the dev pix of its parent
LayoutDeviceIntRect devRect = RoundedToInt(newBounds * GetDesktopToDeviceScale());

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

@ -5511,7 +5511,6 @@ nsresult nsWindow::Create(nsIWidget* aParent, nsNativeWidget aNativeParent,
// and can be changed so we use WaylandPopupIsPermanent() to get
// recent popup config (Bug 1728952).
mNoAutoHide = aInitData && aInitData->mNoAutoHide;
mMouseTransparent = aInitData && aInitData->mMouseTransparent;
// Popups that are not noautohide are only temporary. The are used
// for menus and the like and disappear when another window is used.

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

@ -105,9 +105,6 @@ struct nsWidgetInitData {
bool mIsAnimationSuppressed = false;
// true if the window should support an alpha channel, if available.
bool mSupportTranslucency = false;
// true if the window should be transparent to mouse events. Currently this is
// only valid for eWindowType_popup widgets
bool mMouseTransparent = false;
bool mHasRemoteContent = false;
bool mAlwaysOnTop = false;
// Is PictureInPicture window

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

@ -971,12 +971,6 @@ nsresult nsWindow::Create(nsIWidget* aParent, nsNativeWidget aNativeParent,
ShouldUseOffMainThreadCompositing()) {
extendedStyle |= WS_EX_COMPOSITED;
}
if (aInitData->mMouseTransparent) {
// This flag makes the window transparent to mouse events
mMouseTransparent = true;
extendedStyle |= WS_EX_TRANSPARENT;
}
} else if (mWindowType == eWindowType_invisible) {
// Make sure CreateWindowEx succeeds at creating a toplevel window
style &= ~0x40000000; // WS_CHILDWINDOW