[gnome-shell/eos3.8: 207/255] fixup! Allow opening the background menu popup from the APPS view



commit 9e799efdab7536d70948501d8f8dd4bdc99ec436
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Wed Apr 8 15:29:05 2020 -0300

    fixup! Allow opening the background menu popup from the APPS view
    
    Only add the actions for the main app display.
    
    https://phabricator.endlessm.com/T29728

 js/ui/appDisplay.js | 28 +++++++++++++++++-----------
 1 file changed, 17 insertions(+), 11 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 9ec8e4ffaa..a5789d00ae 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -416,7 +416,11 @@ var BaseAppView = GObject.registerClass({
 
 var AppDisplay = GObject.registerClass(
 class AppDisplay extends BaseAppView {
-    _init() {
+    _init(params = {}) {
+        params = Params.parse(params, {
+            addBackgroundAction: true,
+        });
+
         super._init({
             layout_manager: new Clutter.BinLayout(),
             x_expand: true,
@@ -493,18 +497,19 @@ class AppDisplay extends BaseAppView {
             if (!this._currentDialog.contains(actor))
                 this._currentDialog.popdown();
         });
-        Main.overview.addAction(this._clickAction, false);
-        this._eventBlocker.bind_property('reactive', this._clickAction,
-            'enabled', GObject.BindingFlags.SYNC_CREATE);
+        if (params.addBackgroundAction) {
+            Main.overview.addAction(this._clickAction, false);
+            this._eventBlocker.bind_property('reactive', this._clickAction,
+                'enabled', GObject.BindingFlags.SYNC_CREATE);
+        }
 
         this._bgAction = new Clutter.ClickAction();
-        Main.overview.addAction(this._bgAction);
-        BackgroundMenu.addBackgroundMenuForAction(this._bgAction, Main.layoutManager);
-        this._clickAction.bind_property('enabled', this._bgAction,
-            'enabled',
-            GObject.BindingFlags.SYNC_CREATE | GObject.BindingFlags.INVERT_BOOLEAN);
-        this.bind_property('mapped', this._bgAction,
-            'enabled', GObject.BindingFlags.SYNC_CREATE);
+        if (params.addBackgroundAction) {
+            Main.overview.addAction(this._bgAction);
+            BackgroundMenu.addBackgroundMenuForAction(this._bgAction, Main.layoutManager);
+            this._eventBlocker.bind_property('reactive', this._bgAction,
+                'enabled', GObject.BindingFlags.SYNC_CREATE | GObject.BindingFlags.INVERT_BOOLEAN);
+        }
 
         this._appCenterIcon = null;
         this._currentDialog = null;
@@ -584,6 +589,7 @@ class AppDisplay extends BaseAppView {
             this._keyPressEventId = 0;
         }
         this._swipeTracker.enabled = false;
+        this._bgAction.release();
         super.vfunc_unmap();
     }
 


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