fix: close only completed integration panels during native save

This commit is contained in:
阿白叔 committed 2026-11-17 01:22:58 +08:00
1 parent d40fa3a750
commit 87e10740f7
4 files changed
+71 -5

No files matched your search

+10 -5
View File
@@ -238,11 +238,16 @@ class WindowProbe:
process_name = ""
controls = tuple(self._win32_control(child) for child in self._children(hwnd))
diagnostics = []
try:
uia_records = _bounded_call(lambda: self.uia.controls(hwnd), self.uia_timeout_seconds)
controls = self._merge_controls(controls, uia_records)
except Exception as error:
diagnostics.append(f"UIA_ERROR: {error}")
native_panel = (process_name.casefold() == 'expeditionpcb.exe'
and phase in (DialogPhase.SAVE, DialogPhase.CLOSE)
and gui.GetClassName(hwnd) == '#32770' and gui.GetWindowText(hwnd) == 'Project Integration')
# This native panel's exact control IDs/text are sufficient; its UIA tree can stall Save.
if not native_panel:
try:
uia_records = _bounded_call(lambda: self.uia.controls(hwnd), self.uia_timeout_seconds)
controls = self._merge_controls(controls, uia_records)
except Exception as error:
diagnostics.append(f"UIA_ERROR: {error}")
owner = 0
try:
owner = int(gui.GetWindow(hwnd, 4) or 0) # GW_OWNER