summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-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
};