GNOME Bugzilla – Bug 672270
Apps blocking shutdown due to unsaved changes are not displayed in GNOME's shutdown dialog in current F17 (GNOME 3.3.90)
Last modified: 2012-03-17 14:46:23 UTC
The behaviour of GNOME Shell when trying to shut down or reboot with unsaved documents open is completely insane. If I have unsaved documents in gedit, then when I hit the 'Power Off...' button in the Shell, I get a GNOME-ish dialog - one of the black ones which blocks interaction with any other part of the desktop - which reads "Click power off to quit these applications and power off the system", and has Cancel, Restart and Power Off buttons. It's not at all clear what 'these applications' refers to. In the greyed-out rest-of-the-desktop, with which you can no longer interact, if you're paying attention, you may happen to notice that gedit has popped up a child window which reads: "Save changes to document "Unsaved Document 1" before closing? If you don't save, changes from the last 2 hours will be permanently lost." and has 'Log Out without Saving', 'Cancel Logout', and 'Save As' buttons. None of which you can press, while the GNOME-y shutdown dialog is open. If you hit Cancel on the GNOME-y shutdown dialog, *another* GNOME-y shutdown dialog immediately appears. This one reads "The system will power off automatically in 60 seconds". It again has 'Cancel', 'Restart' and 'Power Off' buttons. The gedit child window is still open, and you still can't interact with it. If you hit Cancel *again*, finally the GNOME-y dialogs go away, the desktop is active again, and you can interact with the gedit child dialog. I'm not about to hit the 'Log Out without Saving' button while I'm in the middle of typing this report, but if I remember correctly, it actually just closes the dialog without doing anything at all - no shutdown, no logout. The 'Cancel Logout' button obviously does the same thing, and 'Save As' opens the save dialog. This behaviour is obviously all messed up and makes no sense. This is with current Fedora 17, gnome-shell 3.3.90-2, gedit 3.3.7-1. It appears to have regressed somewhat from F16. In F16, the GNOME-y dialog has a little section with the gedit icon, and text 'gedit: This program is blocking logout'. If you click on the gedit icon, the GNOME-y dialog goes away and lets you interact with gedit. Hitting 'logout without saving' on the gedit dialog pops the GNOME-y dialog back up again. That seems a tad clunky, but at least it's all more or less logical.
F16 does have the problem, though, that if you cancel the first GNOME-y dialog, you get another, and if you cancel that, gedit's child dialog is still open. If you cancel the shutdown action from the GNOME-y dialog, gedit's child dialog should probably be closed, because it's not relevant any more.
so I guess this is actually just a straight-up bug that the list of blocking apps has somehow disappeared from the GNOME-y shutdown dialog in current F17 GNOME 3, really.
if this isn't a problem on other distros' 3.3.90 implementations, let me know, and I'll move it downstream.
Looking into the code, it never should have worked in the first place...
Created attachment 209974 [details] [review] endSessionDialog: Fix inhibitor list gnome-session moved away from using properties over DBus in 2008, which means that the code in GNOME 3.0 never should have worked -- but it did, which makes me suspect that it was a quirk of the GJS DBus implementation. Switch over to the proper inhibitor API, which is based on methods. If gnome-session eventually gets ported to GDBus, then we can switch back to properties.
Created attachment 209975 [details] [review] endSessionDialog: Use lookup_heuristic_basename for vendor prefix lookup Instead of duplicating the vendor prefix search in the endSessionDialog code, just use lookup_heuristic_basename, which is used with real app tracking. ... and while we're at it...
*** Bug 664508 has been marked as a duplicate of this bug. ***
Review of attachment 209974 [details] [review]: Good catch.
Review of attachment 209975 [details] [review]: Makes sense.
Attachment 209974 [details] pushed as 0960778 - endSessionDialog: Fix inhibitor list Attachment 209975 [details] pushed as 8a5faa3 - endSessionDialog: Use lookup_heuristic_basename for vendor prefix lookup