diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index 0b979d64a..3e589f463 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -405,13 +405,13 @@ AppWellIcon.prototype = { this.actor.connect('clicked', Lang.bind(this, this._onClicked)); this._menu = null; - this._draggable = DND.makeDraggable(this.actor, - { manualMode: true }); - this._dragStartX = null; - this._dragStartY = null; + this._draggable = DND.makeDraggable(this.actor); + this._draggable.connect('drag-begin', Lang.bind(this, + function () { + this._removeMenuTimeout(); + })); this.actor.connect('button-press-event', Lang.bind(this, this._onButtonPress)); - this.actor.connect('notify::hover', Lang.bind(this, this._onHoverChange)); this.actor.connect('show', Lang.bind(this, this._onShow)); this.actor.connect('hide', Lang.bind(this, this._onHideDestroy)); this.actor.connect('destroy', Lang.bind(this, this._onHideDestroy)); @@ -453,10 +453,6 @@ AppWellIcon.prototype = { }, _onButtonPress: function(actor, event) { - let [stageX, stageY] = event.get_coords(); - this._dragStartX = stageX; - this._dragStartY = stageY; - let button = event.get_button(); if (button == 1) { this._removeMenuTimeout(); @@ -467,21 +463,6 @@ AppWellIcon.prototype = { } }, - _onHoverChange: function(actor) { - let hover = this.actor.hover; - if (!hover) { - if (this.actor.held && this._dragStartX != null) { - this.actor.fake_release(); - this._removeMenuTimeout(); - this._draggable.startDrag(this._dragStartX, this._dragStartY, - global.get_current_time()); - } else { - this._dragStartX = null; - this._dragStartY = null; - } - } - }, - _onClicked: function(actor, event) { this._removeMenuTimeout(); @@ -630,9 +611,6 @@ AppIconMenu.prototype = { this._arrowSize = 4; // CSS default this._spacing = 0; // CSS default - this._dragStartX = 0; - this._dragStartY = 0; - this.actor = new Shell.GenericContainer({ reactive: true }); this.actor.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth)); this.actor.connect('get-preferred-height', Lang.bind(this, this._getPreferredHeight)); diff --git a/js/ui/placeDisplay.js b/js/ui/placeDisplay.js index 9c2a58b88..9361d67fa 100644 --- a/js/ui/placeDisplay.js +++ b/js/ui/placeDisplay.js @@ -440,18 +440,9 @@ DashPlaceDisplayItem.prototype = { } this.actor.connect('clicked', Lang.bind(this, this._onClicked)); - this.actor.connect('notify::hover', - Lang.bind(this, this._onHoverChanged)); - this.actor.connect('button-press-event', - Lang.bind(this, this._onButtonPress)); - this.actor.connect('button-release-event', - Lang.bind(this, this._onButtonRelease)); this.actor._delegate = this; - this._dragStartX = null; - this._dragStartY = null; - this._draggable = DND.makeDraggable(this.actor, - { manualMode: true }); + this._draggable = DND.makeDraggable(this.actor); }, _onClicked: function(b) { @@ -459,36 +450,6 @@ DashPlaceDisplayItem.prototype = { Main.overview.hide(); }, - _onButtonPress: function(actor, event) { - if (event.get_button() != 1) - return false; - - let [stageX, stageY] = event.get_coords(); - this._dragStartX = stageX; - this._dragStartY = stageY; - return false; - }, - - _onButtonRelease: function(actor, event) { - if (event.get_button() != 1) - return false; - - this._dragStartX = null; - this._dragStartY = null; - return false; - }, - - _onHoverChanged: function(button) { - let hover = button.hover; - if (!hover) { - if (button.held && this._dragStartX != null) { - button.fake_release(); - this._draggable.startDrag(this._dragStartX, this._dragStartY, - global.get_current_time()); - } - } - }, - getDragActorSource: function() { return this._icon; },