summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@digia.com>2015-03-31 09:17:39 +0200
committerAndy Shaw <andy.shaw@digia.com>2015-03-31 11:42:08 +0000
commitd64f776a9a41a8d1144397b7b62efbdee8d24857 (patch)
tree8e26d4443e5b670678fb17f7656d34607bf5e275 /src
parent9ea80826581b3ce8081567823e2377b8590917b8 (diff)
Windows: Fallback to 0 samples if ARB::choosePixelFormat() fails with 1
This solves a problem when using a Qt application over remote desktop as if it failed with even 1 sample then it would fallback to GDI which causes an error if the software OpenGL option is used. Change-Id: Ib311a7a657f92aab15277461bc8e040bebbe4753 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/windows/qwindowsglcontext.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/plugins/platforms/windows/qwindowsglcontext.cpp b/src/plugins/platforms/windows/qwindowsglcontext.cpp
index 3348241d37..908bc65843 100644
--- a/src/plugins/platforms/windows/qwindowsglcontext.cpp
+++ b/src/plugins/platforms/windows/qwindowsglcontext.cpp
@@ -597,6 +597,14 @@ static int choosePixelFormat(HDC hdc,
break;
if (iAttributes[samplesValuePosition] > 1) {
iAttributes[samplesValuePosition] /= 2;
+ } else if (iAttributes[samplesValuePosition] == 1) {
+ // Fallback in case it is unable to initialize with any
+ // samples to avoid falling back to the GDI path
+ // NB: The sample attributes needs to be at the end for this
+ // to work correctly
+ iAttributes[samplesValuePosition - 1] = FALSE;
+ iAttributes[samplesValuePosition] = 0;
+ iAttributes[samplesValuePosition + 1] = 0;
} else {
break;
}