|
|
@ -70,11 +70,18 @@ let extensionShowNotification = function () { |
|
|
|
this._notification = this._notificationQueue.shift(); |
|
|
|
this._notification = this._notificationQueue.shift(); |
|
|
|
|
|
|
|
|
|
|
|
this._userActiveWhileNotificationShown = this.idleMonitor.get_idletime() <= IDLE_TIME; |
|
|
|
this._userActiveWhileNotificationShown = this.idleMonitor.get_idletime() <= IDLE_TIME; |
|
|
|
|
|
|
|
if (ExtensionUtils.versionCheck(['3.7', '3.8', '3.9', '3.10'], Config.PACKAGE_VERSION)) { |
|
|
|
if (!this._userActiveWhileNotificationShown) { |
|
|
|
if (!this._userActiveWhileNotificationShown) { |
|
|
|
// If the user isn't active, set up a watch to let us know
|
|
|
|
// If the user isn't active, set up a watch to let us know
|
|
|
|
// when the user becomes active.
|
|
|
|
// when the user becomes active.
|
|
|
|
this.idleMonitor.add_user_active_watch(Lang.bind(this, this._onIdleMonitorBecameActive)); |
|
|
|
this.idleMonitor.add_user_active_watch(Lang.bind(this, this._onIdleMonitorBecameActive)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
this._idleMonitorWatchId = this.idleMonitor.add_watch(IDLE_TIME, |
|
|
|
|
|
|
|
Lang.bind(this, this._onIdleMonitorWatch)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this._notificationClickedId = this._notification.connect('done-displaying', |
|
|
|
this._notificationClickedId = this._notification.connect('done-displaying', |
|
|
|
Lang.bind(this, this._escapeTray)); |
|
|
|
Lang.bind(this, this._escapeTray)); |
|
|
@ -142,6 +149,7 @@ let extensionHideNotification = function(animate) { |
|
|
|
this._notification.disconnect(this._notificationExpandedId); |
|
|
|
this._notification.disconnect(this._notificationExpandedId); |
|
|
|
this._notificationExpandedId = 0; |
|
|
|
this._notificationExpandedId = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (ExtensionUtils.versionCheck(['3.7', '3.8', '3.9', '3.10'], Config.PACKAGE_VERSION)) { |
|
|
|
if (this._notificationClickedId) { |
|
|
|
if (this._notificationClickedId) { |
|
|
|
this._notification.disconnect(this._notificationClickedId); |
|
|
|
this._notification.disconnect(this._notificationClickedId); |
|
|
|
this._notificationClickedId = 0; |
|
|
|
this._notificationClickedId = 0; |
|
|
@ -217,6 +225,33 @@ let extensionHideNotification = function(animate) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this._notificationRemoved) { |
|
|
|
|
|
|
|
// JRL changes begin
|
|
|
|
|
|
|
|
// this._notificationWidget.y = this.actor.height;
|
|
|
|
|
|
|
|
this._notificationWidget.y = -global.screen_height; |
|
|
|
|
|
|
|
// JRL changes end
|
|
|
|
|
|
|
|
this._notificationWidget.opacity = 0; |
|
|
|
|
|
|
|
this._notificationState = State.HIDDEN; |
|
|
|
|
|
|
|
this._hideNotificationCompleted(); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this._tween(this._notificationWidget, '_notificationState', State.HIDDEN, |
|
|
|
|
|
|
|
// JRL changes begin
|
|
|
|
|
|
|
|
// { y: this.actor.height,
|
|
|
|
|
|
|
|
{ y: -global.screen_height, |
|
|
|
|
|
|
|
// JRL changes end
|
|
|
|
|
|
|
|
opacity: 0, |
|
|
|
|
|
|
|
time: ANIMATION_TIME, |
|
|
|
|
|
|
|
transition: 'easeOutQuad', |
|
|
|
|
|
|
|
onComplete: this._hideNotificationCompleted, |
|
|
|
|
|
|
|
onCompleteScope: this |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
/* |
|
|
@ -233,13 +268,20 @@ let extensionUpdateShowingNotification = function() { |
|
|
|
this._notification._table.add_style_class_name('jrlnotification'); |
|
|
|
this._notification._table.add_style_class_name('jrlnotification'); |
|
|
|
// JRL changes end
|
|
|
|
// JRL changes end
|
|
|
|
this._notification.acknowledged = true; |
|
|
|
this._notification.acknowledged = true; |
|
|
|
|
|
|
|
if (ExtensionUtils.versionCheck(['3.7', '3.8', '3.9', '3.10'], Config.PACKAGE_VERSION)) { |
|
|
|
this._notification.playSound(); |
|
|
|
this._notification.playSound(); |
|
|
|
|
|
|
|
|
|
|
|
// We auto-expand notifications with CRITICAL urgency, or for which the relevant setting
|
|
|
|
// We auto-expand notifications with CRITICAL urgency, or for which the relevant setting
|
|
|
|
// is on in the control center.
|
|
|
|
// is on in the control center.
|
|
|
|
if (this._notification.urgency == Urgency.CRITICAL || |
|
|
|
if (this._notification.urgency == Urgency.CRITICAL || |
|
|
|
this._notification.source.policy.forceExpanded) |
|
|
|
this._notification.source.policy.forceExpanded) |
|
|
|
this._expandNotification(true); |
|
|
|
this._expandNotification(true); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
// We auto-expand notifications with CRITICAL urgency.
|
|
|
|
|
|
|
|
if (this._notification.urgency == Urgency.CRITICAL) |
|
|
|
|
|
|
|
this._expandNotification(true); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// We tween all notifications to full opacity. This ensures that both new notifications and
|
|
|
|
// We tween all notifications to full opacity. This ensures that both new notifications and
|
|
|
|
// notifications that might have been in the process of hiding get full opacity.
|
|
|
|
// notifications that might have been in the process of hiding get full opacity.
|
|
|
|