endSessionDialog: Only show logout inhibiting apps

Apps that only inhibit other kinds of activity (like idle or suspend)
don't need to be shown to user when they are logging out.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3119

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1424>
This commit is contained in:
Michael Terry
2020-08-30 12:57:19 -04:00
committed by Marge Bot
parent ef5b92c596
commit 8850c579da
3 changed files with 16 additions and 3 deletions

View File

@ -626,8 +626,9 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
}
let app = findAppFromInhibitor(inhibitor);
const [flags] = app ? inhibitor.GetFlagsSync() : [0];
if (app) {
if (app && flags & GnomeSession.InhibitFlags.LOGOUT) {
let [description] = inhibitor.GetReasonSync();
let listItem = new Dialog.ListSectionItem({
icon_actor: app.create_icon_texture(_ITEM_ICON_SIZE),
@ -636,7 +637,8 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
});
this._applicationSection.list.add_child(listItem);
} else {
// inhibiting app is a service, not an application
// inhibiting app is a service (not an application) or is not
// inhibiting logout/shutdown
this._applications.splice(this._applications.indexOf(inhibitor), 1);
}