diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-01-27 16:36:10 +0100 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@theqtcompany.com> | 2015-02-02 10:26:37 +0000 |
commit | 8e0f56280ab6fd869faf1650edd454883f4d035f (patch) | |
tree | 1721bdabd5030b8c3d508c850592f54d51a1f8b5 /src/plugins/platforms/xcb/qxcbwindow.cpp | |
parent | 012a7ab91212db105fc43db9aa89b92d70052f1b (diff) |
Fix Qt over VNC with broken VisualInfo
It appears some VNC servers reports incorrect masks in their visuals.
This patch recognizes this unlikely set of masks and interprets it as
RGB16 which VNC expects.
Task-number: QTBUG-44147
Change-Id: Ia374edcd5f0a5ce0188157ac1d328f888cfa260c
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbwindow.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbwindow.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 4fd71f1635..00942787d9 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -215,6 +215,18 @@ static inline QImage::Format imageFormatForVisual(int depth, quint32 red_mask, q break; } qWarning("Unsupported screen format: depth: %d, red_mask: %x, blue_mask: %x", depth, red_mask, blue_mask); + + switch (depth) { + case 24: + qWarning("Using RGB32 fallback, if this works your X11 server is reporting a bad screen format."); + return QImage::Format_RGB32; + case 16: + qWarning("Using RGB16 fallback, if this works your X11 server is reporting a bad screen format."); + return QImage::Format_RGB16; + default: + break; + } + return QImage::Format_Invalid; } |