From 927f3036b6209c7d5745aaf95d15dc49c1ac307b Mon Sep 17 00:00:00 2001 From: Jens Lody Date: Fri, 26 Sep 2014 09:50:35 +0200 Subject: [PATCH] updates for gnome-shell 3.14 --- data/metadata.json.in | 2 +- src/extension.js | 47 +++++++++++++++++++++++++++++++++---------- 2 files changed, 37 insertions(+), 12 deletions(-) diff --git a/data/metadata.json.in b/data/metadata.json.in index f3449a4..d51576b 100644 --- a/data/metadata.json.in +++ b/data/metadata.json.in @@ -2,7 +2,7 @@ "uuid": "@uuid@", "name": "Panel OSD", "description": "Configuring where on the (main) screen notifications will appear, instead of just above the message tray", -"shell-version": [ "3.6", "3.8", "3.10", "3.12" ], +"shell-version": [ "3.6", "3.8", "3.10", "3.12", "3.14" ], "localedir": "@LOCALEDIR@", "url": "@url@" } diff --git a/src/extension.js b/src/extension.js index 965ccc4..e536295 100644 --- a/src/extension.js +++ b/src/extension.js @@ -186,6 +186,9 @@ let extensionShowNotification = function() { // the mouse is moving towards it or within it. this._lastSeenMouseX = x; this._lastSeenMouseY = y; + if (ExtensionUtils.versionCheck(['3.14'], Config.PACKAGE_VERSION)) { + this._resetNotificationLeftTimeout(); + } }; @@ -299,11 +302,17 @@ let extensionHideNotification = function(animate) { } else { - if (this._notificationLeftTimeoutId) { - Mainloop.source_remove(this._notificationLeftTimeoutId); - this._notificationLeftTimeoutId = 0; - this._notificationLeftMouseX = -1; - this._notificationLeftMouseY = -1; + if (ExtensionUtils.versionCheck(['3.14'], Config.PACKAGE_VERSION)) { + this._resetNotificationLeftTimeout(); + } + else + { + if (this._notificationLeftTimeoutId) { + Mainloop.source_remove(this._notificationLeftTimeoutId); + this._notificationLeftTimeoutId = 0; + this._notificationLeftMouseX = -1; + this._notificationLeftMouseY = -1; + } } if (animate) { @@ -458,12 +467,28 @@ let extensiononNotificationExpanded = function() { } else if (this._notification.y != expandedY) { // Tween also opacity here, to override a possible tween that's // currently hiding the notification. - this._tween(this._notificationWidget, '_notificationState', State.SHOWN, - { y: expandedY, - opacity: 255, - time: ANIMATION_TIME, - transition: 'easeOutQuad' - }); + if (ExtensionUtils.versionCheck(['3.14'], Config.PACKAGE_VERSION)) { + Tweener.addTween(this._notificationWidget, + { y: expandedY, + opacity: 255, + time: ANIMATION_TIME, + transition: 'easeOutQuad', + // HACK: Drive the state machine here better, + // instead of overwriting tweens + onComplete: Lang.bind(this, function() { + this._notificationState = State.SHOWN; + }), + }); + } + else + { + this._tween(this._notificationWidget, '_notificationState', State.SHOWN, + { y: expandedY, + opacity: 255, + time: ANIMATION_TIME, + transition: 'easeOutQuad' + }); + } } };