summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Kjernåsen <trond@trolltech.com>2009-04-23 09:44:57 (GMT)
committerTrond Kjernåsen <trond@trolltech.com>2009-04-23 09:47:42 (GMT)
commitd11cf4b8795a0f39e76432aa805f098388579d2d (patch)
treeb1ee67be4286f46da3210b29d6472225b47da7f5
parent389c4fdebe681eb3af5a2431c390323f52a03c17 (diff)
downloadQt-d11cf4b8795a0f39e76432aa805f098388579d2d.zip
Qt-d11cf4b8795a0f39e76432aa805f098388579d2d.tar.gz
Qt-d11cf4b8795a0f39e76432aa805f098388579d2d.tar.bz2
Disable MIT-SHM usage on BGR server layouts under X11.
Since the raster engine always assumes RGB layout in a QImage, we can't support this out of the box. Task-number: 248720 Reviewed-by: Samuel
-rw-r--r--src/gui/kernel/qapplication_x11.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp
index b1270bc..f1fb001 100644
--- a/src/gui/kernel/qapplication_x11.cpp
+++ b/src/gui/kernel/qapplication_x11.cpp
@@ -398,7 +398,7 @@ extern bool qt_xdnd_dragging;
// gui or non-gui from qapplication.cpp
extern bool qt_is_gui_used;
-/*!
+/*!
\internal
Try to resolve a \a symbol from \a library with the version specified
by \a vernum.
@@ -836,7 +836,7 @@ bool QApplicationPrivate::x11_apply_settings()
}
int kdeSessionVersion = QString::fromLocal8Bit(qgetenv("KDE_SESSION_VERSION")).toInt();
-
+
if (!appFont) {
QFont font(QApplication::font());
QString fontDescription;
@@ -1948,11 +1948,17 @@ void qt_init(QApplicationPrivate *priv, int,
{
QString displayName = QLatin1String(XDisplayName(NULL));
- // apparently MITSHM only works for local displays, so do a quick check here
- // to determine whether the display is local or not (not 100 % accurate)
+ // MITSHM only works for local displays, so do a quick check here
+ // to determine whether the display is local or not (not 100 % accurate).
+ // BGR server layouts are not supported either, since it requires the raster
+ // engine to work on a QImage with BGR layout.
bool local = displayName.isEmpty() || displayName.lastIndexOf(QLatin1Char(':')) == 0;
- if (local && (qgetenv("QT_X11_NO_MITSHM").toInt() == 0))
- X11->use_mitshm = mitshm_pixmaps;
+ if (local && (qgetenv("QT_X11_NO_MITSHM").toInt() == 0)) {
+ Visual *defaultVisual = DefaultVisual(X11->display, DefaultScreen(X11->display));
+ X11->use_mitshm = mitshm_pixmaps && (defaultVisual->red_mask == 0xff0000
+ && defaultVisual->green_mask == 0xff00
+ && defaultVisual->blue_mask == 0xff);
+ }
}
#endif // QT_NO_MITSHM