[gnome-shell/gbsneto/icon-grid-part3: 8/12] folderView: Move DnD functions to BaseAppView



commit e2a728a09f1fd04f41f75f3fd4d3e8ee2688990d
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Tue Jul 2 16:27:18 2019 -0300

    folderView: Move DnD functions to BaseAppView
    
    Other views, such as the Frequent view, should not accept
    dragging or dropping icons.
    
    Add handleDragOver() and acceptDrop() to BaseAppView, and
    reject them by default. With that, Frequent view forbids
    Drag n' Drop.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/671

 js/ui/appDisplay.js | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index d028e4cdbe..3b9d1e91d0 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -169,6 +169,14 @@ class BaseAppView {
             log(`No such application ${id}`);
     }
 
+    handleDragOver() {
+        return DND.DragMotionResult.NO_DROP;
+    }
+
+    acceptDrop() {
+        return false;
+    }
+
     selectApp(id) {
         if (this._items[id] && this._items[id].actor.mapped) {
             this._selectAppInternal(id);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]