[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - vcl/unx

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Jan 29 11:27:35 UTC 2019


 vcl/unx/generic/desktopdetect/desktopdetector.cxx |   12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

New commits:
commit 3e4478103ee1ba912d650ab447ed246f5f1cc196
Author:     Michael Weghorn <m.weghorn at posteo.de>
AuthorDate: Tue Jan 29 08:18:15 2019 +0100
Commit:     Michael Weghorn <m.weghorn at posteo.de>
CommitDate: Tue Jan 29 12:27:12 2019 +0100

    tdf#123011 Detect kde5 desktop in Plasma Wayland session
    
    Both env variables 'KDE_FULL_SESSION' and 'KDE_SESSION_VERSION'
    are set in both X11 and Wayland sessions for Plasma 5 (kde5),
    s.a. https://userbase.kde.org/KDE_System_Administration/Environment_Variables,
    so drop the alternative X-specific check.
    
    Move the check for a kde5 upward, so that kde5 is actually detected
    in a Plasma 5 Wayland session, rather than falling back to
    assuming GNOME.
    
    Change-Id: Ieb5b47272f375ceed4d44a2ccc5b517222ae86b9
    Reviewed-on: https://gerrit.libreoffice.org/67044
    Reviewed-by: Tomáš Chvátal <tchvatal at suse.cz>
    Tested-by: Tomáš Chvátal <tchvatal at suse.cz>
    Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>
    (cherry picked from commit 7eccf0b3fe771a519dbdaaf536d64b5b193a723f)
    Reviewed-on: https://gerrit.libreoffice.org/67051
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.weghorn at posteo.de>

diff --git a/vcl/unx/generic/desktopdetect/desktopdetector.cxx b/vcl/unx/generic/desktopdetect/desktopdetector.cxx
index e7cb9b93e801..9f65b1624181 100644
--- a/vcl/unx/generic/desktopdetect/desktopdetector.cxx
+++ b/vcl/unx/generic/desktopdetect/desktopdetector.cxx
@@ -191,16 +191,13 @@ static bool is_kde4_desktop( Display* pDisplay )
     return false;
 }
 
-static bool is_kde5_desktop( Display* pDisplay )
+static bool is_kde5_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;
 
-    if ( KDEVersion( pDisplay ) == 5 )
-        return true;
-
     return false;
 }
 
@@ -280,6 +277,9 @@ DESKTOP_DETECTOR_PUBLIC DesktopType get_desktop_environment()
         ret = DESKTOP_LXQT;
     else
     {
+        if ( is_kde5_desktop() )
+            return DESKTOP_KDE5;
+
         // tdf#121275 if we still can't tell, and WAYLAND_DISPLAY
         // is set, default to gtk3
         const char* pWaylandStr = getenv("WAYLAND_DISPLAY");
@@ -328,9 +328,7 @@ DESKTOP_DETECTOR_PUBLIC DesktopType get_desktop_environment()
 
         XErrorHandler pOldHdl = XSetErrorHandler( autodect_error_handler );
 
-        if ( is_kde5_desktop( pDisplay ) )
-            ret = DESKTOP_KDE5;
-        else if ( is_kde4_desktop( pDisplay ) )
+        if ( is_kde4_desktop( pDisplay ) )
             ret = DESKTOP_KDE4;
         else if ( is_gnome_desktop( pDisplay ) )
             ret = DESKTOP_GNOME;


More information about the Libreoffice-commits mailing list