[gnome-shell/T27795: 23/138] appActivation: Integrate apps launched from the desktop with the speedwagon



commit 7b1149792256db2948b4abde74d22cc722251446
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 07543bb435..6340b2a2d5 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -4,6 +4,7 @@
 const { Clutter, Gio, GLib, GObject, Meta, Shell, St } = imports.gi;
 const Signals = imports.signals;
 
+const AppActivation = imports.ui.appActivation;
 const AppFavorites = imports.ui.appFavorites;
 const BoxPointer = imports.ui.boxpointer;
 const DND = imports.ui.dnd;
@@ -2195,22 +2196,8 @@ var AppIcon = class AppIcon {
 
     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]