fix: anti-idle uses xdotool --window; remove creds from URL

rdp-proxy/manager.py: anti_idle_loop gets window ID first, then sends
key --window ID --clearmodifiers shift (was broken chain syntax).
universal-runtime/manager.py: removed credentials from URL - they break
SPA fetch() calls causing white screen (e.g. CGP).
This commit is contained in:
2026-05-01 14:44:08 +00:00
parent 38dc206f5a
commit 96b7dff7cd
2 changed files with 15 additions and 11 deletions
+14 -9
View File
@@ -72,6 +72,7 @@ def _monitor_loop():
threading.Thread(target=_monitor_loop, daemon=True).start() threading.Thread(target=_monitor_loop, daemon=True).start()
def _anti_idle_loop(): def _anti_idle_loop():
"""Send Shift key every 30s while xfreerdp is connected to prevent screen lock.""" """Send Shift key every 30s while xfreerdp is connected to prevent screen lock."""
env = {**os.environ, "DISPLAY": DISPLAY}
while True: while True:
time.sleep(30) time.sleep(30)
with _lock: with _lock:
@@ -79,19 +80,23 @@ def _anti_idle_loop():
if not active: if not active:
continue continue
try: try:
# Try to send Shift to xfreerdp window r = subprocess.run(
result = subprocess.run( ["xdotool", "search", "--name", "FreeRDP"],
["xdotool", "search", "--name", "FreeRDP", "key", "shift"], env=env, capture_output=True, timeout=5,
env={**os.environ, "DISPLAY": DISPLAY},
capture_output=True, timeout=5,
) )
if result.returncode != 0: win_id = r.stdout.decode().strip().splitlines()[0] if r.stdout.strip() else ""
# Fallback: mousemove if win_id:
subprocess.run(
["xdotool", "key", "--window", win_id, "--clearmodifiers", "shift"],
env=env, capture_output=True, timeout=5,
)
log.debug("anti_idle shift sent window=%s", win_id)
else:
subprocess.run( subprocess.run(
["xdotool", "mousemove", "--sync", "960", "540"], ["xdotool", "mousemove", "--sync", "960", "540"],
env={**os.environ, "DISPLAY": DISPLAY}, env=env, capture_output=True, timeout=5,
capture_output=True, timeout=5,
) )
log.debug("anti_idle mousemove fallback")
except Exception as e: except Exception as e:
log.debug("anti_idle error: %s", e) log.debug("anti_idle error: %s", e)
+1 -2
View File
@@ -352,8 +352,7 @@ def open_web(
safe_w, safe_h = apply_resolution(width, height) safe_w, safe_h = apply_resolution(width, height)
profile_dir = _create_chrome_profile() profile_dir = _create_chrome_profile()
extension_dir = _create_autofill_extension(login, password) extension_dir = _create_autofill_extension(login, password)
# Embed credentials in URL for HTTP Basic Auth (no dialog shown) url_with_creds = url # credentials in URL break SPA fetch; extension handles auth
url_with_creds = _url_with_credentials(url, login, password)
# Use the real Chromium binary directly to avoid the Debian wrapper which # Use the real Chromium binary directly to avoid the Debian wrapper which
# injects an empty `--load-extension=` from /etc/chromium.d/extensions. # injects an empty `--load-extension=` from /etc/chromium.d/extensions.