From 0472a8d312f2040f42ee817d05dd6e765260de88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Wed, 8 Sep 2010 10:00:21 +0200 Subject: Force MeeGo touch to use native graphics system for now. MeeGo touch doesn't yet work with other graphics systems since it assumes that QPixmaps are XPixmap based. If MeeGo touch doesn't link against the graphics system helper we'll force it to use the native graphics system. --- src/gui/kernel/qapplication.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 82dd83a..e99f6ca 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -94,6 +94,10 @@ #include +#if defined(Q_WS_X11) && !defined(QT_NO_EGL) +#include +#endif + #include "qapplication_p.h" #include "qevent_p.h" #include "qwidget_p.h" @@ -768,6 +772,13 @@ QApplication::QApplication(int &argc, char **argv, Type type , int _internal) : QCoreApplication(*new QApplicationPrivate(argc, argv, type)) { Q_D(QApplication); d->construct(); QApplicationPrivate::app_compile_version = _internal;} +#if defined(Q_WS_X11) && !defined(QT_NO_EGL) +static int qt_matchLibraryName(dl_phdr_info *info, size_t, void *data) +{ + const char *name = static_cast(data); + return strstr(info->dlpi_name, name) != 0; +} +#endif /*! \internal @@ -785,6 +796,19 @@ void QApplicationPrivate::construct( // the environment variable has the lowest precedence of runtime graphicssystem switches if (graphics_system_name.isEmpty()) graphics_system_name = QString::fromLocal8Bit(qgetenv("QT_GRAPHICSSYSTEM")); + +#if defined(Q_WS_X11) && !defined(QT_NO_EGL) + if (graphics_system_name.isEmpty()) { + bool linksWithMeeGoTouch = dl_iterate_phdr(qt_matchLibraryName, const_cast("libmeegotouchcore")); + bool linksWithMeeGoGraphicsSystemHelper = dl_iterate_phdr(qt_matchLibraryName, const_cast("libQtMeeGoGraphicsSystemHelper")); + + if (linksWithMeeGoTouch && !linksWithMeeGoGraphicsSystemHelper) { + qWarning("Running non-meego graphics system enabled MeeGo touch, forcing native graphicssystem\n"); + graphics_system_name = QLatin1String("native"); + } + } +#endif + // Must be called before initialize() qt_init(this, qt_appType #ifdef Q_WS_X11 -- cgit v0.12