From 36e19adde411aa8de1a1de90af902b480295bdbf Mon Sep 17 00:00:00 2001 From: x12sa Date: Thu, 10 Sep 2026 14:00:48 +0200 Subject: [PATCH] fix(flomni): make flomnigui_show_* macros idempotent flomnigui_show_gui() unconditionally called self.gui.flomni.raise_window() whenever the flomni window already existed. That RPC call is currently buggy in bec_widgets and can hide the window instead of bringing it to front, so calling any flomnigui_show_* macro a second time (e.g. from a script) made the GUI disappear. Disable the raise_window() call, matching the same workaround already applied in flomnigui_raise(); repeat calls now just update content in place instead of re-raising. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_018CUx5yV1iCBhL5sFEHEoPe --- .../bec_ipython_client/plugins/flomni/gui_tools.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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 83685508..0a933ec9 100644 --- a/csaxs_bec/bec_ipython_client/plugins/flomni/gui_tools.py +++ b/csaxs_bec/bec_ipython_client/plugins/flomni/gui_tools.py @@ -48,7 +48,12 @@ class flomniGuiTools: def flomnigui_show_gui(self): if "flomni" in self.gui.windows: self.flomni_window = self.gui.windows["flomni"] - self.gui.flomni.raise_window() + # raise_window() is currently buggy (bec_widgets RPCServer "raise" handling can + # detach/hide the window instead of bringing it to front) - disabled so that + # calling a flomnigui_show_* macro again on an already-open GUI is a safe no-op + # instead of risking hiding the window. See flomnigui_raise() above for the same + # workaround. + # self.gui.flomni.raise_window() else: # geometry: (pos_x, pos_y, w, h) pos_x = self._SCREEN_WIDTH - self._WINDOW_WIDTH @@ -60,7 +65,8 @@ class flomniGuiTools: self.gui.flomni.hide() def flomnigui_raise(self): - self.gui.flomni.raise_window() + pass + #self.gui.flomni.raise_window() def flomnigui_show_xeyealign(self): self.flomnigui_show_gui()