Skip to content

Commit

Permalink
Merge pull request #899 from autarkper/fix-menu-applet-spurious-chang…
Browse files Browse the repository at this point in the history
…e-notification

Fix menu-applet "activate-menu-applet-on-hover" change notification logic
  • Loading branch information
clefebvre committed Jul 26, 2012
2 parents 8edcb48 + e990d53 commit e841a05
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions files/usr/share/cinnamon/applets/menu@cinnamon.org/applet.js
Expand Up @@ -653,17 +653,18 @@ MyApplet.prototype = {
this.showPlaces = global.settings.get_boolean("menu-show-places");
this._refreshApps();
}));
let openOnHover = global.settings.get_boolean("activate-menu-applet-on-hover");
if (openOnHover)
this._openMenuId = this.actor.connect('enter-event', Lang.bind(this, this.openMenu));

global.settings.connect("changed::activate-menu-applet-on-hover", Lang.bind(this, function() {
let updateActivateOnHover = Lang.bind(this, function() {
if (this._openMenuId) {
this.actor.disconnect(this._openMenuId);
this._openMenuId = 0;
}
let openOnHover = global.settings.get_boolean("activate-menu-applet-on-hover");
if (openOnHover)
if (openOnHover) {
this._openMenuId = this.actor.connect('enter-event', Lang.bind(this, this.openMenu));
else
this.actor.disconnect(this._openMenuId);
}));
}
});
updateActivateOnHover();
global.settings.connect("changed::activate-menu-applet-on-hover", updateActivateOnHover);

this.menu.actor.add_style_class_name('menu-background');
this.menu.connect('open-state-changed', Lang.bind(this, this._onOpenStateChanged));
Expand Down

0 comments on commit e841a05

Please sign in to comment.