Fix repainting of Shadows for torn-off toolbars
Toolbars and Dock Widgets are clients which did not yet have proper Shadow support. Especially the visibleRect and decorationRect which is incorrectly used to refer to the complete window geometry had to be updated.
This commit is contained in:
parent
026dd17d88
commit
2d066a710c
2 changed files with 14 additions and 6 deletions
12
client.cpp
12
client.cpp
|
@ -44,6 +44,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#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"
|
||||
|
|
8
client.h
8
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)
|
||||
|
|
Loading…
Reference in a new issue