diff options
author | Harald Fernengel <harald.fernengel@nokia.com> | 2010-11-02 13:20:00 (GMT) |
---|---|---|
committer | Harald Fernengel <harald.fernengel@nokia.com> | 2010-11-02 13:20:00 (GMT) |
commit | 7e8495a3d14bb5770fd2bdb81616d19e2e1d94af (patch) | |
tree | 4b083a52a2f3d44c9e2e719502c3cc1c114318c5 /src | |
parent | 45f66384c560f75477f0554fa0dd5a48d0d8f503 (diff) | |
download | Qt-7e8495a3d14bb5770fd2bdb81616d19e2e1d94af.zip Qt-7e8495a3d14bb5770fd2bdb81616d19e2e1d94af.tar.gz Qt-7e8495a3d14bb5770fd2bdb81616d19e2e1d94af.tar.bz2 |
Cleanup Meego Compositor detection
Make the code friendlier and rename the enum value to
DE_MEEGO_COMPOSITOR
Reviewed-by: Robert Griebl
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/kernel/qapplication_x11.cpp | 44 | ||||
-rw-r--r-- | src/gui/kernel/qt_x11_p.h | 2 |
2 files changed, 18 insertions, 28 deletions
diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp index a9fccb0..7c68170 100644 --- a/src/gui/kernel/qapplication_x11.cpp +++ b/src/gui/kernel/qapplication_x11.cpp @@ -2335,35 +2335,25 @@ void qt_init(QApplicationPrivate *priv, int, break; } - Window windowManagerWindow = XNone; - Atom typeReturned; - int formatReturned; - unsigned long nitemsReturned; - unsigned long unused; - unsigned char *data = 0; - if (XGetWindowProperty(QX11Info::display(), QX11Info::appRootWindow(), + if (XGetWindowProperty(X11->display, QX11Info::appRootWindow(), ATOM(_NET_SUPPORTING_WM_CHECK), - 0, 1024, False, XA_WINDOW, &typeReturned, - &formatReturned, &nitemsReturned, &unused, &data) - == Success) { - if (typeReturned == XA_WINDOW && formatReturned == 32) - windowManagerWindow = *((Window*) data); - if (data) + 0, 1024, False, XA_WINDOW, &type, + &format, &length, &after, &data) == Success) { + if (type == XA_WINDOW && format == 32) { + Window windowManagerWindow = *((Window*) data); XFree(data); - - if (windowManagerWindow != XNone) { - QString wmName; - Atom utf8atom = ATOM(UTF8_STRING); - if (XGetWindowProperty(QX11Info::display(), windowManagerWindow, ATOM(_NET_WM_NAME), - 0, 1024, False, utf8atom, &typeReturned, - &formatReturned, &nitemsReturned, &unused, &data) - == Success) { - if (typeReturned == utf8atom && formatReturned == 8) - wmName = QString::fromUtf8((const char*)data); - if (data) - XFree(data); - if (wmName == QLatin1String("MCompositor")) - X11->desktopEnvironment = DE_MAEMO6; + data = 0; + + if (windowManagerWindow != XNone) { + Atom utf8atom = ATOM(UTF8_STRING); + if (XGetWindowProperty(QX11Info::display(), windowManagerWindow, ATOM(_NET_WM_NAME), + 0, 1024, False, utf8atom, &type, + &format, &length, &after, &data) == Success) { + if (type == utf8atom && format == 8) { + if (qstrcmp((const char *)data, "MCompositor") == 0) + X11->desktopEnvironment = DE_MEEGO_COMPOSITOR; + } + } } } } diff --git a/src/gui/kernel/qt_x11_p.h b/src/gui/kernel/qt_x11_p.h index 60bcc51..56c8094 100644 --- a/src/gui/kernel/qt_x11_p.h +++ b/src/gui/kernel/qt_x11_p.h @@ -338,7 +338,7 @@ enum DesktopEnvironment { DE_KDE, DE_GNOME, DE_CDE, - DE_MAEMO6, + DE_MEEGO_COMPOSITOR, DE_4DWM }; |