summaryrefslogtreecommitdiff
path: root/vcl/unx/generic/desktopdetect/desktopdetector.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/unx/generic/desktopdetect/desktopdetector.cxx')
-rw-r--r--vcl/unx/generic/desktopdetect/desktopdetector.cxx21
1 files changed, 8 insertions, 13 deletions
diff --git a/vcl/unx/generic/desktopdetect/desktopdetector.cxx b/vcl/unx/generic/desktopdetect/desktopdetector.cxx
index 2c453e051b5c..b2aea898e45c 100644
--- a/vcl/unx/generic/desktopdetect/desktopdetector.cxx
+++ b/vcl/unx/generic/desktopdetect/desktopdetector.cxx
@@ -115,15 +115,11 @@ static bool is_gnome_desktop( Display* pDisplay )
return ret;
}
-
-static bool is_kde5_desktop()
+static bool is_plasma5_desktop()
{
- static const char * pFullVersion = getenv( "KDE_FULL_SESSION" );
- static const char * pSessionVersion = getenv( "KDE_SESSION_VERSION" );
- if ( pFullVersion && pSessionVersion && strcmp(pSessionVersion, "5") == 0)
- return true;
-
- return false;
+ static const char* pFullVersion = getenv("KDE_FULL_SESSION");
+ static const char* pSessionVersion = getenv("KDE_SESSION_VERSION");
+ return pFullVersion && pSessionVersion && (0 == strcmp(pSessionVersion, "5"));
}
extern "C"
@@ -139,8 +135,8 @@ DESKTOP_DETECTOR_PUBLIC DesktopType get_desktop_environment()
if ( aOver.equalsIgnoreAsciiCase( "lxqt" ) )
return DESKTOP_LXQT;
- if ( aOver.equalsIgnoreAsciiCase( "kde5" ) )
- return DESKTOP_KDE5;
+ if (aOver.equalsIgnoreAsciiCase("plasma5") || aOver.equalsIgnoreAsciiCase("plasma"))
+ return DESKTOP_PLASMA5;
if ( aOver.equalsIgnoreAsciiCase( "gnome" ) )
return DESKTOP_GNOME;
if ( aOver.equalsIgnoreAsciiCase( "gnome-wayland" ) )
@@ -197,9 +193,8 @@ DESKTOP_DETECTOR_PUBLIC DesktopType get_desktop_environment()
else if ( aDesktopSession.equalsIgnoreAsciiCase( "lxqt" ) )
return DESKTOP_LXQT;
-
- if ( is_kde5_desktop() )
- return DESKTOP_KDE5;
+ if (is_plasma5_desktop())
+ return DESKTOP_PLASMA5;
// tdf#121275 if we still can't tell, and WAYLAND_DISPLAY
// is set, default to gtk3