appDisplay: Restore dragged item's position on drag cancel
Otherwise we end up with the grid in an inconsistent state. https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
This commit is contained in:
parent
d1cbf6c7a9
commit
701d110493
@ -685,6 +685,7 @@ class AppDisplay extends BaseAppView {
|
|||||||
|
|
||||||
Main.overview.connect('item-drag-begin', this._onDragBegin.bind(this));
|
Main.overview.connect('item-drag-begin', this._onDragBegin.bind(this));
|
||||||
Main.overview.connect('item-drag-end', this._onDragEnd.bind(this));
|
Main.overview.connect('item-drag-end', this._onDragEnd.bind(this));
|
||||||
|
Main.overview.connect('item-drag-cancelled', this._onDragCancelled.bind(this));
|
||||||
|
|
||||||
this.connect('destroy', this._onDestroy.bind(this));
|
this.connect('destroy', this._onDestroy.bind(this));
|
||||||
|
|
||||||
@ -1073,6 +1074,17 @@ class AppDisplay extends BaseAppView {
|
|||||||
this._resetOvershoot();
|
this._resetOvershoot();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_onDragCancelled(_overview, source) {
|
||||||
|
const view = _getViewFromIcon(source);
|
||||||
|
|
||||||
|
if (view instanceof FolderView)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// At this point, the positions aren't stored yet, thus _redisplay()
|
||||||
|
// will move all items to their original positions
|
||||||
|
this._redisplay();
|
||||||
|
}
|
||||||
|
|
||||||
_canAccept(source) {
|
_canAccept(source) {
|
||||||
return source instanceof AppViewItem;
|
return source instanceof AppViewItem;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user