[gnome-shell/gbsneto/icon-grid-dnd: 61/96] 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: 61/96] folderView: Block DnD in folder view
- Date: Tue, 16 Jul 2019 23:27:15 +0000 (UTC)
commit 0405f3f4e5683b3e2a386f6b209c0b535d20819c
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 5dd9f445b..ac95cad0d 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -1084,6 +1084,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);
@@ -1187,6 +1188,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]