Logout inhibit list includes apps that only inhibited suspending
Affected version
I'm using Ubuntu 20.04 with default desktop experience. GNOME Shell 3.36.4-1ubuntu1~20.04.2.
Bug summary
If an app inhibits the session with just GTK_APPLICATION_INHIBIT_SUSPEND alone, logout is also inhibited.
Steps to reproduce
Run the following python script and then try to log out:
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
def on_activate(app):
win = Gtk.ApplicationWindow.new(app)
win.set_icon_name('org.gnome.Characters')
app.inhibit(win, Gtk.ApplicationInhibitFlags.SUSPEND, 'Testing')
print('Now try logging out')
app = Gtk.Application.new('org.gnome.Characters', 0)
app.connect('activate', on_activate)
app.run()
What happened
The logout dialog shows the suspend-inhibiting app as "busy or with unsaved work".
What did you expect to happen
I would not expect the logout dialog to list the app, since it didn't try to inhibit logout.
The use case I tripped on this was the backup program deja-dup. I was trying to have it inhibit suspends (but not logouts) during a scheduled backup. This is because the backup will be resumed next time the user logs back in no problem. So there's no reason to discourage the user from logging out. But it's still worth stopping suspends to be able to finish the backup.