diff options
author | Dominik Holland <dominik.holland@nokia.com> | 2010-07-22 12:35:05 (GMT) |
---|---|---|
committer | Harald Fernengel <harald.fernengel@nokia.com> | 2010-11-02 12:51:56 (GMT) |
commit | 45f66384c560f75477f0554fa0dd5a48d0d8f503 (patch) | |
tree | 6860d2ee3662c07e22f5309df18adfc3894e8217 /src/gui/kernel/qapplication_x11.cpp | |
parent | 8e2b95b1115bc07f81d0fa22cc2929bb28d3e9bb (diff) | |
download | Qt-45f66384c560f75477f0554fa0dd5a48d0d8f503.zip Qt-45f66384c560f75477f0554fa0dd5a48d0d8f503.tar.gz Qt-45f66384c560f75477f0554fa0dd5a48d0d8f503.tar.bz2 |
Added Maemo 6 to the X11 desktopEnvironment list
DE_MAEMO6 is set when the rootwindow is MCompositor
Diffstat (limited to 'src/gui/kernel/qapplication_x11.cpp')
-rw-r--r-- | src/gui/kernel/qapplication_x11.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp index a4cc5a3..a9fccb0 100644 --- a/src/gui/kernel/qapplication_x11.cpp +++ b/src/gui/kernel/qapplication_x11.cpp @@ -2334,6 +2334,40 @@ void qt_init(QApplicationPrivate *priv, int, X11->desktopEnvironment = DE_4DWM; break; } + + Window windowManagerWindow = XNone; + Atom typeReturned; + int formatReturned; + unsigned long nitemsReturned; + unsigned long unused; + unsigned char *data = 0; + if (XGetWindowProperty(QX11Info::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) + 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; + } + } + } + } while(0); if (data) |