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 507393 - Use the panel's shutdown window
Use the panel's shutdown window
Status: RESOLVED FIXED
Product: gnome-power-manager
Classification: Deprecated
Component: gnome-power-manager
2.20.x
Other Linux
: Normal enhancement
: ---
Assigned To: GNOME Power Manager Maintainer(s)
GNOME Power Manager Maintainer(s)
Depends on: 507391
Blocks:
 
 
Reported: 2008-01-05 00:15 UTC by Josselin Mouette
Modified: 2009-03-04 14:52 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Use gnome_panel_logout if available (993 bytes, patch)
2008-01-05 00:17 UTC, Josselin Mouette
none Details | Review
Patch using new gnome-session dbus interface (1.58 KB, patch)
2008-04-17 02:20 UTC, Xiurong Simon Zheng
none Details | Review
Patch to show the shutdown dialog instead of the logout dialog (1.41 KB, patch)
2008-12-22 14:43 UTC, Michael Kanis
none Details | Review

Description Josselin Mouette 2008-01-05 00:15:15 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.
Comment 1 Josselin Mouette 2008-01-05 00:17:44 UTC
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.
Comment 2 João Matos 2008-02-13 09:50:40 UTC
What's the status on this? Ready to commit?
Comment 3 Xiurong Simon Zheng 2008-02-13 12:54:20 UTC
Seems to wait for gnome-panel patch. But nobody cares about that patch in bug#507391.
Comment 4 Richard Hughes 2008-03-19 01:18:15 UTC
Does this patch depend on 507391?
Comment 5 Xiurong Simon Zheng 2008-03-19 03:43:04 UTC
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.
Comment 6 Josselin Mouette 2008-03-23 11:22:58 UTC
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.
Comment 7 Xiurong Simon Zheng 2008-04-17 02:20:49 UTC
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
Comment 8 Xiurong Simon Zheng 2008-04-17 02:27:43 UTC
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?
Comment 9 Richard Hughes 2008-04-17 09:05:19 UTC
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?
Comment 10 Xiurong Simon Zheng 2008-04-17 15:14:04 UTC
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?
Comment 11 Richard Hughes 2008-04-18 12:33:17 UTC
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.
Comment 12 Michael Kanis 2008-09-29 20:07:24 UTC
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.
Comment 13 Michael Kanis 2008-12-22 14:43:57 UTC
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.
Comment 14 Richard Hughes 2009-03-04 14:52:55 UTC
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.