[appDisplay,placeDisplay] Remove manual dnd mode

As the special handling for St.Clickable moved into dnd, it is no
longer necessary to use manual mode in these cases.

https://bugzilla.gnome.org/show_bug.cgi?id=610385
This commit is contained in:
Florian Müllner 2010-03-27 02:35:34 +01:00
parent 04200a4281
commit feaaefd8ba
2 changed files with 6 additions and 67 deletions

View File

@ -405,13 +405,13 @@ AppWellIcon.prototype = {
this.actor.connect('clicked', Lang.bind(this, this._onClicked)); this.actor.connect('clicked', Lang.bind(this, this._onClicked));
this._menu = null; this._menu = null;
this._draggable = DND.makeDraggable(this.actor, this._draggable = DND.makeDraggable(this.actor);
{ manualMode: true }); this._draggable.connect('drag-begin', Lang.bind(this,
this._dragStartX = null; function () {
this._dragStartY = null; this._removeMenuTimeout();
}));
this.actor.connect('button-press-event', Lang.bind(this, this._onButtonPress)); 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('show', Lang.bind(this, this._onShow));
this.actor.connect('hide', Lang.bind(this, this._onHideDestroy)); this.actor.connect('hide', Lang.bind(this, this._onHideDestroy));
this.actor.connect('destroy', Lang.bind(this, this._onHideDestroy)); this.actor.connect('destroy', Lang.bind(this, this._onHideDestroy));
@ -453,10 +453,6 @@ AppWellIcon.prototype = {
}, },
_onButtonPress: function(actor, event) { _onButtonPress: function(actor, event) {
let [stageX, stageY] = event.get_coords();
this._dragStartX = stageX;
this._dragStartY = stageY;
let button = event.get_button(); let button = event.get_button();
if (button == 1) { if (button == 1) {
this._removeMenuTimeout(); 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) { _onClicked: function(actor, event) {
this._removeMenuTimeout(); this._removeMenuTimeout();
@ -630,9 +611,6 @@ AppIconMenu.prototype = {
this._arrowSize = 4; // CSS default this._arrowSize = 4; // CSS default
this._spacing = 0; // CSS default this._spacing = 0; // CSS default
this._dragStartX = 0;
this._dragStartY = 0;
this.actor = new Shell.GenericContainer({ reactive: true }); this.actor = new Shell.GenericContainer({ reactive: true });
this.actor.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth)); this.actor.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth));
this.actor.connect('get-preferred-height', Lang.bind(this, this._getPreferredHeight)); this.actor.connect('get-preferred-height', Lang.bind(this, this._getPreferredHeight));

View File

@ -440,18 +440,9 @@ DashPlaceDisplayItem.prototype = {
} }
this.actor.connect('clicked', Lang.bind(this, this._onClicked)); 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.actor._delegate = this;
this._dragStartX = null; this._draggable = DND.makeDraggable(this.actor);
this._dragStartY = null;
this._draggable = DND.makeDraggable(this.actor,
{ manualMode: true });
}, },
_onClicked: function(b) { _onClicked: function(b) {
@ -459,36 +450,6 @@ DashPlaceDisplayItem.prototype = {
Main.overview.hide(); 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() { getDragActorSource: function() {
return this._icon; return this._icon;
}, },