Remove the animations when switching between isolated workspaces

Only when the application instances are ungrouped
This commit is contained in:
Charles Gagnon
2018-01-18 17:53:06 -05:00
parent 22464cccac
commit 027d9e86b1
4 changed files with 35 additions and 32 deletions

View File

@@ -465,9 +465,15 @@ var taskbarAppIcon = new Lang.Class({
this._dtpSettings.get_int('focus-highlight-opacity') * 0.01);
}
// graphical glitches if i dont set this on a timeout
if(this.actor.get_style() != inlineStyle)
Mainloop.timeout_add(0, Lang.bind(this, function() { this.actor.set_style(inlineStyle); }));
if(this.actor.get_style() != inlineStyle) {
if (!this._isGroupApps) {
//when the apps are ungrouped, set the style synchronously so the icons don't jump around on taskbar redraw
this.actor.set_style(inlineStyle);
} else {
//graphical glitches if i dont set this on a timeout
Mainloop.timeout_add(0, Lang.bind(this, function() { this.actor.set_style(inlineStyle); }));
}
}
},
popupMenu: function() {

View File

@@ -114,7 +114,7 @@ var dtpOverview = new Lang.Class({
this._signalsHandler.addWithLabel(label, [
global.window_manager,
'switch-workspace',
Lang.bind(this.taskbar, this.taskbar._queueRedisplay)
() => this.taskbar.handleIsolatedWorkspaceSwitch()
]);
}

View File

@@ -165,7 +165,6 @@ var taskbar = new Lang.Class({
_init : function(settings) {
this._dtpSettings = settings;
this._maxWidth = -1;
// start at smallest size due to running indicator drawing area expanding but not shrinking
this.iconSize = baseIconSizes[0];
@@ -227,18 +226,8 @@ var taskbar = new Lang.Class({
y_align: St.Align.START, x_align:rtl?St.Align.END:St.Align.START
});
Main.panel.actor.connect('notify::height', Lang.bind(this,
function() {
this._queueRedisplay();
}));
Main.panel.actor.connect('notify::width', Lang.bind(this,
function() {
if (this._maxWidth < this.actor.width) {
this._maxWidth = this.actor.width;
this._queueRedisplay();
}
}));
Main.panel.actor.connect('notify::height', Lang.bind(this, this._queueRedisplay));
Main.panel.actor.connect('notify::width', Lang.bind(this, this._queueRedisplay));
// Update minimization animation target position on allocation of the
// container and on scrollview change.
@@ -445,6 +434,14 @@ var taskbar = new Lang.Class({
return ids;
},
handleIsolatedWorkspaceSwitch: function() {
if (this.isGroupApps) {
return this._queueRedisplay();
}
this.resetAppIcons();
},
_connectWorkspaceSignals: function() {
this._disconnectWorkspaceSignals();
@@ -678,9 +675,6 @@ var taskbar = new Lang.Class({
iconChildren.push(this._showAppsIcon);
if (this._maxWidth == -1)
return;
let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
let iconSizes = this._availableIconSizes.map(function(s) {
return s * scaleFactor;
@@ -724,14 +718,14 @@ var taskbar = new Lang.Class({
// Scale the icon's texture to the previous size and
// tween to the new size
icon.icon.set_size(icon.icon.width * scale,
icon.icon.height * scale);
icon.icon.height * scale);
Tweener.addTween(icon.icon,
{ width: targetWidth,
height: targetHeight,
time: DASH_ANIMATION_TIME,
transition: 'easeOutQuad',
});
{ width: targetWidth,
height: targetHeight,
time: DASH_ANIMATION_TIME,
transition: 'easeOutQuad',
});
}
},
@@ -775,11 +769,6 @@ var taskbar = new Lang.Class({
.filter(appInfo => appInfo.windows.length || favoriteApps.indexOf(appInfo.app) >= 0);
}
// Skip animations on first run when adding the initial set
// of items, to avoid all items zooming in at once
let animate = this._shownInitially;
this._shownInitially = true;
//remove the appIcons which are not in the expected apps list
for (let i = currentAppIcons.length - 1; i > -1; --i) {
let appIcon = currentAppIcons[i].child._delegate;
@@ -821,7 +810,9 @@ var taskbar = new Lang.Class({
// Emit a custom signal notifying that a new item has been added
this.emit('item-added', newAppIcon);
newAppIcon.show(animate);
// Skip animations on first run when adding the initial set
// of items, to avoid all items zooming in at once
newAppIcon.show(this._shownInitially);
}
++currentPosition;
@@ -842,6 +833,8 @@ var taskbar = new Lang.Class({
// Connect windows previews to hover events
this._toggleWindowPreview();
this._shownInitially = true;
},
_getRunningApps: function() {

View File

@@ -683,6 +683,10 @@ var thumbnailPreview = new Lang.Class({
},
_onResize: function() {
if (!this.preview) {
return;
}
let [width, height] = this.preview.get_source().get_size();
this.scale = Math.min(1.0, this._thumbnailWidth / width, this._thumbnailHeight / height);
this.preview.set_size(width * this.scale, height * this.scale);