Fix _resume_screensaver

This commit is contained in:
mw 2019-09-05 21:57:32 +02:00
parent f19cf652cb
commit ed59823ac3

View file

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