Skip to content

src/plotting.py: properly maximize window when using matplotlib Qt backend - #28

Merged
swesterfeld merged 2 commits into
trunkfrom
maximize-qt-window
Sep 16, 2026
Merged

swesterfeld merged 2 commits into
trunkfrom
maximize-qt-window

Conversation

@swesterfeld

@swesterfeld swesterfeld commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

I recently updated my system (to Ubuntu 26.04) and src/plotting.py (imagewmark get -P all ...)

mng.resize (*mng.window.maxsize())

now produces

AttributeError: 'MainWindow' object has no attribute 'maxsize'

this is because matplotlib is using Qt backend

import matplotlib
print(matplotlib.get_backend())

qtagg

The PR fixes this by checking if Qt's showMaximized is present and use it if it is.


Devin Review

Summary by CodeRabbit

  • Bug Fixes
    • Improved matplotlib figure maximization across supported backends.
    • Qt-based windows continue to use native maximize behavior for more consistent display sizing.
    • Added reliable maximization support for wx-based windows.
    • Other supported backends retain their existing window-resizing fallback behavior.

…ckend

Signed-off-by: Stefan Westerfeld <stefan@space.twc.de>
@coderabbitai

coderabbitai Bot commented Sep 15, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 3e33eb8f-6e4f-4508-b015-ed825bf7efaa

📥 Commits

Reviewing files that changed from the base of the PR and between 5e9316c and 87b9040.

📒 Files selected for processing (1)
  • src/plotting.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/plotting.py

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The plotting module adds a shared window-maximization helper. Fullscreen display and animation setup use it. wx managers call Maximize(True), Qt managers call showMaximized(), and other managers use maxsize() resizing.

Changes

Matplotlib window maximization

Layer / File(s) Summary
Centralize window maximization and update callers
src/plotting.py
Adds maximize_plt_window(). The fullscreen branch of show() and polyanimation() call the helper. wx, Qt, and other managers use their respective maximization paths.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 87b90

The backend-specific maximization update has no established new failure requiring changes before merge.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 40.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the primary change: proper window maximization for the Matplotlib Qt backend. It does not mention the additional WXAgg support, but the title need not cover every change.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch maximize-qt-window

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

coderabbitai[bot]

This comment was marked as resolved.

Signed-off-by: Stefan Westerfeld <stefan@space.twc.de>
@swesterfeld
swesterfeld merged commit df58986 into trunk Sep 16, 2026
4 checks passed
@swesterfeld
swesterfeld deleted the maximize-qt-window branch September 16, 2026 14:27
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.

1 participant