GNOME Bugzilla – Bug 664508
Dialog repeated twice if an application blocks logout
Last modified: 2012-07-17 03:03:11 UTC
Steps to reproduce: - Open Emacs - Select "Logout..." from the user menu - A dialog will pop up informing that Emacs is blocking the logout process; press Cancel - Another dialog will pop up informing that I will be logged out automatically in 60 seconds I shouldn't get the second dialog in this situation, since I just cancelled the logout process.
Confirmed.
Marking as a duplicate of bug 672270, since it has patches. *** This bug has been marked as a duplicate of bug 672270 ***
(In reply to comment #2) > Marking as a duplicate of bug 672270, since it has patches. The patch isn't for that issue, though.
Not a duplicate. Adam renamed his bug to be the "missing inhibitors list", which has a patch. Investigating this, it seems to be a gnome-session bug -- we just get another request from gnome-session to open the dialog. If I make gnome-shell stop emitting the "Canceled" signal, it stops happening, so it's something in that code. Unfortunately, there isn't any easy strategy to debug gnome-session other than breaking my system, so I'll punt it over to those guys.
I can confirm this behavior is present in latest master. The problem (I guess) is that cancel causes cancel_end_session() to run which does: /* clear all JIT inhibitors */• gsm_store_foreach_remove (manager->priv->inhibitors,• (GsmStoreFunc)inhibitor_is_jit,• (gpointer)manager);• and the dialog has code like so: g_signal_connect_swapped (inhibitors, "removed",• G_CALLBACK (queue_end_session_dialog_update),• shell);• (with the callback doing: gsm_shell_open_end_session_dialog (shell,• shell->priv->end_session_dialog_type,• shell->priv->inhibitors);• ) I assume adding g_signal_handlers_disconnect_by_func (shell->priv->inhibitors,• G_CALLBACK (queue_end_session_dialog_update),• shell);• for the cancel case, like have in the close case should fix this. Will need to test though.
Seems to work
Created attachment 218966 [details] [review] shell: fix duplicate dialog issue The act of cancelling the dialog alters the inhibitor list. When the inhibitor list is changed, we reshow the dialog. This commit makes the code stop watching the inhibitor list before sending out the cancel signal.