workspaces-display: Make workspacesView private

WorkspacesDisplay was introduced to manage the workspace objects
and views; however, the overview still accesses the view held
by the workspacesDisplay directly, which is a bit odd.
Add some additional methods needed by the overview, and make the
view a private property.

https://bugzilla.gnome.org/show_bug.cgi?id=652580
This commit is contained in:
Florian Müllner
2011-11-26 00:02:13 +01:00
parent 10df80b96a
commit f2c79be11a
4 changed files with 60 additions and 65 deletions

View File

@ -94,10 +94,11 @@ const ScaledPoint = new Lang.Class({
const WindowClone = new Lang.Class({
Name: 'WindowClone',
_init : function(realWindow) {
_init : function(realWindow, workspace) {
this.realWindow = realWindow;
this.metaWindow = realWindow.meta_window;
this.metaWindow._delegate = this;
this._workspace = workspace;
let [borderX, borderY] = this._getInvisibleBorderPadding();
this._windowClone = new Clutter.Clone({ source: realWindow.get_texture(),
@ -383,19 +384,12 @@ const WindowClone = new Lang.Class({
this.emit('drag-begin');
},
_getWorkspaceActor : function() {
let index = this.metaWindow.get_workspace().index();
return Main.overview.workspaces.getWorkspaceByIndex(index);
},
handleDragOver : function(source, actor, x, y, time) {
let workspace = this._getWorkspaceActor();
return workspace.handleDragOver(source, actor, x, y, time);
return this._workspace.handleDragOver(source, actor, x, y, time);
},
acceptDrop : function(source, actor, x, y, time) {
let workspace = this._getWorkspaceActor();
workspace.acceptDrop(source, actor, x, y, time);
this._workspace.acceptDrop(source, actor, x, y, time);
},
_onDragCancelled : function (draggable, time) {
@ -1386,7 +1380,7 @@ const Workspace = new Lang.Class({
// Create a clone of a (non-desktop) window and add it to the window list
_addWindowClone : function(win) {
let clone = new WindowClone(win);
let clone = new WindowClone(win, this);
let overlay = new WindowOverlay(clone, this._windowOverlaysGroup);
clone.connect('selected',