'Unknown Application Name' menu item in Indicator Applet Appmenu when LibreOffice is running

Bug #1589215 reported by Ads20000 on 2016-06-05
228
This bug affects 48 people
Affects Status Importance Assigned to Milestone
LibreOffice
Fix Released
Medium
libreoffice (Ubuntu)
High
Olivier Tilloy

Bug Description

Sometimes I get the issue of a menu having the name of a different application and being unusable, or being an application menu for the focused window but being titled 'Unknown Application Name', with LibreOffice. I also get this with GNOME apps but was told that this is a separate issue to the one I reported here: https://bugs.launchpad.net/ubuntu/+source/gnome-calculator/+bug/1584720 (see comment #5).

The issue is with using Indicator Applet Appmenu in the panel on gnome-flashback installed on standard Ubuntu (which I call Ubuntu (GNOME) Flashback).

ProblemType: Bug
DistroRelease: Ubuntu 16.10
Package: libreoffice-writer 1:5.1.3-0ubuntu4
ProcVersionSignature: Ubuntu 4.4.0-23.41-generic 4.4.10
Uname: Linux 4.4.0-23-generic x86_64
ApportVersion: 2.20.1-0ubuntu4
Architecture: amd64
CurrentDesktop: GNOME-Flashback:Unity
Date: Sun Jun 5 10:32:35 2016
InstallationDate: Installed on 2016-04-26 (39 days ago)
InstallationMedia: Ubuntu 16.10 "Yakkety Yak" - Alpha amd64 (20160426)
SourcePackage: libreoffice
UpgradeStatus: No upgrade log present (probably fresh install)

Ads20000 (ads20000) wrote :
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in libreoffice (Ubuntu):
status: New → Confirmed
Szulovszky Balázs (balazs95) wrote :

It's also affects me on 17.04 upgraded from freshly installed 16.04

TomaszChmielewski (mangoo-wpkg) wrote :

Seeing this on a fresh 17.04 install.

Adam Jacobs (bllfr0g) wrote :

I see it on upgrade from 16.10.

Ads20000 (ads20000) wrote :

Is this also occurring with Unity too then? What about GNOME Shell? I get it in the Snap (and the original report was me seeing it on GNOME Flashback on 16.10) but I haven't seen it in the Deb on Unity or GNOME Shell yet.

Adam Jacobs (bllfr0g) wrote :

Yes. I'm running 17.04 and Unity.

Alfonso (alfonso-martone) wrote :

Seeing this on a 17.04 fresh install on LibreOffice Calc as well.

Jos Geluk (t-jos) wrote :

I can confirm this happens with Unity as well, on Ubuntu 17.04 with LibreOffice 5.3.1.2.

Jos Geluk (t-jos) wrote :

It only seems to happen when LO is started by clicking on an Office document. If LO is started from the launcher or from the dash, or if it is already running, it will correctly say "LibreOffice Writer" (or Calc, etc.)

The comment of #12 is right. More precisely:
If one opens Calc, then open a .odt file, "Unknown Application" appears, and the same if one opens Writer and then opens a .ods file.
If one opens Calc, then open a .ods file, "LibreOffice Calc" appears, and the same if one opens Writer and then opens a .odt file.

Michael Fox (mfox-trentu) wrote :

I am running Ubuntu 17.04 Unity, and I get "unknown application" in Writer regardless of whether I start it up from the dock or from a document. With Calc, I only get it when starting up from a document. Not sure it matters, but my 17.04 is an upgrade from 16.10, not a fresh install. I have a laptop with 16.04 installed, and I don't get the "unknown application" bug in either Writer or Calc regardless of how I start them up.

Matej Kovacic (matej-kovacic) wrote :

I can confirm this issue. I have fresh install of 17.04, and it happens when LO is started by clicking on an document. If LO is started from the launcher or from the dash, this will not appear.

Luis Alberto Pabón (copong) wrote :

I can confirm this is happening on 17.10 with unity. Opening LO through file shows "Unknown application name", and opening the application directly from the launcher correctly identifies it as "Libreoffice Calc". See screenshots.

Luis Alberto Pabón (copong) wrote :
Luis Alberto Pabón (copong) wrote :
mwaechter (matthias-waechter) wrote :

Same here on 17.10 and unity.

cigtoxdoc (lauterba) wrote :

Can confirm on 18.04 LTS when using Unity Desktop. Is there any work around?

John

G C (tomecorphic) wrote :

Confirmed on Ubuntu 18.04 Unity, fresh install, latest LibreOffice 6.0.3 from repo.
Fine on 16.04.

G C (tomecorphic) wrote :

There is a trick suggested by mc4man to workaround this:

https://ubuntuforums.org/showthread.php?t=2391734

no longer affects: df-libreoffice
Adolfo Jayme (fitojb) on 2018-07-27
Changed in libreoffice (Ubuntu):
importance: Undecided → High
Olivier Tilloy (osomon) wrote :

Comment from duplicate bug #1787504:

« It's a LO bug. LO is exporting both traditional titlebar and gnome-shell vertical appmenu (causing unknown application).

Gnome-shell appmenu should not be exported by unity-gtk3-module under Unity. »

I don't see why importance should be High. There are much more pressing bugs since the release of 18.04 and this bug hardly even affects usability.

Khurshid Alam (khurshid-alam) wrote :

According to https://community.ubuntu.com/t/testing-unity-session-in-18-04/987/257,

LO is not detecting XDG_CURRENT_DESKTOP properly.

Editing exec line in .desktop seems to solve the problem.

Exec=env XDG_CURRENT_DESKTOP=Unity libreoffice --writer %U

Since it works on Ubuntu 16.04, I guess something went wrong in detecting Unity. Note Unity changed XDG_CURRENT_DESKTOP from Unity to Unity:Unity7:ubuntu after 16.10.

Olivier Tilloy (osomon) wrote :

Good catch, the relevant upstream code is https://github.com/LibreOffice/core/blob/97836184c61075c4d25b85fff0e24874020632cd/vcl/unx/generic/desktopdetect/desktopdetector.cxx#L248.

In 16.04, XDG_CURRENT_DESKTOP = "Unity" and the detection works as intended. But in e.g. 18.04, XDG_CURRENT_DESKTOP = "ubuntu:GNOME". This is a valid value but LO won't detect it as such. That code needs to be patched to handle colon-separated values for XDG_CURRENT_DESKTOP.

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.

Changed in libreoffice (Ubuntu):
assignee: nobody → Olivier Tilloy (osomon)

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.

Changed in df-libreoffice:
importance: Unknown → Medium
status: Unknown → Confirmed

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.

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.

Adolfo Jayme (fitojb) on 2018-09-18
Changed in libreoffice (Ubuntu):
status: Confirmed → Fix Committed
Changed in df-libreoffice:
status: Confirmed → Fix Released
Adolfo Jayme (fitojb) on 2018-10-09
Changed in libreoffice (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.