summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qapplication_x11.cpp
diff options
context:
space:
mode:
authorJens Bache-Wiig <jbache@trolltech.com>2009-10-06 10:31:12 (GMT)
committerJens Bache-Wiig <jbache@trolltech.com>2009-10-06 10:33:26 (GMT)
commit9956ef7fd66f5a0a2ebf9b810e5f6ffe3649cf20 (patch)
treefdb18403bea05339edd2c34a49a5f320ecadb2aa /src/gui/kernel/qapplication_x11.cpp
parent3d2ef8ab18dcf0b772d2f6ddeb5cf5295ca09db6 (diff)
downloadQt-9956ef7fd66f5a0a2ebf9b810e5f6ffe3649cf20.zip
Qt-9956ef7fd66f5a0a2ebf9b810e5f6ffe3649cf20.tar.gz
Qt-9956ef7fd66f5a0a2ebf9b810e5f6ffe3649cf20.tar.bz2
Add support for XFCE desktop integration
XFCE essentially depends on gnome libraries and can use the same integration features we provide for GNOME. Hence we simply treat it as the GNOME desktop environment internally. We can now also use the DESKTOP_SESSION to reliably detect desktop environments since it has been properly standardized, instead of relying on window manager hacks for anything but a fallback. Task-number: QTBUG-4737 Reviewed-by: bhughes
Diffstat (limited to 'src/gui/kernel/qapplication_x11.cpp')
-rw-r--r--src/gui/kernel/qapplication_x11.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp
index bbce438..e46a370 100644
--- a/src/gui/kernel/qapplication_x11.cpp
+++ b/src/gui/kernel/qapplication_x11.cpp
@@ -2256,8 +2256,13 @@ void qt_init(QApplicationPrivate *priv, int,
unsigned long length, after;
uchar *data = 0;
- if (XGetWindowProperty(X11->display, QX11Info::appRootWindow(), ATOM(DTWM_IS_RUNNING),
- 0, 1, False, AnyPropertyType, &type, &format, &length,
+ QString session = QString::fromLocal8Bit(qgetenv("DESKTOP_SESSION"));
+ if (session == QLatin1String("kde")) {
+ X11->desktopEnvironment = DE_KDE;
+ } else if (session == QLatin1String("gnome") || session == QLatin1String("xfce")) {
+ X11->desktopEnvironment = DE_GNOME;
+ } else if (XGetWindowProperty(X11->display, QX11Info::appRootWindow(), ATOM(DTWM_IS_RUNNING),
+ 0, 1, False, AnyPropertyType, &type, &format, &length,
&after, &data) == Success && length) {
// DTWM is running, meaning most likely CDE is running...
X11->desktopEnvironment = DE_CDE;