From 12cb023050dd168929347f2954174d038ed6e4a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 13 Feb 2015 02:03:33 +0100 Subject: [PATCH] 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 file changed, 4 insertions(+), 3 deletions(-) diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index 066c44af4..3549f9a9e 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));