Rewrite killing of xprop
This commit is contained in:
parent
15fb6fc94d
commit
a5ef863647
1 changed files with 9 additions and 5 deletions
|
@ -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']:
|
||||||
try:
|
pids.append(process.pid)
|
||||||
os.kill(process.pid, 9)
|
for pid in pids:
|
||||||
except OSError:
|
try:
|
||||||
return False
|
os.kill(process.pid, 9)
|
||||||
return True
|
except OSError:
|
||||||
|
success = False
|
||||||
|
return success
|
||||||
|
|
||||||
def state(self, _):
|
def state(self, _):
|
||||||
if self._active:
|
if self._active:
|
||||||
|
|
Loading…
Reference in a new issue