summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
cce8084)
Spell out the proper name. Use 'pos' over 'position', and also update the
logind state file to do the same. Note that this breaks live updates.
However, we only save 'POSITION' on non-seat0, so this shouldn't bother
anyone for real. If you run multi-seat setups, you better restart a
machine on updates, anyway.
return -EINVAL;
start = 1;
return -EINVAL;
start = 1;
- if (s->active && s->active->pos > 0)
- start = s->active->pos;
+ if (s->active && s->active->position > 0)
+ start = s->active->position;
for (i = start + 1; i < s->position_count; ++i)
if (s->positions[i])
for (i = start + 1; i < s->position_count; ++i)
if (s->positions[i])
return -EINVAL;
start = 1;
return -EINVAL;
start = 1;
- if (s->active && s->active->pos > 0)
- start = s->active->pos;
+ if (s->active && s->active->position > 0)
+ start = s->active->position;
for (i = start - 1; i > 0; --i)
if (s->positions[i])
for (i = start - 1; i > 0; --i)
if (s->positions[i])
void seat_evict_position(Seat *s, Session *session) {
Session *iter;
void seat_evict_position(Seat *s, Session *session) {
Session *iter;
- unsigned int pos = session->pos;
+ unsigned int pos = session->position;
* position (eg., during gdm->session transition), so let's look
* for it and set it on the free slot. */
LIST_FOREACH(sessions_by_seat, iter, s->sessions) {
* position (eg., during gdm->session transition), so let's look
* for it and set it on the free slot. */
LIST_FOREACH(sessions_by_seat, iter, s->sessions) {
- if (iter->pos == pos) {
+ if (iter->position == pos) {
s->positions[pos] = iter;
break;
}
s->positions[pos] = iter;
break;
}
seat_evict_position(s, session);
seat_evict_position(s, session);
+ session->position = pos;
if (pos > 0 && !s->positions[pos])
s->positions[pos] = session;
}
if (pos > 0 && !s->positions[pos])
s->positions[pos] = session;
}
static void seat_assign_position(Seat *s, Session *session) {
unsigned int pos;
static void seat_assign_position(Seat *s, Session *session) {
unsigned int pos;
+ if (session->position > 0)
return;
for (pos = 1; pos < s->position_count; ++pos)
return;
for (pos = 1; pos < s->position_count; ++pos)
fprintf(f, "VTNR=%u\n", s->vtnr);
if (!s->vtnr)
fprintf(f, "VTNR=%u\n", s->vtnr);
if (!s->vtnr)
- fprintf(f, "POS=%u\n", s->pos);
+ fprintf(f, "POSITION=%u\n", s->position);
if (s->leader > 0)
fprintf(f, "LEADER="PID_FMT"\n", s->leader);
if (s->leader > 0)
fprintf(f, "LEADER="PID_FMT"\n", s->leader);
*seat = NULL,
*vtnr = NULL,
*state = NULL,
*seat = NULL,
*vtnr = NULL,
*state = NULL,
*leader = NULL,
*type = NULL,
*class = NULL,
*leader = NULL,
*type = NULL,
*class = NULL,
"DESKTOP", &s->desktop,
"VTNR", &vtnr,
"STATE", &state,
"DESKTOP", &s->desktop,
"VTNR", &vtnr,
"STATE", &state,
"LEADER", &leader,
"TYPE", &type,
"CLASS", &class,
"LEADER", &leader,
"TYPE", &type,
"CLASS", &class,
if (!s->seat || !seat_has_vts(s->seat))
s->vtnr = 0;
if (!s->seat || !seat_has_vts(s->seat))
s->vtnr = 0;
+ if (position && s->seat) {
+ safe_atou(position, &npos);
seat_claim_position(s->seat, s, npos);
}
seat_claim_position(s->seat, s, npos);
}
Manager *manager;
const char *id;
Manager *manager;
const char *id;
SessionType type;
SessionClass class;
SessionType type;
SessionClass class;