overview: Send the clone with the window-drag events

This allows clients that care about the actual item we're dragging to
make smarter decisions without adding a drag monitor themselves.
This commit is contained in:
Jasper St. Pierre 2013-09-11 14:20:39 -04:00
parent 026fd4cf35
commit e4c07875a3
3 changed files with 18 additions and 18 deletions

View File

@ -443,17 +443,17 @@ const Overview = new Lang.Class({
this._inDrag = false; this._inDrag = false;
}, },
beginWindowDrag: function(source) { beginWindowDrag: function(clone) {
this.emit('window-drag-begin'); this.emit('window-drag-begin', clone);
this._inDrag = true; this._inDrag = true;
}, },
cancelledWindowDrag: function(source) { cancelledWindowDrag: function(clone) {
this.emit('window-drag-cancelled'); this.emit('window-drag-cancelled', clone);
}, },
endWindowDrag: function(source) { endWindowDrag: function(clone) {
this.emit('window-drag-end'); this.emit('window-drag-end', clone);
this._inDrag = false; this._inDrag = false;
}, },

View File

@ -1468,17 +1468,17 @@ const Workspace = new Lang.Class({
clone.connect('selected', clone.connect('selected',
Lang.bind(this, this._onCloneSelected)); Lang.bind(this, this._onCloneSelected));
clone.connect('drag-begin', clone.connect('drag-begin',
Lang.bind(this, function(clone) { Lang.bind(this, function() {
Main.overview.beginWindowDrag(); Main.overview.beginWindowDrag(clone);
overlay.hide(); overlay.hide();
})); }));
clone.connect('drag-cancelled', clone.connect('drag-cancelled',
Lang.bind(this, function(clone) { Lang.bind(this, function() {
Main.overview.cancelledWindowDrag(); Main.overview.cancelledWindowDrag(clone);
})); }));
clone.connect('drag-end', clone.connect('drag-end',
Lang.bind(this, function(clone) { Lang.bind(this, function() {
Main.overview.endWindowDrag(); Main.overview.endWindowDrag(clone);
overlay.show(); overlay.show();
})); }));
clone.connect('size-changed', clone.connect('size-changed',

View File

@ -438,16 +438,16 @@ const WorkspaceThumbnail = new Lang.Class({
this.activate(time); this.activate(time);
})); }));
clone.connect('drag-begin', clone.connect('drag-begin',
Lang.bind(this, function(clone) { Lang.bind(this, function() {
Main.overview.beginWindowDrag(); Main.overview.beginWindowDrag(clone);
})); }));
clone.connect('drag-cancelled', clone.connect('drag-cancelled',
Lang.bind(this, function(clone) { Lang.bind(this, function() {
Main.overview.cancelledWindowDrag(); Main.overview.cancelledWindowDrag(clone);
})); }));
clone.connect('drag-end', clone.connect('drag-end',
Lang.bind(this, function(clone) { Lang.bind(this, function() {
Main.overview.endWindowDrag(); Main.overview.endWindowDrag(clone);
})); }));
this._contents.add_actor(clone.actor); this._contents.add_actor(clone.actor);