Skip to content

Instantly share code, notes, and snippets.

@agosto-calvinbehling
Last active April 13, 2016 19:06
Show Gist options
  • Save agosto-calvinbehling/825df01de81b19fbb858bdefa476c16b to your computer and use it in GitHub Desktop.
Save agosto-calvinbehling/825df01de81b19fbb858bdefa476c16b to your computer and use it in GitHub Desktop.
notifications fix cinnamon: /usr/share/cinnamon/js/ui/messageTray.js
_onNotificationExpanded: function() {
let expandedY = this._notification.actor.height - this._notificationBin.height;
// Don't animate the notification to its new position if it has shrunk:
// there will be a very visible "gap" that breaks the illusion.
// This isn't really working at the moment, but it was just crashing before
// if it encountered a critical notification. expandedY is always 0. For now
// just make sure it's not covering the top panel if there is one.
let monitor = Main.layoutManager.primaryMonitor;
let panel = Main.panelManager.getPanel(0, false); // We only want the top panel in monitor 0
let height = 5;
if (panel)
height += panel.actor.get_height();
let newY = monitor.y + height + 50; // ADDED 50 HERE SO POPUP IS NOT OVER WINDOW CONTROLS
if (this._notificationBin.y < expandedY)
this._notificationBin.y = expandedY;
else if (this._notification.y != expandedY)
this._tween(this._notificationBin, '_notificationState', State.SHOWN,
{ y: newY,
time: ANIMATION_TIME,
transition: 'easeOutQuad'
});
_onNotificationExpanded: function() {
let expandedY = this._notification.actor.height - this._notificationBin.height;
// Don't animate the notification to its new position if it has shrunk:
// there will be a very visible "gap" that breaks the illusion.
// This isn't really working at the moment, but it was just crashing before
// if it encountered a critical notification. expandedY is always 0. For now
// just make sure it's not covering the top panel if there is one.
let monitor = Main.layoutManager.primaryMonitor;
let newY = monitor.y + (Main.panel.actor.get_height()+5);
if (this._notificationBin.y < expandedY)
this._notificationBin.y = expandedY;
else if (this._notification.y != expandedY)
this._tween(this._notificationBin, '_notificationState', State.SHOWN,
{ y: newY,
time: ANIMATION_TIME,
transition: 'easeOutQuad'
});
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment