GNOME Bugzilla – Bug 507393
Use the panel's shutdown window
Last modified: 2009-03-04 14:52:55 UTC
Instead of asking gnome-session to shutdown the session and display its own dialog, it would be nice to call the panel’s shutdown window. It would look more consistent, and the 60-second delay adds to that the fact the computer will actually be shut down without any other action than pressing the button.
Created attachment 102185 [details] [review] Use gnome_panel_logout if available This patch makes use of the standalone gnome-panel-logout binary which is built by the patch in bug#507391. If it isn’t available, it falls back to the previous method.
What's the status on this? Ready to commit?
Seems to wait for gnome-panel patch. But nobody cares about that patch in bug#507391.
Does this patch depend on 507391?
Yes, it depends on gnome-panel. There's 2 scenarios using logout/shutdown dialog in GNOME. - Logout button in launch menu, which of dialog is located in gnome-panel. - Sending a XSMP saveyourself request with GNOME_INTERACT_ANY style. That dialog is drawn by gnome-session. GPM belongs to the second one. Josselin's method is merge them into gnome-panel, that is, a standalone binary called "gnome-panel-logout" to show up dialog.
In the end, this will all be available in the gnome-session dbus interface, but as long as it doesn’t exist this "gnome-panel-logout" workaround is needed.
Created attachment 109394 [details] [review] Patch using new gnome-session dbus interface Replace XSMP saveyourself request with new dbus interface "org.gnome.SessionManager.Shutdown". For more interface details, please see here. http://svn.gnome.org/viewvc/gnome-session/trunk/gnome-session/org.gnome.SessionManagement.xml?view=markup
Richard and Josselin, new dbus interfaces is already available on latest gnome-session trunk. Likewise, gnome-session 2.23 will provide a dialog containing suspend, hibernate, shutdown and reboot buttons. I think this is a ultimate solution. Now gnome-panel and gpm can both depend on new gnome-session dbus interface. Could you look at the new patch?
I think the error message when we can't connect to the session bus is bogus - also, this can't fail as g-p-m is already on the bus at this point. Is org.gnome.SessionManager really async? How do we know if it failed or not?
Right. Error message is redundant. Perhaps we can remove it. Using dbus_g_proxy_call_no_reply() in this patch is to avoid dead lock between g-p-m and gnome-session. After gnome-session receives shutdown request, it will pop up dialog. At that time, for adding suspend and hibernate button, gnome-session will check user capability through dbus_g_proxy_call() calling g-p-m method "CanSuspend", "CanHibernate". If g-p-m also uses a blocking operation, the session will hange. I meet this when testing. But how to know whether failed or not is really problem. Any good idea?
Okay, I see the deadlock. All we need to do is use dbus_g_proxy_begin_call and do this async to collect the error.
Why didn't this go into Gnome 2.24? In 2.24 when you press the power button, the logout dialog pops up instead of the shutdown dialog. I'd say this is the wrong behavior, as the user associates shutting down with the power button. If one changes gnome_client_request_save (gnome_master_client (), GNOME_SAVE_GLOBAL, TRUE, GNOME_INTERACT_ANY, FALSE, TRUE); to gnome_client_request_save (gnome_master_client (), GNOME_SAVE_GLOBAL, FALSE, GNOME_INTERACT_ANY, FALSE, TRUE); in gpm-manager.c in line 496 and calls the gpm_manager_action_interactive function from the patch from 2008-04-17 after that, it behaves as expected.
Created attachment 125137 [details] [review] Patch to show the shutdown dialog instead of the logout dialog This is a patch for the gnome-2-24 branch. For now I couldn't find the corresponding code in trunk.
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.