summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Edmundson <davidedmundson@kde.org>2025-10-01 10:37:05 +0100
committerDavid Edmundson <davidedmundson@kde.org>2025-10-01 16:47:50 +0100
commit5a8637e4516bc48a0b3f4b5ec3b18618b92e7222 (patch)
tree9a5ace8aba112f67738d7b53bb290b771257800b
parentdb3b8e36c9084ddaba6ae6ecc36dbcc846c4c649 (diff)
wayland: Fix opaque backgrounds on client side decorationsv6.10.06.10.0
QWaylandSHMWindow needs to react to decorations being created to adjust the surface format. Rather than guessing when the decoration is created based on the window flags changing, introduce an explicit hook on the main window class. Ammends 12e55c95b23c766f9b968597fcf651173e78944c. Fixes: QTBUG-136110 Pick-to: dev 6.10 Change-Id: If8009444801bc92ebdf8a8ecb1cf9fbadb549532 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Liang Qi <liang.qi@qt.io>
-rw-r--r--src/plugins/platforms/wayland/qwaylandshmwindow.cpp6
-rw-r--r--src/plugins/platforms/wayland/qwaylandshmwindow_p.h2
-rw-r--r--src/plugins/platforms/wayland/qwaylandwindow_p.h2
3 files changed, 6 insertions, 4 deletions
diff --git a/src/plugins/platforms/wayland/qwaylandshmwindow.cpp b/src/plugins/platforms/wayland/qwaylandshmwindow.cpp
index 10c90d1c157..c102ae11336 100644
--- a/src/plugins/platforms/wayland/qwaylandshmwindow.cpp
+++ b/src/plugins/platforms/wayland/qwaylandshmwindow.cpp
@@ -31,13 +31,15 @@ QWaylandWindow::WindowType QWaylandShmWindow::windowType() const
return QWaylandWindow::Shm;
}
-void QWaylandShmWindow::setWindowFlags(Qt::WindowFlags flags)
+bool QWaylandShmWindow::createDecoration()
{
- QWaylandWindow::setWindowFlags(flags);
+ bool rc = QWaylandWindow::createDecoration();
const QSurfaceFormat format = window()->requestedFormat();
if (!format.hasAlpha())
mSurfaceFormat.setAlphaBufferSize(mWindowDecorationEnabled ? 8 : 0);
+
+ return rc;
}
}
diff --git a/src/plugins/platforms/wayland/qwaylandshmwindow_p.h b/src/plugins/platforms/wayland/qwaylandshmwindow_p.h
index dab9e1e5350..36c8ff45022 100644
--- a/src/plugins/platforms/wayland/qwaylandshmwindow_p.h
+++ b/src/plugins/platforms/wayland/qwaylandshmwindow_p.h
@@ -30,7 +30,7 @@ public:
WindowType windowType() const override;
- void setWindowFlags(Qt::WindowFlags flags) override;
+ bool createDecoration() override;
};
}
diff --git a/src/plugins/platforms/wayland/qwaylandwindow_p.h b/src/plugins/platforms/wayland/qwaylandwindow_p.h
index a8451bd9995..9d3dc9c6e05 100644
--- a/src/plugins/platforms/wayland/qwaylandwindow_p.h
+++ b/src/plugins/platforms/wayland/qwaylandwindow_p.h
@@ -190,7 +190,7 @@ public:
const QPointF &global, Qt::MouseButtons buttons,
Qt::KeyboardModifiers modifiers);
- bool createDecoration();
+ virtual bool createDecoration();
#if QT_CONFIG(cursor)
void restoreMouseCursor(QWaylandInputDevice *device);