Dash: don't show a tooltip over an application with a popup menu
If the popup menu associated with the application icon is open, make sure that the tooltip is hidden. https://bugzilla.gnome.org/show_bug.cgi?id=705611
This commit is contained in:
parent
8b93c97a09
commit
1b206fe94c
@ -878,6 +878,7 @@ const AppIcon = new Lang.Class({
|
|||||||
this.actor.set_hover(true);
|
this.actor.set_hover(true);
|
||||||
this._menu.popup();
|
this._menu.popup();
|
||||||
this._menuManager.ignoreRelease();
|
this._menuManager.ignoreRelease();
|
||||||
|
this.emit('sync-tooltip');
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
@ -924,7 +925,11 @@ const AppIcon = new Lang.Class({
|
|||||||
// we show as the item is being dragged.
|
// we show as the item is being dragged.
|
||||||
getDragActorSource: function() {
|
getDragActorSource: function() {
|
||||||
return this.icon.icon;
|
return this.icon.icon;
|
||||||
}
|
},
|
||||||
|
|
||||||
|
shouldShowTooltip: function() {
|
||||||
|
return this.actor.hover && (!this._menu || !this._menu.isOpen);
|
||||||
|
},
|
||||||
});
|
});
|
||||||
Signals.addSignalMethods(AppIcon.prototype);
|
Signals.addSignalMethods(AppIcon.prototype);
|
||||||
|
|
||||||
|
@ -502,15 +502,21 @@ const Dash = new Lang.Class({
|
|||||||
Main.queueDeferredWork(this._workId);
|
Main.queueDeferredWork(this._workId);
|
||||||
},
|
},
|
||||||
|
|
||||||
_hookUpLabel: function(item) {
|
_hookUpLabel: function(item, appIcon) {
|
||||||
item.child.connect('notify::hover', Lang.bind(this, function() {
|
item.child.connect('notify::hover', Lang.bind(this, function() {
|
||||||
this._onHover(item);
|
this._syncLabel(item, appIcon);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
Main.overview.connect('hiding', Lang.bind(this, function() {
|
Main.overview.connect('hiding', Lang.bind(this, function() {
|
||||||
this._labelShowing = false;
|
this._labelShowing = false;
|
||||||
item.hideLabel();
|
item.hideLabel();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
if (appIcon) {
|
||||||
|
appIcon.connect('sync-tooltip', Lang.bind(this, function() {
|
||||||
|
this._syncLabel(item, appIcon);
|
||||||
|
}));
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_createAppItem: function(app) {
|
_createAppItem: function(app) {
|
||||||
@ -539,7 +545,7 @@ const Dash = new Lang.Class({
|
|||||||
item.setLabelText(app.get_name());
|
item.setLabelText(app.get_name());
|
||||||
|
|
||||||
appIcon.icon.setIconSize(this.iconSize);
|
appIcon.icon.setIconSize(this.iconSize);
|
||||||
this._hookUpLabel(item);
|
this._hookUpLabel(item, appIcon);
|
||||||
|
|
||||||
return item;
|
return item;
|
||||||
},
|
},
|
||||||
@ -557,8 +563,10 @@ const Dash = new Lang.Class({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_onHover: function (item) {
|
_syncLabel: function (item, appIcon) {
|
||||||
if (item.child.get_hover()) {
|
let shouldShow = appIcon ? appIcon.shouldShowTooltip() : item.child.get_hover();
|
||||||
|
|
||||||
|
if (shouldShow) {
|
||||||
if (this._showLabelTimeoutId == 0) {
|
if (this._showLabelTimeoutId == 0) {
|
||||||
let timeout = this._labelShowing ? 0 : DASH_ITEM_HOVER_TIMEOUT;
|
let timeout = this._labelShowing ? 0 : DASH_ITEM_HOVER_TIMEOUT;
|
||||||
this._showLabelTimeoutId = Mainloop.timeout_add(timeout,
|
this._showLabelTimeoutId = Mainloop.timeout_add(timeout,
|
||||||
|
Loading…
Reference in New Issue
Block a user