messageTray: Port to MetaSoundPlayer for emitting sounds

Move away from ShellGlobal API, which is too tightly coupled to
libcanberra-gtk. The app ID/name seem unused in canberra, so we
may simplify this to a single case.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/327
This commit is contained in:
Carlos Garnacho 2018-12-13 20:32:16 +01:00 committed by Florian Müllner
parent 9a35c9902a
commit 25bfe99ed5

View File

@ -448,27 +448,11 @@ var Notification = new Lang.Class({
return; return;
} }
if (this._soundName) { let player = global.display.get_sound_player();
if (this.source.app) { if (this._soundName)
let app = this.source.app; player.play_from_theme(this._soundName, this.title, null);
else if (this._soundFile)
global.play_theme_sound_full(0, this._soundName, player.play_from_file(this._soundFile, this.title, null);
this.title, null,
app.get_id(), app.get_name());
} else {
global.play_theme_sound(0, this._soundName, this.title, null);
}
} else if (this._soundFile) {
if (this.source.app) {
let app = this.source.app;
global.play_sound_file_full(0, this._soundFile,
this.title, null,
app.get_id(), app.get_name());
} else {
global.play_sound_file(0, this._soundFile, this.title, null);
}
}
}, },
// Allow customizing the banner UI: // Allow customizing the banner UI: