Quit entire application from context menu if possible

This commit is contained in:
Charles Gagnon
2022-04-03 22:20:48 -04:00
parent bba04a56b0
commit b4acf1dd1a
2 changed files with 16 additions and 13 deletions

View File

@@ -1490,7 +1490,9 @@ function getIconPadding(monitorIndex) {
}
updateQuitText() {
let count = this.sourceActor.window ? 1 : getInterestingWindows(this.sourceActor.app).length;
let count = this.sourceActor.window ? 1 :
getInterestingWindows(this._app, this.sourceActor.dtpPanel.monitor).length;
if ( count > 0) {
let quitFromTaskbarMenuText = "";
if (count == 1)
@@ -1503,20 +1505,21 @@ function getIconPadding(monitorIndex) {
}
_quitFromTaskbar() {
let windows = this.sourceActor.window ? [this.sourceActor.window] : this._app.get_windows();
for (let i = 0; i < windows.length; i++) {
windows[i].delete(global.get_current_time());
if (this.sourceActor.window)
// ungrouped applications
this.sourceActor.window.delete(global.get_current_time());
else {
let scopedWindows = getInterestingWindows(this._app, this.sourceActor.dtpPanel.monitor)
if (scopedWindows.length == this._app.get_windows().length)
this._app.request_quit();
else
for (let i = 0; i < scopedWindows.length; i++) {
scopedWindows[i].delete(global.get_current_time());
}
}
}
};
TaskbarSecondaryMenu.prototype['_updateWindowsSection'] = function() {
if (Me.settings.get_boolean('show-window-previews')) {
this._windowSection.removeAll();
this._openWindowsHeader.hide();
} else {
this._updateWindowsSection();
}
}
/**
* This function is used for extendDashItemContainer

View File

@@ -1277,7 +1277,7 @@ var Panel = GObject.registerClass({
} else if (this._hiddenDesktopWorkspace) {
this._toggleWorkspaceWindows(false, this._hiddenDesktopWorkspace);
}
 }
}
});
this.panel.actor.add_child(this._showDesktopButton);