summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominik Holland <dominik.holland@nokia.com>2010-07-22 12:35:05 (GMT)
committerHarald Fernengel <harald.fernengel@nokia.com>2010-11-02 12:51:56 (GMT)
commit45f66384c560f75477f0554fa0dd5a48d0d8f503 (patch)
tree6860d2ee3662c07e22f5309df18adfc3894e8217
parent8e2b95b1115bc07f81d0fa22cc2929bb28d3e9bb (diff)
downloadQt-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
-rw-r--r--src/gui/kernel/qapplication_x11.cpp34
-rw-r--r--src/gui/kernel/qt_x11_p.h1
2 files changed, 35 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)
diff --git a/src/gui/kernel/qt_x11_p.h b/src/gui/kernel/qt_x11_p.h
index d62d9c3..60bcc51 100644
--- a/src/gui/kernel/qt_x11_p.h
+++ b/src/gui/kernel/qt_x11_p.h
@@ -338,6 +338,7 @@ enum DesktopEnvironment {
DE_KDE,
DE_GNOME,
DE_CDE,
+ DE_MAEMO6,
DE_4DWM
};