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 673761 - Add better heuristics for tracking tray icons.
Add better heuristics for tracking tray icons.
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2012-04-09 02:01 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2012-04-27 19:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
notificationDaemon: Match app based on WM_CLASS (6.13 KB, patch)
2012-04-09 02:01 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
na-tray-child: Fall back to WM_NAME if _NET_WM_NAME doesn't exist (3.10 KB, patch)
2012-04-09 02:01 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
na-tray-child: Fall back to WM_NAME if _NET_WM_NAME doesn't exist (3.58 KB, patch)
2012-04-13 19:24 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review

Description Jasper St. Pierre (not reading bugmail) 2012-04-09 02:01:37 UTC
See this thread on gnome-shell-list for the issues:

https://mail.gnome.org/archives/gnome-shell-list/2012-April/msg00020.html
Comment 1 Jasper St. Pierre (not reading bugmail) 2012-04-09 02:01:40 UTC
Created attachment 211604 [details] [review]
notificationDaemon: Match app based on WM_CLASS

Most tray applets won't have an associated window in the same PID. We
need to fall back to the WM_CLASS in this case.
Comment 2 Jasper St. Pierre (not reading bugmail) 2012-04-09 02:01:43 UTC
Created attachment 211605 [details] [review]
na-tray-child: Fall back to WM_NAME if _NET_WM_NAME doesn't exist
Comment 3 Colin Walters 2012-04-13 16:52:52 UTC
Review of attachment 211604 [details] [review]:

Makes sense...the only weirdness here is that we'll associate it with an app, but that app won't be counted as running.  That could confuse other parts of the system possibly, but I don't have a concrete problem right now.
Comment 4 Colin Walters 2012-04-13 17:01:35 UTC
Review of attachment 211605 [details] [review]:

It's probably worth mentioning in the commit message what applications this fixes.

::: src/tray/na-tray-child.c
@@ +362,3 @@
+  wm_name = gdk_x11_get_xatom_by_name_for_display (display, "WM_NAME");
+
+  retval = get_string_property (display, child->icon_window, wm_name, XA_STRING);

Hm, so XA_STRING means "ISO-8859-1"; now the previous code called g_utf8_validate(), but here we're going to be passing it ISO-8859-1.  The shared subset of ASCII will validate which I assume allows us to match...so probably not an issue.

Look at GDK though for examples of the gymnastics necessary when dealing with pre-NET_WM (i.e. non-UTF8) strings.  Also mutter has meta_text_property_to_utf8().
Comment 5 Jasper St. Pierre (not reading bugmail) 2012-04-13 19:24:00 UTC
Created attachment 212019 [details] [review]
na-tray-child: Fall back to WM_NAME if _NET_WM_NAME doesn't exist

> It's probably worth mentioning in the commit message what applications this
> fixes.

I don't know of any. It just seemed incomplete without it. If you
want to omit this patch, that's fine with me.

> utf8_string issues

Should be fixed.
Comment 6 Jasper St. Pierre (not reading bugmail) 2012-04-27 19:50:01 UTC
Attachment 211604 [details] pushed as 2e8881b - notificationDaemon: Match app based on WM_CLASS


Let's not worry about WM_NAME.