[gnome-shell] appDisplay: Do not duplicate "New Window" action



commit 12cb023050dd168929347f2954174d038ed6e4a0
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Feb 13 02:03:33 2015 +0100

    appDisplay: Do not duplicate "New Window" action
    
    We assume that applications that export a 'new-window' action can open
    a new window, so we add an appropriate entry to the context menu.
    However this duplicates functionality if the application already
    exposes the action via the desktop file - don't add our own entry
    in that case.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=744446

 js/ui/appDisplay.js |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 066c44a..3549f9a 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -1820,7 +1820,10 @@ const AppIconMenu = new Lang.Class({
         if (!this._source.app.is_window_backed()) {
             this._appendSeparator();
 
-            if (this._source.app.can_open_new_window()) {
+            let appInfo = this._source.app.get_app_info();
+            let actions = appInfo.list_actions();
+            if (this._source.app.can_open_new_window() &&
+                actions.indexOf('new-window') == -1) {
                 this._newWindowMenuItem = this._appendMenuItem(_("New Window"));
                 this._newWindowMenuItem.connect('activate', Lang.bind(this, function() {
                     if (this._source.app.state == Shell.AppState.STOPPED)
@@ -1832,8 +1835,6 @@ const AppIconMenu = new Lang.Class({
                 this._appendSeparator();
             }
 
-            let appInfo = this._source.app.get_app_info();
-            let actions = appInfo.list_actions();
             for (let i = 0; i < actions.length; i++) {
                 let action = actions[i];
                 let item = this._appendMenuItem(appInfo.get_action_name(action));


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