From 631bdedb6c485d0e14c49f4ae4123c5d11d2d455 Mon Sep 17 00:00:00 2001 From: x01dc Date: Thu, 17 Sep 2026 15:59:40 +0200 Subject: [PATCH] fix(flomni): increase flomni GUI window settle delay after creation (experiment) Root cause finally isolated via a live A/B test: closing the whole "flomni" window and reopening it (flomnigui_show_gui() takes the gui.new() branch, creating a fresh top-level window) reproduces the "camera image squeezed/ missing until the window is moved" symptom; closing just the xeyegui dock and reopening it (window already exists in self.gui.windows, reused as-is) does not. Same OMNY_XRayEye construction either way -- the only variable is whether the window itself is freshly created, which rules out the widget's own layout code (already tried and reverted two fixes there this session). The existing time.sleep(1) after gui.new() is itself evidence someone already found the RPC response alone doesn't mean the window has actually settled on screen. Bumping to 2s is a pragmatic, easily-reversible experiment, not a confirmed fix -- flagging in case it needs to become a poll-for-actual-geometry wait instead. LamNI's gui_tools.py has the identical gui.new() + time.sleep(1) pattern (line 46-47) and is presumably equally exposed, but untouched here -- not reported/tested there. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01Lx3KffiFyyDMKT8vvPENUW --- .../bec_ipython_client/plugins/flomni/gui_tools.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/csaxs_bec/bec_ipython_client/plugins/flomni/gui_tools.py b/csaxs_bec/bec_ipython_client/plugins/flomni/gui_tools.py index 0a933ec9..c347b40c 100644 --- a/csaxs_bec/bec_ipython_client/plugins/flomni/gui_tools.py +++ b/csaxs_bec/bec_ipython_client/plugins/flomni/gui_tools.py @@ -59,7 +59,17 @@ class flomniGuiTools: pos_x = self._SCREEN_WIDTH - self._WINDOW_WIDTH geometry = (pos_x, self._WINDOW_TOP_MARGIN, self._WINDOW_WIDTH, self._WINDOW_HEIGHT) self.flomni_window = self.gui.new("flomni", geometry=geometry) - time.sleep(1) + # The RPC response for gui.new() confirms the server has created the + # window object, not that it has actually settled at the requested + # geometry on screen (window-manager-level resize can lag behind + # that, worse over a remote desktop session) -- the very first dock + # added right after this (e.g. flomnigui_show_xeyealign()'s + # OMNY_XRayEye) can otherwise get laid out against a still-settling + # window, squeezing it down until the operator manually moves or + # resizes the window (which forces a relayout, masking the real + # timing issue rather than fixing it). Was 1s; bumped to 2s -- + # this is a pragmatic guess, not a confirmed-sufficient bound. + time.sleep(2) def flomnigui_stop_gui(self): self.gui.flomni.hide()