Move XdgSurfaceClient::updateDepth to WaylandClient

It is strictly related to the surface and this way it can be used from
elsewhere.
This commit is contained in:
Aleix Pol 2020-07-29 18:39:47 +02:00 committed by Aleix Pol Gonzalez
parent 2e8f4964ec
commit 2ed00e4afe
4 changed files with 11 additions and 10 deletions

View file

@ -14,6 +14,7 @@
#include <KWaylandServer/display.h>
#include <KWaylandServer/clientconnection.h>
#include <KWaylandServer/surface_interface.h>
#include <KWaylandServer/buffer_interface.h>
#include <QFileInfo>
@ -273,4 +274,13 @@ void WaylandClient::doSetActive()
}
}
void WaylandClient::updateDepth()
{
if (surface()->buffer()->hasAlphaChannel() && !isDesktop()) {
setDepth(32);
} else {
setDepth(24);
}
}
} // namespace KWin

View file

@ -37,6 +37,7 @@ public:
void killWindow() override;
QByteArray windowRole() const override;
void updateDepth();
void setCaption(const QString &caption);
protected:

View file

@ -483,15 +483,6 @@ void XdgSurfaceClient::updateGeometryRestoreHack()
}
}
void XdgSurfaceClient::updateDepth()
{
if (surface()->buffer()->hasAlphaChannel() && !isDesktop()) {
setDepth(32);
} else {
setDepth(24);
}
}
QRect XdgSurfaceClient::frameRectToBufferRect(const QRect &rect) const
{
const int left = rect.left() + borderLeft() - m_windowGeometry.left();

View file

@ -99,7 +99,6 @@ private:
void resetHaveNextWindowGeometry();
QRect adjustMoveResizeGeometry(const QRect &rect) const;
void updateGeometryRestoreHack();
void updateDepth();
void internalShow();
void internalHide();
void cleanGrouping();