diff --git a/client.cpp b/client.cpp index 98f3290cf3..31eaa442bc 100644 --- a/client.cpp +++ b/client.cpp @@ -44,6 +44,7 @@ along with this program. If not, see . #include "notifications.h" #include "rules.h" #include "scene.h" +#include "shadow.h" #include "deleted.h" #include "paintredirector.h" #include "tabbox.h" @@ -2239,6 +2240,17 @@ void Client::setSessionInteract(bool needed) needsSessionInteract = needed; } +QRect Client::decorationRect() const +{ + if (decoration && decoration->widget()) { + return decoration->widget()->rect().translated(-padding_left, -padding_top); + } else if (hasShadow()) { + return shadow()->shadowRegion().boundingRect(); + } else { + return QRect(0, 0, width(), height()); + } +} + } // namespace #include "client.moc" diff --git a/client.h b/client.h index 5dd47027fd..77bbe0f376 100644 --- a/client.h +++ b/client.h @@ -401,11 +401,7 @@ public: bool decorationPixmapRequiresRepaint(); void ensureDecorationPixmapsPainted(); - QRect decorationRect() const { - return (decoration && decoration->widget()) ? - decoration->widget()->rect().translated(-padding_left, -padding_top) : - QRect(0, 0, width(), height()); - } + QRect decorationRect() const; QRect transparentRect() const; @@ -967,7 +963,7 @@ inline QSize Client::clientSize() const inline QRect Client::visibleRect() const { - return geometry().adjusted(-padding_left, -padding_top, padding_right, padding_bottom); + return Toplevel::visibleRect().adjusted(-padding_left, -padding_top, padding_right, padding_bottom); } inline void Client::setGeometry(const QRect& r, ForceGeometry_t force, bool emitJs)