diff options
author | Peter Varga <pvarga@inf.u-szeged.hu> | 2022-10-19 17:13:27 +0200 |
---|---|---|
committer | Peter Varga <pvarga@inf.u-szeged.hu> | 2022-10-21 19:11:51 +0200 |
commit | 600752aa972d1e46792e18f1ec6dd0b519722e65 (patch) | |
tree | 3c43fb40b6f1f1053bd55704c8b686b8ef6ab200 /src/widgets/kernel/qwidget.cpp | |
parent | 2c8cf8eb42749f6999cc10169c188f9df23738f5 (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.
Pick-to: 6.4
Fixes: QTBUG-107629
Change-Id: Ia6a1b90fba6c43b6872b406f4fd946d937135cf8
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/widgets/kernel/qwidget.cpp')
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index bcbf10b95d..807c16875d 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. // |