From 5e3cd1fc6b30f532018e738e424496888878d4c9 Mon Sep 17 00:00:00 2001 From: wygud Date: Sun, 5 Oct 2025 14:24:06 -0400 Subject: [PATCH] dnks: FIX IN REPONSE TO SYMBOL SWITCHING CAUSING A AsyncVNCClient.connect ERROR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🟢 piker/brokers/ib/_util.py - New utility script added 🛠️ vnc_click_hack -> Refactored to initialize VNC client outside context 🛠️ client connection -> Simplified by removing crash handler context 🛠️ moved client movement -> Now inside async with block for proper cleanup 🛠️ added comments -> Clarified screen position and hotkey actions --- piker/brokers/ib/_util.py | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/piker/brokers/ib/_util.py b/piker/brokers/ib/_util.py index cb3affc7..6122eb9a 100644 --- a/piker/brokers/ib/_util.py +++ b/piker/brokers/ib/_util.py @@ -221,27 +221,26 @@ async def vnc_click_hack( 'connection': 'r' }[reset_type] - with tractor.devx.open_crash_handler(): - client = await AsyncVNCClient.connect( - VNCConfig( - host=host, - port=port, - password='doggy', + client = await AsyncVNCClient.connect( + VNCConfig( + host=host, + port=port, + password='doggy', + ) + ) + async with client: + # move to middle of screen + # 640x1800 + await client.move( + Point( + 500, + 500, ) ) - async with client: - # move to middle of screen - # 640x1800 - await client.move( - Point( - 500, - 500, - ) - ) - # ensure the ib-gw window is active - await client.click(MOUSE_BUTTON_LEFT) - # send the hotkeys combo B) - await client.press('Ctrl', 'Alt', key) # keys are stacked + # ensure the ib-gw window is active + await client.click(MOUSE_BUTTON_LEFT) + # send the hotkeys combo B) + await client.press('Ctrl', 'Alt', key) # keys are stacked def i3ipc_fin_wins_titled(