summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Bache-Wiig <jbache@trolltech.com>2009-10-06 10:31:12 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2009-10-07 02:42:59 (GMT)
commitcaa46056225705ced4faca57d75091a219b38279 (patch)
tree4acafb18da130981f67aa9d30ee7c5edf2fe23d1
parent879a4e0c1f694b292a2b85cfb7140aed470de9a6 (diff)
downloadQt-caa46056225705ced4faca57d75091a219b38279.zip
Qt-caa46056225705ced4faca57d75091a219b38279.tar.gz
Qt-caa46056225705ced4faca57d75091a219b38279.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 (cherry picked from commit 9956ef7fd66f5a0a2ebf9b810e5f6ffe3649cf20)
-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;