notification: Use the same Source for showing system notifications
This drops all subclasses of `MessageTray.Source` that were used to display system notifications. Now the `Source` returned from `MessageTray.getSystemSource()` is used. Ensure also that properties and methods that where set on the `Source` are moved to the `Notification` object itself. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3156>
This commit is contained in:

committed by
Marge Bot

parent
3faf1caead
commit
c1ff00c01b
@ -274,8 +274,7 @@ async function _initializeUI() {
|
||||
if (lookingGlass?.isOpen)
|
||||
return; // assume user action
|
||||
|
||||
const source = new MessageTray.SystemNotificationSource();
|
||||
messageTray.add(source);
|
||||
const source = MessageTray.getSystemSource();
|
||||
const notification = new MessageTray.Notification(source,
|
||||
_('System was put in unsafe mode'),
|
||||
_('Apps now have unrestricted access'));
|
||||
@ -615,8 +614,7 @@ export function loadTheme() {
|
||||
* @param {string} details Additional information
|
||||
*/
|
||||
export function notify(msg, details) {
|
||||
let source = new MessageTray.SystemNotificationSource();
|
||||
messageTray.add(source);
|
||||
const source = MessageTray.getSystemSource();
|
||||
let notification = new MessageTray.Notification(source, msg, details);
|
||||
notification.setTransient(true);
|
||||
source.showNotification(notification);
|
||||
|
Reference in New Issue
Block a user