Fix #35 (make the extension work on gnome-shell 3.34).

master
Jens Lody 5 years ago
parent eb0d3c28e2
commit 28656ac8a6
  1. 2
      data/metadata.json.in
  2. 65
      src/extension.js

@ -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.10", "3.12", "3.14", "3.16", "3.18", "3.20", "3.22", "3.24", "3.26", "3.28" ],
"shell-version": [ "3.10", "3.12", "3.14", "3.16", "3.18", "3.20", "3.22", "3.24", "3.26", "3.28", "3.30", "3.32", "3.34" ],
"localedir": "@LOCALEDIR@",
"url": "@url@",
"version": "@version@"

@ -47,6 +47,8 @@ const Me = ExtensionUtils.getCurrentExtension();
const Convenience = Me.imports.convenience;
const St = imports.gi.St;
const Meta = imports.gi.Meta;
const Clutter = imports.gi.Clutter;
const Gettext = imports.gettext.domain('gnome-shell-extension-panel-osd');
const _ = Gettext.gettext;
@ -238,7 +240,9 @@ let extensionShowNotification = function() {
this._bannerBin.add_actor(this._banner.actor);
if (!versionAtLeast('3.34', Config.PACKAGE_VERSION)) {
this._bannerBin._opacity = 0;
}
this._bannerBin.opacity = 0;
if (getY_position() < 50)
@ -269,6 +273,9 @@ let extensionShowNotification = function() {
this._notificationWidget.show();
}
if (versionAtLeast('3.30', Config.PACKAGE_VERSION)) {
Meta.disable_unredirect_for_display(global.display);
}
this._updateShowingNotification();
let [x, y, mods] = global.get_pointer();
@ -351,6 +358,39 @@ let extensionHideNotification = function(animate) {
}
}
if (versionAtLeast('3.34', Config.PACKAGE_VERSION)) {
this._bannerBin.remove_all_transitions();
if (animate) {
this._notificationState = State.HIDING;
this._bannerBin.ease({
opacity: 0,
duration: ANIMATION_TIME,
mode: Clutter.AnimationMode.EASE_OUT_BACK
});
this._bannerBin.ease({
// JRL changes begin
y: yPos,
// JRL changes end
duration: ANIMATION_TIME,
mode: Clutter.AnimationMode.EASE_OUT_BACK,
onComplete: () => {
this._notificationState = State.HIDDEN;
this._hideNotificationCompleted();
this._updateState();
}
});
} else {
// JRL changes begin
y: yPos,
// JRL changes end
this._bannerBin.opacity = 0;
this._notificationState = State.HIDDEN;
this._hideNotificationCompleted();
}
}
else
{
// JRL changes begin
let theNotification;
if (versionAtLeast('3.16', Config.PACKAGE_VERSION)) {
@ -397,6 +437,7 @@ let extensionHideNotification = function(animate) {
this._notificationState = State.HIDDEN;
this._hideNotificationCompleted();
}
}
};
@ -494,6 +535,29 @@ let extensionUpdateShowingNotification = function() {
// We use this._showNotificationCompleted() onComplete callback to extend the time the updated
// notification is being shown.
if (versionAtLeast('3.34', Config.PACKAGE_VERSION)) {
this._notificationState = State.SHOWING;
this._bannerBin.remove_all_transitions();
this._bannerBin.ease({
opacity: 255,
duration: ANIMATION_TIME,
mode: Clutter.AnimationMode.LINEAR
});
this._bannerBin.ease({
// JRL changes begin
y: yPos,
// JRL changes end
duration: ANIMATION_TIME,
mode: Clutter.AnimationMode.EASE_OUT_BACK,
onComplete: () => {
this._notificationState = State.SHOWN;
this._showNotificationCompleted();
this._updateState();
}
});
}
else
{
let tweenParams;
if (versionAtLeast('3.16', Config.PACKAGE_VERSION)) {
tweenParams = { _opacity: 255,
@ -521,6 +585,7 @@ let extensionUpdateShowingNotification = function() {
}
this._tween(theNotification, '_notificationState', State.SHOWN, tweenParams);
}
};
/*

Loading…
Cancel
Save