[gnome-shell/gbsneto/icon-grid-part2: 14/23] appDisplay: Add event blocker inhibition API



commit 524687cbd7b1bad2e01a0399be556f5e10883c59
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Fri Jun 28 19:44:20 2019 -0300

    appDisplay: Add event blocker inhibition API
    
    The event blocker is an actor that is added in between the
    icon grid and the app folder popup in order to guarantee
    that clicking outside the app folder will collapse it.
    
    However, the next patch will require allowing dragging events
    to be passed to folder icons, and the event blocker gets in
    our way here, preventing drag n' drop to work properly.
    
    Add an API to inhibit the event blocker. This API will be
    used by the app folders while an item is dragged.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/664

 js/ui/appDisplay.js | 12 ++++++++++++
 1 file changed, 12 insertions(+)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index b26951e3c..5988478f9 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -325,6 +325,8 @@ var AllView = class AllView extends BaseAppView {
         this._folderSettings.connect('changed::folder-children', () => {
             Main.queueDeferredWork(this._redisplayWorkId);
         });
+
+        this._nEventBlockerInhibits = 0;
     }
 
     _redisplay() {
@@ -659,6 +661,16 @@ var AllView = class AllView extends BaseAppView {
         for (let i = 0; i < this.folderIcons.length; i++)
             this.folderIcons[i].adaptToSize(availWidth, availHeight);
     }
+
+    inhibitEventBlocker() {
+        this._nEventBlockerInhibits++;
+        this._eventBlocker.visible = this._nEventBlockerInhibits == 0;
+    }
+
+    uninhibitEventBlocker() {
+        this._nEventBlockerInhibits--;
+        this._eventBlocker.visible = this._nEventBlockerInhibits == 0;
+    }
 };
 Signals.addSignalMethods(AllView.prototype);
 


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