|
@@ -88,7 +88,7 @@ def x_wait_for_event(xdisplay, timeout_seconds):
|
|
|
|
|
|
class ExtendedControls:
|
|
class ExtendedControls:
|
|
|
|
|
|
- def __init__(self, engine_pid,
|
|
|
|
|
|
+ def __init__(self, primary_engine_pid,
|
|
toggle_keysym_name=EXTENDED_CONTROLS_DEFAULT_TOGGLE_KEYSYM_NAME):
|
|
toggle_keysym_name=EXTENDED_CONTROLS_DEFAULT_TOGGLE_KEYSYM_NAME):
|
|
if not psutil:
|
|
if not psutil:
|
|
raise Exception('\n'.join([
|
|
raise Exception('\n'.join([
|
|
@@ -106,7 +106,7 @@ class ExtendedControls:
|
|
'or',
|
|
'or',
|
|
'\t$ pip3 install --user xlib',
|
|
'\t$ pip3 install --user xlib',
|
|
]))
|
|
]))
|
|
- self._engine_pid = engine_pid
|
|
|
|
|
|
+ self._primary_engine_pid = primary_engine_pid
|
|
self._xdisplay = Xlib.display.Display()
|
|
self._xdisplay = Xlib.display.Display()
|
|
self._toggle_keysym = XK.string_to_keysym(toggle_keysym_name)
|
|
self._toggle_keysym = XK.string_to_keysym(toggle_keysym_name)
|
|
if self._toggle_keysym == X.NoSymbol:
|
|
if self._toggle_keysym == X.NoSymbol:
|
|
@@ -128,7 +128,7 @@ class ExtendedControls:
|
|
|
|
|
|
@property
|
|
@property
|
|
def engine_running(self):
|
|
def engine_running(self):
|
|
- return psutil.pid_exists(self._engine_pid)
|
|
|
|
|
|
+ return psutil.pid_exists(self._primary_engine_pid)
|
|
|
|
|
|
@property
|
|
@property
|
|
def xdisplay(self):
|
|
def xdisplay(self):
|
|
@@ -143,7 +143,7 @@ class ExtendedControls:
|
|
while self.engine_running and (time.time() - start_epoch) <= timeout_seconds:
|
|
while self.engine_running and (time.time() - start_epoch) <= timeout_seconds:
|
|
windows = x_find_window_by_pid(
|
|
windows = x_find_window_by_pid(
|
|
self._xdisplay,
|
|
self._xdisplay,
|
|
- self._engine_pid,
|
|
|
|
|
|
+ self._primary_engine_pid,
|
|
)
|
|
)
|
|
assert len(windows) <= 1
|
|
assert len(windows) <= 1
|
|
if len(windows) == 1:
|
|
if len(windows) == 1:
|