60 lines
2.0 KiB
Diff
60 lines
2.0 KiB
Diff
|
From e04b8afe7aef5db535311630834bc25316433dae Mon Sep 17 00:00:00 2001
|
||
|
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= <tomas.chvatal@gmail.com>
|
||
|
Date: Mon, 3 Nov 2014 10:01:52 +0100
|
||
|
Subject: Detect KDE5 and fallback to KDE4UI there
|
||
|
|
||
|
Change-Id: I8da53d7b81d28b0051be96c0c4ee0a29d8ed8360
|
||
|
Reviewed-on: https://gerrit.libreoffice.org/12209
|
||
|
Reviewed-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
|
||
|
Tested-by: Samuel Mehrbrodt <s.mehrbrodt@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 ) )
|
||
|
--
|
||
|
cgit v0.10.2
|
||
|
|