summaryrefslogtreecommitdiff
path: root/src/login/logind-button.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-09-21 15:44:14 +0200
committerLennart Poettering <lennart@poettering.net>2012-09-21 15:44:14 +0200
commit8e7fd6ade44ce5dde0867ba748c7978ed1206865 (patch)
treeced70d8e4c3d4e14f70ac459277c9046bd26500c /src/login/logind-button.c
parent636d30a0895f17eca8313d50f9b2fc1ec5e128da (diff)
logind: split up HandleSleepKey= into HandleSuspendKey= and HandleHibernateKey=
The kernel and X11 distuingish these two, and Thinkpad keys have both, hence we really should distinguish them too.
Diffstat (limited to 'src/login/logind-button.c')
-rw-r--r--src/login/logind-button.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/login/logind-button.c b/src/login/logind-button.c
index e2d9fd2b0f..8fdab789bc 100644
--- a/src/login/logind-button.c
+++ b/src/login/logind-button.c
@@ -249,12 +249,21 @@ int button_process(Button *b) {
log_info("Power key pressed.");
return button_handle(b, INHIBIT_HANDLE_POWER_KEY, b->manager->handle_power_key, b->manager->power_key_ignore_inhibited, true);
+ /* The kernel is a bit confused here:
+
+ KEY_SLEEP = suspend-to-ram, which everybody else calls "suspend"
+ KEY_SUSPEND = suspend-to-disk, which everybody else calls "hibernate"
+ */
+
case KEY_SLEEP:
- case KEY_SUSPEND:
- log_info("Sleep key pressed.");
- return button_handle(b, INHIBIT_HANDLE_SLEEP_KEY, b->manager->handle_sleep_key, b->manager->sleep_key_ignore_inhibited, true);
+ log_info("Suspend key pressed.");
+ return button_handle(b, INHIBIT_HANDLE_SUSPEND_KEY, b->manager->handle_suspend_key, b->manager->suspend_key_ignore_inhibited, true);
+ case KEY_SUSPEND:
+ log_info("Hibernate key pressed.");
+ return button_handle(b, INHIBIT_HANDLE_HIBERNATE_KEY, b->manager->handle_hibernate_key, b->manager->hibernate_key_ignore_inhibited, true);
}
+
} else if (ev.type == EV_SW && ev.value > 0) {
switch (ev.code) {