GNOME Bugzilla – Bug 673761
Add better heuristics for tracking tray icons.
Last modified: 2012-04-27 19:50:05 UTC
See this thread on gnome-shell-list for the issues: https://mail.gnome.org/archives/gnome-shell-list/2012-April/msg00020.html
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.
Created attachment 211605 [details] [review] na-tray-child: Fall back to WM_NAME if _NET_WM_NAME doesn't exist
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.
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().
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.
Attachment 211604 [details] pushed as 2e8881b - notificationDaemon: Match app based on WM_CLASS Let's not worry about WM_NAME.