}
switch (ksym) {
+ case XKB_KEY_j:
case XKB_KEY_Return:
case XKB_KEY_KP_Enter:
case XKB_KEY_XF86ScreenSaver:
+ if (ksym == XKB_KEY_j && !ctrl)
+ break;
+
if (pam_state == STATE_PAM_WRONG)
return;
* see issue #50. */
return;
+ case XKB_KEY_h:
case XKB_KEY_BackSpace:
+ if (ksym == XKB_KEY_h && !ctrl)
+ break;
+
if (input_position == 0)
return;
password[input_position] = '\0';
/* Hide the unlock indicator after a bit if the password buffer is
- * empty. */
+ * empty. */
START_TIMER(clear_indicator_timeout, 1.0, clear_indicator_cb);
unlock_state = STATE_BACKSPACE_ACTIVE;
redraw_screen();
xcb_flush(conn);
}
+/*
+ * Try closing logind sleep lock fd passed over from xss-lock, in case we're
+ * being run from there.
+ *
+ */
+static void maybe_close_sleep_lock_fd(void) {
+ const char *sleep_lock_fd = getenv("XSS_SLEEP_LOCK_FD");
+ char *endptr;
+ if (sleep_lock_fd && *sleep_lock_fd != 0) {
+ long int fd = strtol(sleep_lock_fd, &endptr, 10);
+ if (*endptr == 0) {
+ close(fd);
+ }
+ }
+}
+
/*
* Instead of polling the X connection socket we leave this to
* xcb_poll_for_event() which knows better than we can ever know.
break;
case XCB_MAP_NOTIFY:
+ maybe_close_sleep_lock_fd();
if (!dont_fork) {
/* After the first MapNotify, we never fork again. We don’t
* expect to get another MapNotify, but better be sure… */
if (pid == 0) {
/* Child */
close(xcb_get_file_descriptor(conn));
+ maybe_close_sleep_lock_fd();
raise_loop(win);
exit(EXIT_SUCCESS);
}