mirror of
https://github.com/systemd/systemd.git
synced 2025-03-19 22:50:17 +03:00
logind: make idle hint logic work
This commit is contained in:
parent
9418f14772
commit
77527da0a0
@ -130,13 +130,13 @@
|
||||
|
||||
static int bus_manager_append_idle_hint(DBusMessageIter *i, const char *property, void *data) {
|
||||
Manager *m = data;
|
||||
bool b;
|
||||
dbus_bool_t b;
|
||||
|
||||
assert(i);
|
||||
assert(property);
|
||||
assert(m);
|
||||
|
||||
b = manager_get_idle_hint(m, NULL);
|
||||
b = manager_get_idle_hint(m, NULL) > 0;
|
||||
if (!dbus_message_iter_append_basic(i, DBUS_TYPE_BOOLEAN, &b))
|
||||
return -ENOMEM;
|
||||
|
||||
|
@ -151,13 +151,13 @@ static int bus_seat_append_can_activate(DBusMessageIter *i, const char *property
|
||||
|
||||
static int bus_seat_append_idle_hint(DBusMessageIter *i, const char *property, void *data) {
|
||||
Seat *s = data;
|
||||
bool b;
|
||||
dbus_bool_t b;
|
||||
|
||||
assert(i);
|
||||
assert(property);
|
||||
assert(s);
|
||||
|
||||
b = seat_get_idle_hint(s, NULL);
|
||||
b = seat_get_idle_hint(s, NULL) > 0;
|
||||
if (!dbus_message_iter_append_basic(i, DBUS_TYPE_BOOLEAN, &b))
|
||||
return -ENOMEM;
|
||||
|
||||
|
@ -230,8 +230,7 @@ int seat_set_active(Seat *s, Session *session) {
|
||||
Session *old_active;
|
||||
|
||||
assert(s);
|
||||
assert(session);
|
||||
assert(session->seat == s);
|
||||
assert(!session || session->seat == s);
|
||||
|
||||
if (session == s->active)
|
||||
return 0;
|
||||
|
@ -144,7 +144,7 @@ static int bus_session_append_user(DBusMessageIter *i, const char *property, voi
|
||||
|
||||
static int bus_session_append_active(DBusMessageIter *i, const char *property, void *data) {
|
||||
Session *s = data;
|
||||
bool b;
|
||||
dbus_bool_t b;
|
||||
|
||||
assert(i);
|
||||
assert(property);
|
||||
@ -159,13 +159,13 @@ static int bus_session_append_active(DBusMessageIter *i, const char *property, v
|
||||
|
||||
static int bus_session_append_idle_hint(DBusMessageIter *i, const char *property, void *data) {
|
||||
Session *s = data;
|
||||
bool b;
|
||||
int b;
|
||||
|
||||
assert(i);
|
||||
assert(property);
|
||||
assert(s);
|
||||
|
||||
b = session_get_idle_hint(s, NULL);
|
||||
b = session_get_idle_hint(s, NULL) > 0;
|
||||
if (!dbus_message_iter_append_basic(i, DBUS_TYPE_BOOLEAN, &b))
|
||||
return -ENOMEM;
|
||||
|
||||
|
@ -154,13 +154,14 @@ static int bus_user_append_sessions(DBusMessageIter *i, const char *property, vo
|
||||
|
||||
static int bus_user_append_idle_hint(DBusMessageIter *i, const char *property, void *data) {
|
||||
User *u = data;
|
||||
bool b;
|
||||
dbus_bool_t b;
|
||||
|
||||
assert(i);
|
||||
assert(property);
|
||||
assert(u);
|
||||
|
||||
b = user_get_idle_hint(u, NULL);
|
||||
b = user_get_idle_hint(u, NULL) > 0;
|
||||
|
||||
if (!dbus_message_iter_append_basic(i, DBUS_TYPE_BOOLEAN, &b))
|
||||
return -ENOMEM;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user