Bug 1866669 [Linux/X11] Apply shape mask to parent window (mShell) for non-compositing desktops r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D194868
This commit is contained in:
stransky 2023-11-29 12:08:45 +00:00
Родитель ff8cc581ed
Коммит b261dd7d56
2 изменённых файлов: 20 добавлений и 1 удалений

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

@ -35,7 +35,21 @@ WindowSurfaceX11Image::WindowSurfaceX11Image(Display* aDisplay, Window aWindow,
mTransparencyBitmap(nullptr), mTransparencyBitmap(nullptr),
mTransparencyBitmapWidth(0), mTransparencyBitmapWidth(0),
mTransparencyBitmapHeight(0), mTransparencyBitmapHeight(0),
mIsShaped(aIsShaped) {} mIsShaped(aIsShaped),
mWindowParent(0) {
if (!mIsShaped) {
return;
}
Window root, *children = nullptr;
unsigned int childrenNum;
if (XQueryTree(mDisplay, mWindow, &root, &mWindowParent, &children,
&childrenNum)) {
if (children) {
XFree((char*)children);
}
}
}
WindowSurfaceX11Image::~WindowSurfaceX11Image() { WindowSurfaceX11Image::~WindowSurfaceX11Image() {
if (mTransparencyBitmap) { if (mTransparencyBitmap) {
@ -206,6 +220,10 @@ void WindowSurfaceX11Image::ApplyTransparencyBitmap() {
mTransparencyBitmapHeight); mTransparencyBitmapHeight);
XShapeCombineMask(xDisplay, xDrawable, ShapeBounding, 0, 0, maskPixmap, XShapeCombineMask(xDisplay, xDrawable, ShapeBounding, 0, 0, maskPixmap,
ShapeSet); ShapeSet);
if (mWindowParent) {
XShapeCombineMask(mDisplay, mWindowParent, ShapeBounding, 0, 0,
maskPixmap, ShapeSet);
}
XFreePixmap(xDisplay, maskPixmap); XFreePixmap(xDisplay, maskPixmap);
} }
} }

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

@ -39,6 +39,7 @@ class WindowSurfaceX11Image : public WindowSurfaceX11 {
int32_t mTransparencyBitmapWidth; int32_t mTransparencyBitmapWidth;
int32_t mTransparencyBitmapHeight; int32_t mTransparencyBitmapHeight;
bool mIsShaped; bool mIsShaped;
Window mWindowParent;
}; };
} // namespace widget } // namespace widget