Skip to content

fix: narrow window title exception handling - #141

Merged
petercorke merged 3 commits into
petercorke:mainfrom
RoboX2020:fix/window-title-exceptions
Oct 17, 2026
Merged

petercorke merged 3 commits into
petercorke:mainfrom
RoboX2020:fix/window-title-exceptions

Conversation

@RoboX2020

Copy link
Copy Markdown
Contributor

Addresses the set_window_title part of #115.

Catch AttributeError and RuntimeError for backends without a usable window manager instead of swallowing every exception. Unexpected ValueError failures and KeyboardInterrupt now propagate.

Five headless tests cover normal title forwarding, the two tolerated backend failures, and the two propagated errors. The latter two fail on the original implementation.

Validation on Python 3.11:

  • New tests: 5 passed on OpenCV 4.12.0.88 and 5.0.0.93.
  • Full OpenCV 5 suite: 964 passed, 97 skipped, 5 subtests passed.
  • Both changed files pass black; new tests pass ruff.

Tests use a minimal window-manager adapter; no actual desktop GUI was opened. The full suite was not run on OpenCV 4. Other exception sites in #115 remain separate.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@petercorke

Copy link
Copy Markdown
Owner

I'm going to hold off on this. #263 on spatialmath is a more solid fix, but like many of my PRs it's stuck in RAI's merge queue.

@RoboX2020

Copy link
Copy Markdown
Contributor Author

Makes sense, Peter. #263 does look like the more solid fix. I will keep an eye on it and close this once it lands, or feel free to close it whenever suits you.

@petercorke

Copy link
Copy Markdown
Owner

But since they are so slow, maybe we go with this, it is correct, and fix it up whenever #263 lands.

@petercorke
petercorke merged commit 715af60 into petercorke:main Oct 17, 2026
39 checks passed
@github-actions github-actions Bot mentioned this pull request Oct 17, 2026
@petercorke

Copy link
Copy Markdown
Owner

Thanks, and for your patience while we sorted out #263. Merged as it is; we'll swap in the spatialmath helper when that lands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants