Use standard name for .desktop files

Bug #331768 reported by Milan Bouchet-Valat
2
Affects Status Importance Assigned to Milestone
openoffice.org (Ubuntu)
Fix Released
Undecided
Chris Cheney

Bug Description

Binary package hint: openoffice.org

.desktop files for openoffice.org are named ooo-writer.desktop, ooo-calc.desktop and so on. These identifiers are strange because they don't really correspond to the name of the application, nor to that of the package. Fedora uses names like openoffice.org-writer, which is IMHO much more logical (they have a problem with version names, but that's another story).

The problem here is not merely aesthetic, but is about standardization. In the new GNOME shell project which is currently being developed, we use desktop files as identifiers for applications. These different naming conventions will force us to use some detection code, or to patch it for Ubuntu. As a general rule I think avoiding unnecessary differences like that is a good thing.

What do you think? The fix should be pretty straightforward.

Revision history for this message
Chris Cheney (ccheney) wrote :

You use the name of the files themselves instead of the Name or GenericName in the freedesktop standard desktop file to name programs using Gnome Shell?!? Just adhere to the standards already in place and then you won't have to worry about what the actual files are named.

Not a bug, closed invalid.

Changed in openoffice.org:
status: New → Invalid
Revision history for this message
Milan Bouchet-Valat (nalimilan) wrote :

Name=OpenOffice.org Word Processor
GenericName=Word Processor

Neither is intended to be a real identifier for an app... The matching window manager class <-> .desktop file name is quite good, since anyway we need a common way to identify apps. Though I must admit our way is not perfect...

The problem is, see how OO.o uses standards... We already need to detect their windows from title patterns to match them to Writer, Calc and others. Then you need to detect the command used by the distribution to start it. In Ubuntu, it's e.g. 'ooffice -writer %U'. Could have been 'oowriter %U' too. I'll check whether its command is standard on Fedora and others...

Revision history for this message
Chris Cheney (ccheney) wrote :

I think I must be missing what you are talking about, what do you mean "window manager class <-> .desktop file name"?

You mention that OOo is not standards complaint in some ways, other than FHS obviously (which I happen to want to fix), what are the other problems you are referring to? I can bring those issues up with Sun and see if we can get them corrected in one of the next releases. As far as I know wrt the command to start applications we don't change anything ourselves so it is either done by Sun or by ooo-build.

I think part of the problem you are seeing with OOo is that the program is OOo and it just has different 'views' depending on what the document type it is opening. The different programs (eg calc, writer, etc) are not actually different programs. You can open a new document window using File->New from any other document type. (Hopefully that made sense?)

--

http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s05.html

"Name" is supposed to refer to a specific app:

"Name Specific name of the application, for example "Mozilla". localestring YES 1-3"

However you are right that GenericName should not refer to a specific app.

"GenericName Generic name of the application, for example "Web Browser". localestring NO 1-3"

FWIW most ooo-build using distributions call the desktop files eg calc.desktop instead of ooo-calc.desktop.

Depending on the filename of a desktop file is not a good idea at all since it is not standardized on what they should be for a given application. The ooo-calc.desktop could just as easily be called "1.desktop".

Chris

Revision history for this message
Milan Bouchet-Valat (nalimilan) wrote :

OK, maybe I should be a little more explicit. Our problem is to track applications usage in order to present the user most used apps. This can only be done by looking at active windows and making stats from that. This works really great for all apps by taking WM classes and mapping them in lower case to .desktop files (which happen to be, logically, the same as commands to start the program, and most of the time icon names too). For example, Evolution reports 'Evolution' as WM class, uses 'evolution' to start the program and /usr/share/applications/evolution.desktop.

This is so widely used that it could be considered as a de facto standard. Even Firefox works that way - but OO.o doesn't. Every OO.o app reports the same window class. We can circumvent this problem by detecting titles that correspond to Writer, Calc and others. But then we need to be able to map this to .desktop files. As it was working for all apps, we thought about using .desktop files too, and that works well as soon as we use distro-specific identifiers.

That could be done be getting the command used to start OO.o, but that would raise another issue: you can start OO.o by ooffice -writer, and then work during two hours in Base using 'New->Database'. Using WM classes, we could map to .desktop files, but using start commands, we would consider this as OO.o Writer, which is plain wrong.

That's why I thought the best would be to use pseudo-standardized .desktop files. I guess the filename comes from oobuild rather than from OO.o itself. As I said, Fedora uses openoffice.org-APP.desktop. I'm really open to any other solution you might come up with, but AFAIK fd.o specs don't deal with this case. See http://blogs.gnome.org/metacity/2008/11/02/window-matching/ about standards issues with WM classes. If you really think our approach is wrong, we can still directly patch sources for Ubuntu, or try another way, but IMHO trying to standardize that would no be a bad idea anyway.

Thanks for your time...

Revision history for this message
Chris Cheney (ccheney) wrote :

You have a good point about this, you should propose an update to the desktop entry spec to have the filename match the (real) name of the app it is for. That way in the future other apps won't run into this same problem. As I understand it Gnome Shell is proposed to be the shell for Gnome 3.0 next summer (2010)? If so then getting this change done the sooner the better. :-)

Changed in openoffice.org:
assignee: nobody → ccheney
milestone: none → ubuntu-9.04-beta
status: Invalid → Triaged
Revision history for this message
Milan Bouchet-Valat (nalimilan) wrote :
Revision history for this message
Chris Cheney (ccheney) wrote :

Heh, well I am intending to fix the desktop filenames to match RedHat to help you out, but I meant that this probably should be standardized somewhere so that issues like this don't crop up in the future. :-) Relying on a pseudo-standard is prone to bugs, and it would be better standardized if possible so you can blame others instead of having to write work-arounds in your code. :-)

Changed in openoffice.org:
milestone: ubuntu-9.04-beta → jaunty-alpha-6
Chris Cheney (ccheney)
Changed in openoffice.org:
status: Triaged → Fix Committed
Revision history for this message
Milan Bouchet-Valat (nalimilan) wrote :

Thanks for committing! I've not managed to convince the freedesktop.org list, and it looks like the issue is tricky for corner cases. But anyway, the fix is a good thing in general, and for now we're going to rely on it, so it will help beta users and contributors. I'm not sure we will use it at the end, but we may well rely on it, combined with other methods.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package openoffice.org - 1:3.0.1-4ubuntu1

---------------
openoffice.org (1:3.0.1-4ubuntu1) jaunty; urgency=low

  * Resynchronise with Debian (r1417). Remaining changes:
    - Add Launchpad integration support.
    - Add Launchpad translations support.
    - Add package openoffice.org-style-human.
    - Add some Ubuntu-specific bitmaps. Adjust broffice diversions for these.
    - Add support for compressing debs with lzma.
    - Add support for shared /usr/share/doc directories.
    - Add support to build l10n as a separate source.
    - Add support to build on lpia.
    - Add support to turn off building on sparc.
    - Add Xb-Npp-xxx tags according to "firefox distro add-on suport" spec.
    - Set startcenter.desktop to not display in the menu.
    - Use imagemagick instead of graphicsmagick.
    - openoffice.org-help switch to internal copy of lucene.
    - Add support for DEB_BUILD_OPTIONS noopt. LP: #252226
    - Change name of desktop files to openoffice.org-(app).desktop. LP: #331768
    - Update rebuild-gcj-db snippet. Closes LP: #299229
    - Update splash screen.
  * Resynchronise with ooo-build-3-0-1 (r15493).
    - Fedora fix for OpenOffice.org crash when fontconfig sees new fonts.
    - javaldx error message now tells user to install openoffice.org-java-common
      and remove the javasettings_Linux_*.xml file. LP: #249352

 -- Chris Cheney <email address hidden> Thu, 05 Mar 2009 22:00:00 -0600

Changed in openoffice.org:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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