Rewrite killing of xprop

This commit is contained in:
mw 2019-09-05 20:48:19 +02:00
parent 15fb6fc94d
commit a5ef863647

View file

@ -67,13 +67,17 @@ class Module(bumblebee.engine.Module):
return True return True
def _resume_screensaver(self): def _resume_screensaver(self):
pids = []
success = True
for process in psutil.process_iter(): for process in psutil.process_iter():
if process.cmdline() == [bumblebee.util.which('xprop'), '-id', str(self._xid), '-spy']: if process.cmdline() == [bumblebee.util.which('xprop'), '-id', str(self._xid), '-spy']:
pids.append(process.pid)
for pid in pids:
try: try:
os.kill(process.pid, 9) os.kill(process.pid, 9)
except OSError: except OSError:
return False success = False
return True return success
def state(self, _): def state(self, _):
if self._active: if self._active: