GNOME Bugzilla – Bug 141472
Logout shortcut not working
Last modified: 2005-01-06 16:16:51 UTC
1. open gnome-keybindings-properties from terminal or select Applications/Desktop Preferences/ Keyboard Shortcuts 2. Define some acceleratot keys to one action For example say Define <Control><Alt>Delete for Logout action 3. Close the Keyboard preference window. 4. Try to logout using the accelerator key i.e <Control><Alt>Delete 5. There is no action performed (notting logging out)
Although it works if you assign it to help browser. I'm seeing quite a few of these not working, including things like the volume controls. Marking appropriately highly.
WTF, we have a bunch of items under /apps/gnome_settings_daemon/keybindings/* that don't work. Nobody listens to changes in them, e.g. gnome-settings-daemon definitely doesn't.
For example, grep for 'power' in the schemas, the keybindings capplet, and the settings daemon (or the panel). There's this key /apps/gnome_settings_daemon/keybindings/power and the schema says that it's the key used for the Log Out action. But nobody listens to it.
Put onto 2.8.0 GNOME Milestone.
Umm, I'm on crack. I hadn't looked under gnome-control-center/gnome-settings-daemon/actions/ --- that's where that stuff gets handled. The problem is that when gnome_client_request_save() gets called from gnome-settings-multimedia-keys.c, the session manager doesn't pop up the logout dialog. I have no idea of why it doesn't. However, g-s-d does get a "die" signal, terminates from the callback, and is immediately restarted by the session manager.
Weirdness, gnome-settings-daemon isn't supposed to connect to the session manager: gnome_program_init ("gnome-settings-daemon", VERSION, LIBGNOMEUI_MODULE, argc, argv, GNOME_CLIENT_PARAM_SM_CONNECT, FALSE, NULL); "GNOME_CLIENT_PARAM_SM_CONNECT" tells it not to connect. So, we're not connected to the session manager at all. When you do gnome_client_request_save(), because you're not connected and you pass shutdown == TRUE, it invokes the "die" signal directly on the GnomeClient. So, you're basically just committing hari kari :-) (May I just point out that its not a stupid piece-of-shit session manager that's giving you grief here but a stupid piece-of-shit session management client implementation. But our session manager is still a stupid piece-of-shit session manager :-) So, we didn't want gnome-settings-daemon connecting to the session manager for good reasons: 1) Its not a per-session component. You can have two sessions under that same user on the same machine using the same settings daemon. So, you hardly the settings daemon to shut down when one of the sessions ends. 2) g-s-d isn't activated using XSMP, its activated using bonobo-activation. So, the way to get g-s-d to shut down correctly, is for gnome-session to drop its reference. 3) Because its activated using bonobo-activation, you don't want it to appear in a saved session - otherwise you end up trying to activate it with XSMP *and* bonobo-activation 4) Likewise, gnome-session re-starts g-s-d using bonobo-activation if g-s-d dies. We wouldn't like gnome-session trying to re-start it both with bonobo-activation and XSMP. Jacob and I talked around this a good while back: http://mail.gnome.org/archives/desktop-devel-list/2002-July/msg00338.html (Since that discussion, bonobo-activation no longer unsets $SESSION_MANAGER) What to do? Perhaps we could connect to the session manager, but set the RestartStyle to RESTART_NEVER. I think that should work, but you'd need to check it doesn't cause any of the weirdness I suggest above.
Oh, and it might just be better to ignore gnome-settings-daemon here and implement a new keybinding in metacity ...
ACME used to connect to the session manager, so that functionality worked. Obviously, it wasn't tested properly when ported over to g-s-d.
Yeah, it looks like the easiest thing at this point is to put the keybinding in the panel. The Ximian Desktop 2 patch worked like this. Does anyone mind if I do this: 1. In the keybindings capplet, change /apps/gnome_settings_daemon/keybindings/power to be /apps/panel/global/logout_key (that's the gconf namespace where the global panel keybindings live) 2. Change g-s-d not to listen to the old key, of course, and remove that schema 3. Modify the panel to use the new key
We moved the panel keybindings out of the panel and into metacity - that's why I'm suggesting you shoud do this in metacity. See gnome-panel/gnome-panel/panel-action-protocol.c for the cheesy ClientMessage based protocol for metacity to ask the panel to popup the main menu or the run dialog. We could extend the action protocol to include logout, but there's no need. Metacity can talk to the session manager as easy as the panel can. Nice thing here is that metacity is session managed so it doesn't have the same problems as gnome-settings-daemon. Fedora has a patch to use metacity's "run_command" keybindings in order to hook Ctrl-Alt-Del up to gnome-session-save --logout, so in principle it works fine.
I've filed bug #150669 for Metacity with a patch. Also, here's the patch for the control center.
Created attachment 30797 [details] [review] Patch to remove the "/apps/gnome_settings_daemon/keybindings/power" and use "/apps/metacity/global_keybindings/logout" in the capplet.
Adding maintainers to Cc so they know to review the patch
*** Bug 150666 has been marked as a duplicate of this bug. ***
Punting to 2.8.x...
Federico, if the metacity part of the patch is committed, could you commit that one as well?
See also bug 130634, bug 99335, and bug 130632.
As there doesn't seem to be any kind of closure on this one, I added the "gnome-session-save --kill" hack to gnome-2-8 and HEAD. Feel free to re-open if the solution doesn't suit you. 2004-11-30 Bastien Nocera <hadess@hadess.net> * gnome-settings-multimedia-keys.c: (do_exit_action): hack to get the logout action working (Closes: #141472)
*** Bug 161631 has been marked as a duplicate of this bug. ***