This bug was initially reported in Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libreoffice/+bug/1589215. According to the FreeDesktop Desktop Entry Specification¹, $XDG_CURRENT_DESKTOP may contain a colon-separated list of strings. The code in https://github.com/LibreOffice/core/blob/master/vcl/unx/generic/desktopdetect/desktopdetector.cxx#L248 doesn't handle that well, as it tries to match (case-insensitive) on the whole value of the variable. This results in the desktop not being properly detected in instances where XDG_CURRENT_DESKTOP = "ubuntu:GNOME" (which is the case in Ubuntu 18.04). ¹ https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html
Hi Olivier, I think this is the same problem as in bug 119328. Do you plan to work on this? I provided this patch https://gerrit.libreoffice.org/#/c/60489/ but I'm wondering if we should use something like 'contains' instead...
*** Bug 119328 has been marked as a duplicate of this bug. ***
Output of 'echo $XDG_CURRENT_DESKTOP' in Ubuntu 18.04 with Unity 7 installed: Unity:Unity7:ubuntu
Hi Xisco, Without researching this further, I think what needs to happen is splitting the value of aCurrentDesktop on colons, and iterate until we find a known DE. In pseudo-code: array aCurrentDesktops = aCurrentDesktop.split(":") for (de in aCurrentDesktops) { if (de.equalsIgnoreAsciiCase("unity")) { ret = DESKTOP_UNITY; break; } else if (de.equalsIgnoreAsciiCase("gnome")) { ret = DESKTOP_GNOME; break; } else if … } I can give it a try next week if you don't beat me to it.
yep, I use python too much... Definitely comment 5 is the way to go. If I have some time during the weekend I will give it a try, otherwise if you don't see any comment from me on Monday, go ahead and fix it.
We only use the env variable $XDG_CURRENT_DESKTOP to check unity -> https://gerrit.libreoffice.org/#/c/60592/ Gnome is checked with DESKTOP_SESSION
Xisco Fauli committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=79093cce6c3a65f84bbafd172b1e9e6702d3ce75 tdf#119881: Check if Unity/Gnome is separated by colon in XDG_CURRENT_DESKTOP It will be available in 6.2.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Cherry-picked to 6.1: https://gerrit.libreoffice.org/#/c/60677/1 6.0: https://gerrit.libreoffice.org/#/c/60678/
Xisco Fauli committed a patch related to this issue. It has been pushed to "libreoffice-6-0": http://cgit.freedesktop.org/libreoffice/core/commit/?id=0ed572e46a14078c3e96eae063226fcb8823f758&h=libreoffice-6-0 tdf#119881: Check if Unity/Gnome is separated by colon in XDG_CURRENT_DESKTOP It will be available in 6.0.7. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Xisco Fauli committed a patch related to this issue. It has been pushed to "libreoffice-6-1": http://cgit.freedesktop.org/libreoffice/core/commit/?id=aedccaa4ce5a3f1cc16da29c775c3b8551974b29&h=libreoffice-6-1 tdf#119881: Check if Unity/Gnome is separated by colon in XDG_CURRENT_DESKTOP It will be available in 6.1.2. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.