can_open_new_window already checks for new-window action

This commit is contained in:
Charles Gagnon
2023-03-06 09:29:59 -05:00
parent 7713874028
commit 2c56572c1a

View File

@@ -1004,18 +1004,11 @@ var TaskbarAppIcon = GObject.registerClass({
_launchNewInstance() {
if (this.app.can_open_new_window() && this.app.state == Shell.AppState.RUNNING) {
let appActions = this.app.get_app_info().list_actions();
let newWindowIndex = appActions.indexOf('new-window');
if(Me.settings.get_boolean('animate-window-launch')) {
this.animateLaunch();
}
if (newWindowIndex < 0) {
this.app.open_new_window(-1);
} else {
this.app.launch_action(appActions[newWindowIndex], global.get_current_time(), -1);
}
this.app.open_new_window(-1);
} else {
let windows = this.window ? [this.window] : this.app.get_windows();