chiark / gitweb /
logind: make use of EVIOCSMASK input ioctl to mask out events we aren't interested in
[elogind.git] / src / login / logind-inhibit.c
index 5ca42b1ca2ae2c4d14cc4f73f23e25d181b3112e..1e6f3837382fe163fed58bbeda901abdda364d91 100644 (file)
@@ -347,7 +347,7 @@ InhibitWhat manager_inhibit_what(Manager *m, InhibitMode mm) {
         assert(m);
 
         HASHMAP_FOREACH(i, m->inhibitors, j)
-                if (i->mode == mm)
+                if (i->mode == mm && i->started)
                         what |= i->what;
 
         return what;
@@ -388,6 +388,9 @@ bool manager_is_inhibited(
         assert(w > 0 && w < _INHIBIT_WHAT_MAX);
 
         HASHMAP_FOREACH(i, m->inhibitors, j) {
+                if (!i->started)
+                        continue;
+
                 if (!(i->what & w))
                         continue;