[gnome-shell/gbsneto/icon-grid-dnd: 12/18] folderView: Block DnD in folder view
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gbsneto/icon-grid-dnd: 12/18] folderView: Block DnD in folder view
- Date: Sat, 29 Jun 2019 20:45:06 +0000 (UTC)
commit 692160324930f0185819864453ac12cf7ecc5807
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Sat Jun 29 01:27:25 2019 -0300
folderView: Block DnD in folder view
Dropping an app icon inside the folder it already is
removes it from there. That's because none of the
actors inside the folder actually prevent the DnD from
happening.
Block DnD from propagating up to AllView by making
FolderView implement the Draggable interface.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/603
js/ui/appDisplay.js | 10 ++++++++++
1 file changed, 10 insertions(+)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index a23b36932..fd29338c0 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -1099,6 +1099,7 @@ var FolderView = class FolderView extends BaseAppView {
// the second time it allocates, so we apply the "Standard hack for ClutterBinLayout"
this._grid.x_expand = true;
this._folderIcon = folderIcon;
+ this._grid._delegate = this;
this.actor = new St.ScrollView({ overlay_scrollbars: true });
this.actor.set_policy(St.PolicyType.NEVER, St.PolicyType.AUTOMATIC);
@@ -1202,6 +1203,15 @@ var FolderView = class FolderView extends BaseAppView {
this._offsetForEachSide = offset;
}
+ handleDragOver(source, actor, x, y, time) {
+ return DND.DragMotionResult.NO_DROP;
+ }
+
+ acceptDrop(source, actor, x, y, time) {
+ // Only dropping at the folder icon is accepted
+ return true;
+ }
+
get folderIcon() {
return this._folderIcon;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]