[Libreoffice-commits] core.git: vcl/unx
Tomáš Chvátal
tomas.chvatal at gmail.com
Mon Nov 3 01:54:55 PST 2014
vcl/unx/generic/desktopdetect/desktopdetector.cxx | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
New commits:
commit e04b8afe7aef5db535311630834bc25316433dae
Author: Tomáš Chvátal <tomas.chvatal at gmail.com>
Date: Mon Nov 3 10:01:52 2014 +0100
Detect KDE5 and fallback to KDE4UI there
Change-Id: I8da53d7b81d28b0051be96c0c4ee0a29d8ed8360
Reviewed-on: https://gerrit.libreoffice.org/12209
Reviewed-by: Samuel Mehrbrodt <s.mehrbrodt at gmail.com>
Tested-by: Samuel Mehrbrodt <s.mehrbrodt at gmail.com>
diff --git a/vcl/unx/generic/desktopdetect/desktopdetector.cxx b/vcl/unx/generic/desktopdetect/desktopdetector.cxx
index 163d48e..e1f253d 100644
--- a/vcl/unx/generic/desktopdetect/desktopdetector.cxx
+++ b/vcl/unx/generic/desktopdetect/desktopdetector.cxx
@@ -272,6 +272,23 @@ static bool is_kde4_desktop( Display* pDisplay )
return false;
}
+static bool is_kde5_desktop( Display* pDisplay )
+{
+ if ( NULL != getenv( "KDE_FULL_SESSION" ) )
+ {
+ OUString aVer( "5" );
+
+ const char *pVer = getenv( "KDE_SESSION_VERSION" );
+ if ( pVer && aVer.equalsIgnoreAsciiCaseAscii( pVer ) )
+ return true;
+ }
+
+ if ( KDEVersion( pDisplay ) == 5 )
+ return true;
+
+ return false;
+}
+
extern "C"
{
@@ -285,6 +302,8 @@ DESKTOP_DETECTOR_PUBLIC DesktopType get_desktop_environment()
if ( aOver.equalsIgnoreAsciiCase( "tde" ) )
return DESKTOP_TDE;
+ if ( aOver.equalsIgnoreAsciiCase( "kde5" ) )
+ return DESKTOP_KDE4;
if ( aOver.equalsIgnoreAsciiCase( "kde4" ) )
return DESKTOP_KDE4;
if ( aOver.equalsIgnoreAsciiCase( "gnome" ) )
@@ -371,6 +390,8 @@ DESKTOP_DETECTOR_PUBLIC DesktopType get_desktop_environment()
// these guys can be slower, with X property fetches,
// round-trips etc. and so are done later.
+ else if ( is_kde5_desktop( pDisplay ) )
+ ret = DESKTOP_KDE4;
else if ( is_kde4_desktop( pDisplay ) )
ret = DESKTOP_KDE4;
else if ( is_gnome_desktop( pDisplay ) )
More information about the Libreoffice-commits
mailing list