[gnome-shell/eos3.8: 15/255] appActivation: Integrate apps launched from the desktop with the speedwagon



commit 35ef35912c74ddc6ff9082fe1275cf5a740d8ec8
Author: Mario Sanchez Prada <mario endlessm com>
Date:   Tue Jun 27 10:12:50 2017 +0100

    appActivation: Integrate apps launched from the desktop with the speedwagon
    
    Replace the code to activate apps launched from the icon grid with
    the appropiate call from the AppActivation module, which already
    takes care of the same details, providing integration with the
    speedwagon on top.
    
    https://phabricator.endlessm.com/T17496

 js/ui/appDisplay.js | 19 +++----------------
 1 file changed, 3 insertions(+), 16 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 62a99b9fe9..1a1cdfaf0b 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -4,6 +4,7 @@
 const { Clutter, Gio, GLib, GObject, Graphene, Meta, Shell, St } = imports.gi;
 const Signals = imports.signals;
 
+const AppActivation = imports.ui.appActivation;
 const AppFavorites = imports.ui.appFavorites;
 const DND = imports.ui.dnd;
 const GrabHelper = imports.ui.grabHelper;
@@ -2229,22 +2230,8 @@ var AppIcon = GObject.registerClass({
 
     activate(button) {
         let event = Clutter.get_current_event();
-        let modifiers = event ? event.get_state() : 0;
-        let isMiddleButton = button && button == Clutter.BUTTON_MIDDLE;
-        let isCtrlPressed = (modifiers & Clutter.ModifierType.CONTROL_MASK) != 0;
-        let openNewWindow = this.app.can_open_new_window() &&
-                            this.app.state == Shell.AppState.RUNNING &&
-                            (isCtrlPressed || isMiddleButton);
-
-        if (this.app.state == Shell.AppState.STOPPED || openNewWindow)
-            this.animateLaunch();
-
-        if (openNewWindow)
-            this.app.open_new_window(-1);
-        else
-            this.app.activate();
-
-        Main.overview.hide();
+        let activationContext = new AppActivation.AppActivationContext(this.app);
+        activationContext.activate(event);
     }
 
     animateLaunch() {


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