@ -70,18 +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 ( ExtensionUtils . versionCheck ( [ '3.6' ] , Config . PACKAGE _VERSION ) ) {
this . _idleMonitorWatchId = this . idleMonitor . add _watch ( IDLE _TIME ,
Lang . bind ( this , this . _onIdleMonitorWatch ) ) ;
}
else
{
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 ) ) ;
@ -125,11 +125,7 @@ let extensionShowNotification = function () {
* entire screen .
* entire screen .
* /
* /
let extensionHideNotification = function ( animate ) {
let extensionHideNotification = function ( animate ) {
if ( ExtensionUtils . versionCheck ( [ '3.9' , '3.10' ] , Config . PACKAGE _VERSION ) ) {
if ( ExtensionUtils . versionCheck ( [ '3.6' , '3.8' ] , Config . PACKAGE _VERSION ) ) {
this . _notificationFocusGrabber . ungrabFocus ( ) ;
}
else
{
// HACK!
// HACK!
// There seems to be a reentrancy issue in calling .ungrab() here,
// There seems to be a reentrancy issue in calling .ungrab() here,
// which causes _updateState to be called before _notificationState
// which causes _updateState to be called before _notificationState
@ -144,30 +140,26 @@ let extensionHideNotification = function(animate) {
this . _grabHelper . ungrab ( { actor : this . _notification . actor } ) ;
this . _grabHelper . ungrab ( { actor : this . _notification . actor } ) ;
}
}
else
{
this . _notificationFocusGrabber . ungrabFocus ( ) ;
}
if ( this . _notificationExpandedId ) {
if ( this . _notificationExpandedId ) {
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 ( ExtensionUtils . versionCheck ( [ '3.6' ] , Config . PACKAGE _VERSION ) ) {
if ( this . _notificationClickedId ) {
this . _notification . disconnect ( this . _notificationClickedId ) ;
this . _notificationClickedId = 0 ;
}
if ( this . _notificationUnfocusedId ) {
this . _notification . disconnect ( this . _notificationUnfocusedId ) ;
this . _notificationUnfocusedId = 0 ;
}
if ( ExtensionUtils . versionCheck ( [ '3.9' , '3.10' ] , Config . PACKAGE _VERSION ) ) {
if ( this . _notificationRemoved ) {
if ( this . _notificationLeftTimeoutId ) {
// JRL changes begin
Mainloop . source _remove ( this . _notificationLeftTimeoutId ) ;
//this._notificationWidget.y = this.actor.height;
this . _notificationLeftTimeoutId = 0 ;
this . _notificationWidget . y = - global . screen _height ;
this . _notificationLeftMouseX = - 1 ;
// JRL changes end
this . _notificationLeftMouseY = - 1 ;
this . _notificationWidget . opacity = 0 ;
}
this . _notificationState = State . HIDDEN ;
this . _hideNotificationCompleted ( ) ;
if ( animate ) {
} else {
this . _tween ( this . _notificationWidget , '_notificationState' , State . HIDDEN ,
this . _tween ( this . _notificationWidget , '_notificationState' , State . HIDDEN ,
// JRL changes begin
// JRL changes begin
//{ y: this.actor.height,
//{ y: this.actor.height,
@ -179,19 +171,21 @@ let extensionHideNotification = function(animate) {
onComplete : this . _hideNotificationCompleted ,
onComplete : this . _hideNotificationCompleted ,
onCompleteScope : this
onCompleteScope : this
} ) ;
} ) ;
} else {
Tweener . removeTweens ( this . _notificationWidget ) ;
// 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
else
{
{
if ( this . _notificationClickedId ) {
this . _notification . disconnect ( this . _notificationClickedId ) ;
this . _notificationClickedId = 0 ;
}
if ( this . _notificationUnfocusedId ) {
this . _notification . disconnect ( this . _notificationUnfocusedId ) ;
this . _notificationUnfocusedId = 0 ;
}
if ( ExtensionUtils . versionCheck ( [ '3.8' ] , Config . PACKAGE _VERSION ) ) {
this . _useLongerTrayLeftTimeout = false ;
this . _useLongerTrayLeftTimeout = false ;
if ( this . _trayLeftTimeoutId ) {
if ( this . _trayLeftTimeoutId ) {
Mainloop . source _remove ( this . _trayLeftTimeoutId ) ;
Mainloop . source _remove ( this . _trayLeftTimeoutId ) ;
@ -224,19 +218,16 @@ let extensionHideNotification = function(animate) {
}
}
}
}
}
else
else
{
{
if ( this . _notificationLeftTimeoutId ) {
Mainloop . source _remove ( this . _notificationLeftTimeoutId ) ;
this . _notificationLeftTimeoutId = 0 ;
this . _notificationLeftMouseX = - 1 ;
this . _notificationLeftMouseY = - 1 ;
}
if ( this . _notificationRemoved ) {
if ( animate ) {
// 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 ,
this . _tween ( this . _notificationWidget , '_notificationState' , State . HIDDEN ,
// JRL changes begin
// JRL changes begin
//{ y: this.actor.height,
//{ y: this.actor.height,
@ -248,7 +239,16 @@ let extensionHideNotification = function(animate) {
onComplete : this . _hideNotificationCompleted ,
onComplete : this . _hideNotificationCompleted ,
onCompleteScope : this
onCompleteScope : this
} ) ;
} ) ;
} else {
Tweener . removeTweens ( this . _notificationWidget ) ;
// 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 ( ) ;
}
}
}
}
}
}
}
@ -268,7 +268,13 @@ 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 ) ) {
if ( ExtensionUtils . versionCheck ( [ '3.6' ] , Config . PACKAGE _VERSION ) ) {
// We auto-expand notifications with CRITICAL urgency.
if ( this . _notification . urgency == Urgency . CRITICAL )
this . _expandNotification ( true ) ;
}
else
{
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.
@ -276,12 +282,6 @@ let extensionUpdateShowingNotification = function() {
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.