logind: tighten for which classes of sessions we do stop-on-idle
We only want to do this for fully set up, interactive sessions, i.e.
user and user-early, but not for any others, hence restrict the rules a
bit.
Follow-up for: 508b4786e8
This commit is contained in:
@@ -817,7 +817,7 @@ static int session_setup_stop_on_idle_timer(Session *s) {
|
||||
|
||||
assert(s);
|
||||
|
||||
if (s->manager->stop_idle_session_usec == USEC_INFINITY || IN_SET(s->class, SESSION_GREETER, SESSION_LOCK_SCREEN))
|
||||
if (s->manager->stop_idle_session_usec == USEC_INFINITY || !SESSION_CLASS_CAN_STOP_ON_IDLE(s->class))
|
||||
return 0;
|
||||
|
||||
r = sd_event_add_time_relative(
|
||||
|
||||
@@ -54,6 +54,9 @@ typedef enum SessionClass {
|
||||
/* Which sessions are candidates to become "display" sessions */
|
||||
#define SESSION_CLASS_CAN_DISPLAY(class) (IN_SET((class), SESSION_USER, SESSION_USER_EARLY, SESSION_GREETER))
|
||||
|
||||
/* Which sessions classes should be subject to stop-in-idle */
|
||||
#define SESSION_CLASS_CAN_STOP_ON_IDLE(class) (IN_SET((class), SESSION_USER, SESSION_USER_EARLY))
|
||||
|
||||
typedef enum SessionType {
|
||||
SESSION_UNSPECIFIED,
|
||||
SESSION_TTY,
|
||||
|
||||
Reference in New Issue
Block a user