GNOME Bugzilla – Bug 690713
Keyboard shortcut for suspend/hibernate doesn't emit org.freedesktop.UPower.Sleeping() [regression]
Last modified: 2013-02-02 02:01:19 UTC
My Jabber client Gajim watches for org.freedesktop.UPower.Sleeping() dbus signal to disconnect from the network. If I suspend the computer using user menu -> (alt) Suspend to RAM, the signal is correctly received and I'm disconnected before suspending. But if I hit the keyboard shortcut (available on my notebook keyboard), the signal is not emitted, the Jabber client does not disconnect, and I'm left hanging seemingly online, but in fact offline, for dozens of minutes. All incoming messages in that time period are lost. There are definitely other use cases, not just the Jabber client. I believe the problem is that the menu item uses UPower to trigger computer suspend, but the keyboard shortcut uses pm-utils. We need to emit the signal in both cases, using system menu or keyboard shortcut. This is a regression from GNOME 3.4 (Fedora 17), both approaches emit UPower dbus signal there. gnome-settings-daemon-3.6.3-2.fc18.x86_64
The upower signal can't be reliable because the kernel does not offer a suitable api to implement such a signal.
Sorry, I don't understand. GNOME can send the signal when suspending using the system menu, but can't send the signal when using the keyboard shortcut? That doesn't seem right, it used to work in previous GNOME versions.
whether the signal gets emitted or not depends on which mechanism is used to trigger suspend
Can we wire both mechanisms to the same code path? I.e. the keyboard shortcut would execute exactly the same code as the menu item does. Why it worked in GNOME 3.4 and now it doesn't in GNOME 3.6? It's not an erratic behavior, it used to work reliably and now it doesn't work at all.
it used to work 'reliably' only because everything used to talk to upower. now, some code paths are going directly to logind.
See: https://bugs.freedesktop.org/show_bug.cgi?id=58950 Also note that it only affects the Fedora version of gnome-settings-daemon, as the upstream version (in GNOME 3.6) still uses upower for this.