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 141472 - Logout shortcut not working
Logout shortcut not working
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: [obsolete] Keybinding
2.5.x
Other All
: Urgent blocker
: ---
Assigned To: Federico Mena Quintero
Control-Center Maintainers
: 150666 161631 (view as bug list)
Depends on: 150669
Blocks:
 
 
Reported: 2004-04-30 08:48 UTC by Subrahmanyam Madduri
Modified: 2005-01-06 16:16 UTC
See Also:
GNOME target: 2.8.x
GNOME version: 2.5/2.6


Attachments
Patch to remove the "/apps/gnome_settings_daemon/keybindings/power" and use "/apps/metacity/global_keybindings/logout" in the capplet. (7.00 KB, patch)
2004-08-20 21:13 UTC, Federico Mena Quintero
none Details | Review

Description Subrahmanyam Madduri 2004-04-30 08:48:12 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)
Comment 1 Andrew Sobala 2004-06-05 17:40:28 UTC
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.
Comment 2 Federico Mena Quintero 2004-08-19 18:28:25 UTC
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.
Comment 3 Federico Mena Quintero 2004-08-19 18:35:40 UTC
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.
Comment 4 Andrew Sobala 2004-08-19 21:07:18 UTC
Put onto 2.8.0 GNOME Milestone.
Comment 5 Federico Mena Quintero 2004-08-19 22:32:53 UTC
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.
Comment 6 Mark McLoughlin 2004-08-20 07:10:50 UTC
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.
Comment 7 Mark McLoughlin 2004-08-20 07:17:24 UTC
Oh, and it might just be better to ignore gnome-settings-daemon here and
implement a new keybinding in metacity ...
Comment 8 Bastien Nocera 2004-08-20 07:56:43 UTC
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.
Comment 9 Federico Mena Quintero 2004-08-20 13:51:17 UTC
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
Comment 10 Mark McLoughlin 2004-08-20 14:04:13 UTC
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.
Comment 11 Federico Mena Quintero 2004-08-20 21:12:09 UTC
I've filed bug #150669 for Metacity with a patch.

Also, here's the patch for the control center.
Comment 12 Federico Mena Quintero 2004-08-20 21:13:22 UTC
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.
Comment 13 Andrew Sobala 2004-08-20 21:59:17 UTC
Adding maintainers to Cc so they know to review the patch
Comment 14 Marinus Schraal 2004-08-21 11:34:06 UTC
*** Bug 150666 has been marked as a duplicate of this bug. ***
Comment 15 Elijah Newren 2004-09-12 23:45:17 UTC
Punting to 2.8.x...
Comment 16 Bastien Nocera 2004-09-29 20:56:04 UTC
Federico, if the metacity part of the patch is committed, could you commit that
one as well?
Comment 17 Elijah Newren 2004-10-06 19:59:30 UTC
See also bug 130634, bug 99335, and bug 130632.
Comment 18 Bastien Nocera 2004-11-30 12:02:38 UTC
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)
Comment 19 Sebastien Bacher 2005-01-06 16:16:51 UTC
*** Bug 161631 has been marked as a duplicate of this bug. ***