appDisplay: Animate launch of new-window action in the AppIconMenu

We add our own "New Window" menu entry if the app doesn't already
provide a 'new-window' action. For this menu entry, we show the zoom out
animation on the app icon when the user clicks the entry.

To be consistent in case the app already provides its own 'new-window'
action via its AppInfo, also show the zoom out animation when this
action is activated.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/662
This commit is contained in:
Jonas Dreßler 2019-08-02 14:23:13 +02:00 committed by Florian Müllner
parent c0047cd11d
commit 73850fee02

View File

@ -2060,6 +2060,10 @@ var AppIconMenu = class AppIconMenu extends PopupMenu.PopupMenu {
let action = actions[i];
let item = this._appendMenuItem(appInfo.get_action_name(action));
item.connect('activate', (emitter, event) => {
if (action == 'new-window' &&
this._source.app.state == Shell.AppState.STOPPED)
this._source.animateLaunch();
this._source.app.launch_action(action, event.get_time(), -1);
this.emit('activate-window', null);
});