diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2023-06-22 08:40:56 +0200 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2023-06-22 22:15:50 +0200 |
commit | 8b0e1f2a914d672182d585d8cb2d4a815e88977e (patch) | |
tree | fd6a6a22eb5979ef083900c85a7f0bc30dabf2cf /vcl/unx/generic/desktopdetect | |
parent | 4239a29760ff9748965b4c670d1d4e272f81205d (diff) |
Detect Plasma 6 desktop
Add detection for Plasma 6, which is currently in development stage.
With the following plasma-workspace commit [1] in place,
KDE_SESSION_VERSION is set to 6, so use that to detect it:
commit 4c2242d7dfafac161baec3ec316af24d7b48ef8b
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Thu Jun 22 07:47:31 2023 +0200
Set KDE_SESSION_VERSION to 6
Since the master branch is based on Qt6/KF6 and will
become Plasma 6, set KDE_SESSION_VERSION to "6".
This will allow other applications to detect they're
running in a (preview of a) Plasma 6 session and react
accordingly.
(E.g. LibreOffice can use this to choose to
use its upcoming kf6 integration by default instead of the
kf5 one.)
[1] https://invent.kde.org/plasma/plasma-workspace/-/commit/4c2242d7dfafac161baec3ec316af24d7b48ef8b
Change-Id: I5a15ad1fb177721fbfa016139c56a08b228f2e1f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153437
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'vcl/unx/generic/desktopdetect')
-rw-r--r-- | vcl/unx/generic/desktopdetect/desktopdetector.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/vcl/unx/generic/desktopdetect/desktopdetector.cxx b/vcl/unx/generic/desktopdetect/desktopdetector.cxx index bad134fbdafd..8baeb303feed 100644 --- a/vcl/unx/generic/desktopdetect/desktopdetector.cxx +++ b/vcl/unx/generic/desktopdetect/desktopdetector.cxx @@ -117,6 +117,13 @@ static bool is_plasma5_desktop() return pFullVersion && pSessionVersion && (0 == strcmp(pSessionVersion, "5")); } +static bool is_plasma6_desktop() +{ + static const char* pFullVersion = getenv("KDE_FULL_SESSION"); + static const char* pSessionVersion = getenv("KDE_SESSION_VERSION"); + return pFullVersion && pSessionVersion && (0 == strcmp(pSessionVersion, "6")); +} + extern "C" { @@ -132,6 +139,8 @@ DESKTOP_DETECTOR_PUBLIC DesktopType get_desktop_environment() return DESKTOP_LXQT; if (aOver.equalsIgnoreAsciiCase("plasma5") || aOver.equalsIgnoreAsciiCase("plasma")) return DESKTOP_PLASMA5; + if (aOver.equalsIgnoreAsciiCase("plasma6")) + return DESKTOP_PLASMA6; if ( aOver.equalsIgnoreAsciiCase( "gnome" ) ) return DESKTOP_GNOME; if ( aOver.equalsIgnoreAsciiCase( "gnome-wayland" ) ) @@ -190,6 +199,8 @@ DESKTOP_DETECTOR_PUBLIC DesktopType get_desktop_environment() if (is_plasma5_desktop()) return DESKTOP_PLASMA5; + if (is_plasma6_desktop()) + return DESKTOP_PLASMA6; // tdf#121275 if we still can't tell, and WAYLAND_DISPLAY // is set, default to gtk3 |