chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
journalctl: use _COMM= match for scripts
[elogind.git]
/
src
/
login
/
logind-device.c
diff --git
a/src/login/logind-device.c
b/src/login/logind-device.c
index 828e1efe4a2b79d01a5a63a432d8c2f9fd1ba435..51b15358baa07684819d7c6717e46454ed1bd266 100644
(file)
--- a/
src/login/logind-device.c
+++ b/
src/login/logind-device.c
@@
-65,22
+65,32
@@
void device_free(Device *d) {
}
void device_detach(Device *d) {
}
void device_detach(Device *d) {
+ Seat *s;
assert(d);
assert(d);
- if (d->seat)
-
LIST_REMOVE(Device, devices, d->seat->devices, d)
;
+ if (
!
d->seat)
+
return
;
- seat_add_to_gc_queue(d->seat);
+ s = d->seat;
+ LIST_REMOVE(Device, devices, d->seat->devices, d);
d->seat = NULL;
d->seat = NULL;
+
+ seat_add_to_gc_queue(s);
+ seat_send_changed(s, "CanGraphical\0");
}
void device_attach(Device *d, Seat *s) {
assert(d);
assert(s);
}
void device_attach(Device *d, Seat *s) {
assert(d);
assert(s);
+ if (d->seat == s)
+ return;
+
if (d->seat)
device_detach(d);
d->seat = s;
LIST_PREPEND(Device, devices, s->devices, d);
if (d->seat)
device_detach(d);
d->seat = s;
LIST_PREPEND(Device, devices, s->devices, d);
+
+ seat_send_changed(s, "CanGraphical\0");
}
}