Skip to content

Commit

Permalink
Bug 1866669 [Linux/X11] Apply shape mask to parent window (mShell) fo…
Browse files Browse the repository at this point in the history
…r non-compositing desktops r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D194868
  • Loading branch information
stransky committed Nov 29, 2023
1 parent ff8cc58 commit b261dd7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
20 changes: 19 additions & 1 deletion widget/gtk/WindowSurfaceX11Image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,21 @@ WindowSurfaceX11Image::WindowSurfaceX11Image(Display* aDisplay, Window aWindow,
mTransparencyBitmap(nullptr),
mTransparencyBitmapWidth(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() {
if (mTransparencyBitmap) {
Expand Down Expand Up @@ -206,6 +220,10 @@ void WindowSurfaceX11Image::ApplyTransparencyBitmap() {
mTransparencyBitmapHeight);
XShapeCombineMask(xDisplay, xDrawable, ShapeBounding, 0, 0, maskPixmap,
ShapeSet);
if (mWindowParent) {
XShapeCombineMask(mDisplay, mWindowParent, ShapeBounding, 0, 0,
maskPixmap, ShapeSet);
}
XFreePixmap(xDisplay, maskPixmap);
}
}
Expand Down
1 change: 1 addition & 0 deletions widget/gtk/WindowSurfaceX11Image.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class WindowSurfaceX11Image : public WindowSurfaceX11 {
int32_t mTransparencyBitmapWidth;
int32_t mTransparencyBitmapHeight;
bool mIsShaped;
Window mWindowParent;
};

} // namespace widget
Expand Down

0 comments on commit b261dd7

Please sign in to comment.