TOSQASH 6f92c6b5: xdotool trycatch
parent
0f747d8d87
commit
d649749e7d
|
@ -24,6 +24,10 @@ import subprocess
|
||||||
|
|
||||||
import tractor
|
import tractor
|
||||||
|
|
||||||
|
from piker.log import get_logger
|
||||||
|
|
||||||
|
log = get_logger(__name__)
|
||||||
|
|
||||||
|
|
||||||
_reset_tech: Literal[
|
_reset_tech: Literal[
|
||||||
'vnc',
|
'vnc',
|
||||||
|
@ -134,6 +138,7 @@ def i3ipc_xdotool_manual_click_hack() -> None:
|
||||||
# 'IB', # gw running in i3 (newer version?)
|
# 'IB', # gw running in i3 (newer version?)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
try:
|
||||||
for name in win_names:
|
for name in win_names:
|
||||||
results = t.find_titled(name)
|
results = t.find_titled(name)
|
||||||
print(f'results for {name}: {results}')
|
print(f'results for {name}: {results}')
|
||||||
|
@ -162,8 +167,8 @@ def i3ipc_xdotool_manual_click_hack() -> None:
|
||||||
'xdotool',
|
'xdotool',
|
||||||
'windowactivate', '--sync', win_id,
|
'windowactivate', '--sync', win_id,
|
||||||
|
|
||||||
# move mouse to bottom left of window (where there should
|
# move mouse to bottom left of window (where
|
||||||
# be nothing to click).
|
# there should be nothing to click).
|
||||||
'mousemove_relative', '--sync', str(w-4), str(h-4),
|
'mousemove_relative', '--sync', str(w-4), str(h-4),
|
||||||
|
|
||||||
# NOTE: we may need to stick a `--retry 3` in here..
|
# NOTE: we may need to stick a `--retry 3` in here..
|
||||||
|
@ -177,11 +182,10 @@ def i3ipc_xdotool_manual_click_hack() -> None:
|
||||||
)
|
)
|
||||||
|
|
||||||
# re-activate and focus original window
|
# re-activate and focus original window
|
||||||
try:
|
|
||||||
subprocess.call([
|
subprocess.call([
|
||||||
'xdotool',
|
'xdotool',
|
||||||
'windowactivate', '--sync', str(orig_win_id),
|
'windowactivate', '--sync', str(orig_win_id),
|
||||||
'click', '--window', str(orig_win_id), '1',
|
'click', '--window', str(orig_win_id), '1',
|
||||||
])
|
])
|
||||||
except subprocess.TimeoutExpired:
|
except subprocess.TimeoutExpired:
|
||||||
log.exception(f'xdotool timed out?')
|
log.exception('xdotool timed out?')
|
||||||
|
|
Loading…
Reference in New Issue