summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qwidget.cpp
diff options
context:
space:
mode:
authorPeter Varga <pvarga@inf.u-szeged.hu>2022-10-19 17:13:27 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-10-21 17:11:59 +0000
commit98fdf50c30e1c8525e1087aa88cca2c6188a9d40 (patch)
tree7ffa913178e011d33700de9bf0ebc691773a276a /src/widgets/kernel/qwidget.cpp
parent81252ea92ada20f97305278471c4fbb702213b9f (diff)
Set alphaBufferSize to -1 when disabling translucency in QtWidgets
-1 is the default value for QSurfaceFormat::alphaBufferSize. Changing it to 0 may result an unexpected pixel format change by ARB OpenGL extension. Fixes: QTBUG-107629 Change-Id: Ia6a1b90fba6c43b6872b406f4fd946d937135cf8 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit 600752aa972d1e46792e18f1ec6dd0b519722e65) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/widgets/kernel/qwidget.cpp')
-rw-r--r--src/widgets/kernel/qwidget.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 93e838d8b8..361e12887a 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -2201,7 +2201,7 @@ void QWidgetPrivate::updateIsTranslucent()
if (QWindow *window = q->windowHandle()) {
QSurfaceFormat format = window->format();
const int oldAlpha = format.alphaBufferSize();
- const int newAlpha = q->testAttribute(Qt::WA_TranslucentBackground)? 8 : 0;
+ const int newAlpha = q->testAttribute(Qt::WA_TranslucentBackground) ? 8 : -1;
if (oldAlpha != newAlpha) {
// QTBUG-85714: Do this only when the QWindow has not yet been create()'ed yet.
//