Client: get correct window content geometry
Window content geometry should not include invisible portions of the decorations, like shadows. This is stated in xdg-shell specificification and in the description for this method. Change-Id: I444fe9e28f0f175d2051be5c704efa7658bd45fb Reviewed-by: David Edmundson <davidedmundson@kde.org>
This commit is contained in:
parent
e101ffce1d
commit
a02c408afc
@ -369,7 +369,7 @@ void QWaylandWindow::setGeometry(const QRect &rect)
|
|||||||
sendExposeEvent(exposeGeometry);
|
sendExposeEvent(exposeGeometry);
|
||||||
|
|
||||||
if (mShellSurface && isExposed())
|
if (mShellSurface && isExposed())
|
||||||
mShellSurface->setWindowGeometry(windowContentGeometry());
|
mShellSurface->setWindowGeometry(QRect(QPoint(), surfaceSize()));
|
||||||
|
|
||||||
if (isOpaque() && mMask.isEmpty())
|
if (isOpaque() && mMask.isEmpty())
|
||||||
setOpaqueArea(rect);
|
setOpaqueArea(rect);
|
||||||
@ -697,7 +697,12 @@ QSize QWaylandWindow::surfaceSize() const
|
|||||||
*/
|
*/
|
||||||
QRect QWaylandWindow::windowContentGeometry() const
|
QRect QWaylandWindow::windowContentGeometry() const
|
||||||
{
|
{
|
||||||
return QRect(QPoint(), surfaceSize());
|
QMargins shadowMargins;
|
||||||
|
|
||||||
|
if (mWindowDecoration)
|
||||||
|
shadowMargins = mWindowDecoration->margins(QWaylandAbstractDecoration::ShadowsOnly);
|
||||||
|
|
||||||
|
return QRect(QPoint(shadowMargins.left(), shadowMargins.right()), surfaceSize().shrunkBy(shadowMargins));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
Loading…
x
Reference in New Issue
Block a user