diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-01-28 18:00:20 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-02-14 14:45:41 +0100 |
commit | 115e39f9be99069dcb96579064e78b9a8f5468fc (patch) | |
tree | ada15b59a71763a7ce20ca264fe2115e54b01074 /src/plugins | |
parent | b26b40f7e1f67dd3de1c81bd022aa202b5b5cad5 (diff) |
Avoid return QImage::Format_Invalid from QPlatformScreen::format()
This can be used to set the pixmap format, and needs to be defined to
something sane even if there is no primary screen.
Task-number: QTBUG-81671
Change-Id: Ic0d41cec31ac71309123aa8bb8b840fa4a4122bb
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbscreen.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp index e937464c62..87e1c9bdf8 100644 --- a/src/plugins/platforms/xcb/qxcbscreen.cpp +++ b/src/plugins/platforms/xcb/qxcbscreen.cpp @@ -665,7 +665,9 @@ QImage::Format QXcbScreen::format() const bool needsRgbSwap; qt_xcb_imageFormatForVisual(connection(), screen()->root_depth, visualForId(screen()->root_visual), &format, &needsRgbSwap); // We are ignoring needsRgbSwap here and just assumes the backing-store will handle it. - return format; + if (format != QImage::Format_Invalid) + return format; + return QImage::Format_RGB32; } int QXcbScreen::forcedDpi() const |