workspaceThumbnail: handle show/hide when entering/leaving the overview
Handle this internally, instead of having WorkspacesDisplay show/hide us. https://bugzilla.gnome.org/show_bug.cgi?id=690175
This commit is contained in:
parent
9f98f6f02d
commit
d2c6149923
@ -546,6 +546,11 @@ const ThumbnailsBox = new Lang.Class({
|
|||||||
this.actor.connect('button-release-event', Lang.bind(this, this._onButtonRelease));
|
this.actor.connect('button-release-event', Lang.bind(this, this._onButtonRelease));
|
||||||
this.actor.connect('scroll-event', Lang.bind(this, this._onScrollEvent));
|
this.actor.connect('scroll-event', Lang.bind(this, this._onScrollEvent));
|
||||||
|
|
||||||
|
Main.overview.connect('showing',
|
||||||
|
Lang.bind(this, this._createThumbnails));
|
||||||
|
Main.overview.connect('hidden',
|
||||||
|
Lang.bind(this, this._destroyThumbnails));
|
||||||
|
|
||||||
Main.overview.connect('item-drag-begin',
|
Main.overview.connect('item-drag-begin',
|
||||||
Lang.bind(this, this._onDragBegin));
|
Lang.bind(this, this._onDragBegin));
|
||||||
Main.overview.connect('item-drag-end',
|
Main.overview.connect('item-drag-end',
|
||||||
@ -733,7 +738,7 @@ const ThumbnailsBox = new Lang.Class({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
show: function() {
|
_createThumbnails: function() {
|
||||||
this._switchWorkspaceNotifyId =
|
this._switchWorkspaceNotifyId =
|
||||||
global.window_manager.connect('switch-workspace',
|
global.window_manager.connect('switch-workspace',
|
||||||
Lang.bind(this, this._activeWorkspaceChanged));
|
Lang.bind(this, this._activeWorkspaceChanged));
|
||||||
@ -765,7 +770,7 @@ const ThumbnailsBox = new Lang.Class({
|
|||||||
this._updateSwitcherVisibility();
|
this._updateSwitcherVisibility();
|
||||||
},
|
},
|
||||||
|
|
||||||
hide: function() {
|
_destroyThumbnails: function() {
|
||||||
if (this._switchWorkspaceNotifyId > 0) {
|
if (this._switchWorkspaceNotifyId > 0) {
|
||||||
global.window_manager.disconnect(this._switchWorkspaceNotifyId);
|
global.window_manager.disconnect(this._switchWorkspaceNotifyId);
|
||||||
this._switchWorkspaceNotifyId = 0;
|
this._switchWorkspaceNotifyId = 0;
|
||||||
|
@ -573,7 +573,6 @@ const WorkspacesDisplay = new Lang.Class({
|
|||||||
this._updateZoom();
|
this._updateZoom();
|
||||||
|
|
||||||
this._controls.show();
|
this._controls.show();
|
||||||
this._thumbnailsBox.show();
|
|
||||||
|
|
||||||
this._updateWorkspacesViews();
|
this._updateWorkspacesViews();
|
||||||
|
|
||||||
@ -611,7 +610,6 @@ const WorkspacesDisplay = new Lang.Class({
|
|||||||
|
|
||||||
hide: function() {
|
hide: function() {
|
||||||
this._controls.hide();
|
this._controls.hide();
|
||||||
this._thumbnailsBox.hide();
|
|
||||||
|
|
||||||
if (!this._alwaysZoomOut)
|
if (!this._alwaysZoomOut)
|
||||||
this.zoomFraction = 0;
|
this.zoomFraction = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user