After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 664508 - Dialog repeated twice if an application blocks logout
Dialog repeated twice if an application blocks logout
Status: RESOLVED FIXED
Product: gnome-session
Classification: Core
Component: gnome-session
3.2.x
Other Linux
: Normal normal
: ---
Assigned To: Session Maintainers
Session Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-11-21 21:11 UTC by Cosimo Cecchi
Modified: 2012-07-17 03:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
shell: fix duplicate dialog issue (1.32 KB, patch)
2012-07-17 03:02 UTC, Ray Strode [halfline]
committed Details | Review

Description Cosimo Cecchi 2011-11-21 21:11:49 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.
Comment 1 Allan Day 2012-02-23 11:10:19 UTC
Confirmed.
Comment 2 Cosimo Cecchi 2012-03-17 05:47:32 UTC
Marking as a duplicate of bug 672270, since it has patches.

*** This bug has been marked as a duplicate of bug 672270 ***
Comment 3 Jasper St. Pierre (not reading bugmail) 2012-03-17 05:49:09 UTC
(In reply to comment #2)
> Marking as a duplicate of bug 672270, since it has patches.

The patch isn't for that issue, though.
Comment 4 Jasper St. Pierre (not reading bugmail) 2012-03-17 08:38:41 UTC
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.
Comment 5 Ray Strode [halfline] 2012-07-17 02:52:09 UTC
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.
Comment 6 Ray Strode [halfline] 2012-07-17 03:02:25 UTC
Seems to work
Comment 7 Ray Strode [halfline] 2012-07-17 03:02:46 UTC
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.