Comment 4 for bug 331768

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...