Commit 79f4168f authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

Compute correct visible rect for client-side decorated clients

Frame and buffer geometry don't have strict order. Either one of them can
be inside the other one, so we must take that into account when computing
visible bounds of the client including drop-shadows. We also have to take
sub-surfaces into account when determining the visible rect, however it's
out of scope for this patch.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Maniphest Tasks: T10867

Differential Revision:
parent 85777aaa
......@@ -145,11 +145,14 @@ void Toplevel::disownDataPassedToDeleted()
QRect Toplevel::visibleRect() const
QRect r = decorationRect();
// There's no strict order between frame geometry and buffer geometry.
QRect rect = frameGeometry() | bufferGeometry();
if (shadow() && !shadow()->shadowRegion().isEmpty()) {
r |= shadow()->shadowRegion().boundingRect();
rect |= shadow()->shadowRegion().boundingRect().translated(pos());
return r.translated(frameGeometry().topLeft());
return rect;
Xcb::Property Toplevel::fetchWmClientLeader() const
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment