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. https://bugzilla.gnome.org/show_bug.cgi?id=673761
This commit is contained in:
@ -578,11 +578,27 @@ const Source = new Lang.Class({
|
||||
return true;
|
||||
},
|
||||
|
||||
_getApp: function() {
|
||||
let app;
|
||||
|
||||
app = Shell.WindowTracker.get_default().get_app_from_pid(this.pid);
|
||||
if (app != null)
|
||||
return app;
|
||||
|
||||
if (this.trayIcon) {
|
||||
app = Shell.AppSystem.get_default().lookup_wmclass(this.trayIcon.wmclass);
|
||||
if (app != null)
|
||||
return app;
|
||||
}
|
||||
|
||||
return null;
|
||||
},
|
||||
|
||||
_setApp: function() {
|
||||
if (this.app)
|
||||
return;
|
||||
|
||||
this.app = Shell.WindowTracker.get_default().get_app_from_pid(this.pid);
|
||||
this.app = this._getApp();
|
||||
if (!this.app)
|
||||
return;
|
||||
|
||||
|
Reference in New Issue
Block a user