workspacesView: Override vfunc_hide

Override the hide vfunc instead of the plain hide() method.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1295
This commit is contained in:
Georges Basile Stavracas Neto 2020-06-02 14:15:45 -03:00
parent e7ec373aee
commit 8914a46669

View File

@ -393,7 +393,10 @@ class ExtraWorkspaceView extends WorkspacesViewBase {
var WorkspacesDisplay = GObject.registerClass( var WorkspacesDisplay = GObject.registerClass(
class WorkspacesDisplay extends St.Widget { class WorkspacesDisplay extends St.Widget {
_init(scrollAdjustment) { _init(scrollAdjustment) {
super._init({ clip_to_allocation: true }); super._init({
visible: false,
clip_to_allocation: true,
});
this.connect('notify::allocation', this._updateWorkspacesActualGeometry.bind(this)); this.connect('notify::allocation', this._updateWorkspacesActualGeometry.bind(this));
let workspaceManager = global.workspace_manager; let workspaceManager = global.workspace_manager;
@ -609,6 +612,7 @@ class WorkspacesDisplay extends St.Widget {
} }
animateToOverview(fadeOnPrimary) { animateToOverview(fadeOnPrimary) {
this.show();
this._updateWorkspacesViews(); this._updateWorkspacesViews();
for (let i = 0; i < this._workspacesViews.length; i++) { for (let i = 0; i < this._workspacesViews.length; i++) {
let animationType; let animationType;
@ -640,7 +644,7 @@ class WorkspacesDisplay extends St.Widget {
} }
} }
hide() { vfunc_hide() {
if (this._restackedNotifyId > 0) { if (this._restackedNotifyId > 0) {
Main.overview.disconnect(this._restackedNotifyId); Main.overview.disconnect(this._restackedNotifyId);
this._restackedNotifyId = 0; this._restackedNotifyId = 0;
@ -656,6 +660,8 @@ class WorkspacesDisplay extends St.Widget {
for (let i = 0; i < this._workspacesViews.length; i++) for (let i = 0; i < this._workspacesViews.length; i++)
this._workspacesViews[i].destroy(); this._workspacesViews[i].destroy();
this._workspacesViews = []; this._workspacesViews = [];
super.vfunc_hide();
} }
_workspacesOnlyOnPrimaryChanged() { _workspacesOnlyOnPrimaryChanged() {