After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 649315 - can't get proper WM_CLASS association for LibreOffice
can't get proper WM_CLASS association for LibreOffice
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
3.0.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 651014 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-05-03 19:11 UTC by Bill Nottingham
Modified: 2011-09-28 18:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
window: Add wm-class property and notify it when changed. (2.33 KB, patch)
2011-05-04 16:13 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
shell-window-tracker: Work better at picking up changes in WM_CLASS (2.07 KB, patch)
2011-05-04 16:14 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
Track changes to WM_CLASS (2.48 KB, patch)
2011-05-24 23:47 UTC, Colin Walters
committed Details | Review

Description Bill Nottingham 2011-05-03 19:11:02 UTC
gnome-shell-3.0.1-1.fc15.x86_64
libreoffice-core-3.3.2.2-6.fc15.x86_64

<notting> is there a plan to 'fix' the libreoffice icons?
<cosimoc> notting, fix as in?
<notting> cosimoc: they're being scaled badly
 at least in the task switcher
<cosimoc> hrm, they look good here
<owen> notting: is assoication working?
 notting: what d you see for the app icon?
<cosimoc> notting, but if they look fine in Applications and not in alt-tab
icons are not the issue usually
<owen> notting: do you see the text you'd expect, or something weirdly
capitalized with dashes?
<cosimoc> it's the application that does not the right WM class
<notting> owen: what looks to be a 32x32 (or 48x48, whatever) version of the
correct icon, scaled up 
<owen> notting: i"M actually asking about the text
 notting: up by Activities
<notting> owen: 'libreoffice-calc'
<owen> notting: yeah, that's what I expected
 notting: and does /usr/share/applications/libreoffice-calc.desktop exist?
<owen> (and do you have appications under Applications in the overview?)
<notting> that desktop exists
 and i have 'LibreOffice Calc' in applications -> office
<owen> notting: hmm, I'm puzzled
 notting: what is xprop | grep WM_CLASS ?
<owen> notting: how did you get to this document? I'm wondering if there is
some code path where LO isn't correctly setting the right WM_CLASS
<notting> WM_CLASS(STRING) = "VCLSalFrame.DocumentWindow", "libreoffice-calc"
 WM_ICON_NAME(STRING) = "configtool.ods - LibreOffice Calc"
 owen: "ooffice <blah>" ran from the terminal, of course
<owen> notting: the WM_CLASS looks fine really
 notting: what does the Windows tab sow?
<owen> walters: my current guess is that libreofice changes WM_CLASS after
mapping the window and we don't handle that correctly and are racy
<notting> wmclass: libreoffice-calc, <untracked>
<walters> owen: that looks to be the case indeed
<walters> i'm not sure i'd call that our bug though
<owen> walters: well, consiering the weird container nature of openoffice
<walters> hmm
<owen> walters: it may be heroic of them to get the WM_CLASS set correctly *at
all*
<walters> is this something where like it decides which app it is after it's
already opened the document?
<owen> walters: I'm guessing so
 walters: we can check with caolon of course, but if it's not too much work to
handle it, we possible should
<walters> notting: file a bug, i'll take a look
<owen> notting: does it work better if you run libreoffice-calc <document> ?
 notting: and/or is it sometimes-work-sometimes-not ?
<walters> owen: nope
<notting> can't make it work, even running as 'oocalc'
 or /usr/lib64/libreoffice/program/scalc, even
Comment 1 Colin Walters 2011-05-03 19:16:38 UTC
Ideally, LibreOffice would set the correct WM_CLASS before even mapping a window.

It would be nice to get a base "base" application on startup too.

But if we want this to work, we need to monitor the WM_CLASS property and adapt to changes.
Comment 2 Bill Nottingham 2011-05-03 19:47:56 UTC
Note that if I open documents of multiple types, they're grouped under the icon/class of whatever the first one opened was.

i.e., I open in succession a odt, odp, and ods file, I get three windows categorized under 'libreoffice-writer'.
Comment 3 Jasper St. Pierre (not reading bugmail) 2011-05-04 16:13:38 UTC
Created attachment 187212 [details] [review]
window: Add wm-class property and notify it when changed.
Comment 4 Jasper St. Pierre (not reading bugmail) 2011-05-04 16:14:24 UTC
Created attachment 187213 [details] [review]
shell-window-tracker: Work better at picking up changes in WM_CLASS

This should help detect applications for windows that set their WM_CLASS
after mapping.
Comment 5 Colin Walters 2011-05-24 23:41:30 UTC
Oh crap, sorry Jasper - I didn't see you'd already worked on this.   Your mutter patch looks fine, but I think my gnome-shell one is better.  In my testing we actually need to recalculate the focus-app.
Comment 6 Colin Walters 2011-05-24 23:47:21 UTC
Created attachment 188532 [details] [review]
Track changes to WM_CLASS

LibreOffice changes applications dynamically; we should support this.
Comment 7 Colin Walters 2011-05-24 23:49:00 UTC
Review of attachment 187212 [details] [review]:

Looks fine.
Comment 8 Jasper St. Pierre (not reading bugmail) 2011-05-25 16:04:03 UTC
Review of attachment 187212 [details] [review]:

We're using Colin's patch in bug 651014
Comment 9 Colin Walters 2011-05-25 16:10:45 UTC
Attachment 188532 [details] pushed as d51e79d - Track changes to WM_CLASS
Comment 10 Jasper St. Pierre (not reading bugmail) 2011-09-28 18:09:36 UTC
*** Bug 651014 has been marked as a duplicate of this bug. ***