wayland: Initialize Window::depth to 32

Window::depth and Window::hasAlpha make no sense on Wayland. The main
reason why we can't rid of them completely yet are X11Window and
Unmanaged.

This change makes WaylandWindow initialize depth to 32 by default to
make wayland window subclasses less boilerplaty.
This commit is contained in:
Vlad Zahorodnii 2023-03-04 14:45:32 +02:00
parent 3b12058135
commit db55a6f909
5 changed files with 1 additions and 13 deletions

View file

@ -182,7 +182,6 @@ void InputPanelV1Window::moveResizeInternal(const QRectF &rect, MoveResizeMode m
void InputPanelV1Window::handleMapped()
{
updateDepth();
maybeShow();
}

View file

@ -250,7 +250,6 @@ void LayerShellV1Window::handleUnmapped()
void LayerShellV1Window::handleCommitted()
{
if (surface()->buffer()) {
updateDepth();
setReadyForPainting();
}
}

View file

@ -37,6 +37,7 @@ Q_DECLARE_FLAGS(WaylandGeometryTypes, WaylandGeometryType)
WaylandWindow::WaylandWindow(SurfaceInterface *surface)
{
setSurface(surface);
setDepth(32);
setupCompositing();
connect(surface, &SurfaceInterface::shadowChanged,
@ -220,15 +221,6 @@ void WaylandWindow::doSetActive()
}
}
void WaylandWindow::updateDepth()
{
if (surface()->buffer()->hasAlphaChannel()) {
setDepth(32);
} else {
setDepth(24);
}
}
void WaylandWindow::cleanGrouping()
{
if (transientFor()) {

View file

@ -36,7 +36,6 @@ public:
virtual QRectF frameRectToBufferRect(const QRectF &rect) const;
bool isHidden() const;
void updateDepth();
void setCaption(const QString &caption);
protected:

View file

@ -175,7 +175,6 @@ void XdgSurfaceWindow::handleCommit()
m_lastAcknowledgedConfigureSerial.reset();
setReadyForPainting();
updateDepth();
}
void XdgSurfaceWindow::handleRolePrecommit()