Force update of favorite indicator when grouped/isolated

This commit is contained in:
Charles Gagnon
2019-04-11 17:49:13 -04:00
parent 394c12c6d5
commit 30764fd16e
3 changed files with 20 additions and 12 deletions

View File

@@ -356,11 +356,11 @@ var taskbarAppIcon = Utils.defineClass({
onWindowsChanged: function() {
this._updateCounterClass();
this.updateIconGeometry();
this.updateIcon();
},
// Update taraget for minimization animation
updateIconGeometry: function() {
// Update indicator and target for minimization animation
updateIcon: function(updateIndicators) {
// If (for unknown reason) the actor is not on the stage the reported size
// and position are random values, which might exceeds the integer range
@@ -378,6 +378,10 @@ var taskbarAppIcon = Utils.defineClass({
windows.forEach(function(w) {
w.set_icon_geometry(rect);
});
if (updateIndicators) {
this._displayProperIndicator();
}
},
_showDots: function() {

View File

@@ -140,9 +140,9 @@ var dtpPanelManager = Utils.defineClass({
this._oldGetShowAppsButton = Main.overview.getShowAppsButton;
Main.overview.getShowAppsButton = this._newGetShowAppsButton.bind(this);
this._needsDashItemContainerAllocate = !Dash.DashItemContainer.prototype.hasOwnProperty('vfunc_allocate');
this.needsDashItemContainerAllocate = !Dash.DashItemContainer.prototype.hasOwnProperty('vfunc_allocate');
if (this._needsDashItemContainerAllocate) {
if (this.needsDashItemContainerAllocate) {
Utils.hookVfunc(Dash.DashItemContainer.prototype, 'allocate', this._newDashItemContainerAllocate);
}
@@ -239,7 +239,7 @@ var dtpPanelManager = Utils.defineClass({
Main.layoutManager.panelBox.set_size(Main.layoutManager.primaryMonitor.width, -1);
}
if (this._needsDashItemContainerAllocate) {
if (this.needsDashItemContainerAllocate) {
Utils.hookVfunc(Dash.DashItemContainer.prototype, 'allocate', function(box, flags) { this.vfunc_allocate(box, flags); });
}
},

View File

@@ -184,6 +184,7 @@ var taskbar = Utils.defineClass({
this.iconSize = 16;
this._shownInitially = false;
this._updateIndicators = false;
this._position = getPosition();
this._signalsHandler = new Utils.GlobalSignalsHandler();
@@ -248,9 +249,9 @@ var taskbar = Utils.defineClass({
// Update minimization animation target position on allocation of the
// container and on scrollview change.
this._box.connect('notify::allocation', Lang.bind(this, this._updateAppIconsGeometry));
this._box.connect('notify::allocation', Lang.bind(this, this._updateAppIcons));
let scrollViewAdjustment = this._scrollView.hscroll.adjustment;
scrollViewAdjustment.connect('notify::value', Lang.bind(this, this._updateAppIconsGeometry));
scrollViewAdjustment.connect('notify::value', Lang.bind(this, this._updateAppIcons));
this._workId = Main.initializeDeferredWork(this._box, Lang.bind(this, this._redisplay));
@@ -300,6 +301,7 @@ var taskbar = Utils.defineClass({
],
() => {
if (this._dtpSettings.get_boolean('isolate-monitors')) {
this._updateIndicators = this.isGroupApps && !this.panelWrapper.panelManager.needsDashItemContainerAllocate;
this._queueRedisplay();
}
}
@@ -665,12 +667,14 @@ var taskbar = Utils.defineClass({
});
},
_updateAppIconsGeometry: function() {
_updateAppIcons: function() {
let appIcons = this._getAppIcons();
appIcons.filter(icon => icon.constructor === AppIcons.taskbarAppIcon).forEach(function(icon) {
icon.updateIconGeometry();
appIcons.filter(icon => icon.constructor === AppIcons.taskbarAppIcon).forEach(icon => {
icon.updateIcon(this._updateIndicators);
});
this._updateIndicators = false;
},
_itemMenuStateChanged: function(item, opened) {
@@ -865,7 +869,7 @@ var taskbar = Utils.defineClass({
this._box.queue_relayout();
// This is required for icon reordering when the scrollview is used.
this._updateAppIconsGeometry();
this._updateAppIcons();
// This will update the size, and the corresponding number for each icon on the primary panel
if (!this.panelWrapper.isSecondary) {