Skip to content

render comparison: resize before show#3415

Merged
j9ac9k merged 2 commits intopyqtgraph:masterfrom
pijyoi:fix-wayland-resize
Nov 15, 2025
Merged

render comparison: resize before show#3415
j9ac9k merged 2 commits intopyqtgraph:masterfrom
pijyoi:fix-wayland-resize

Conversation

@pijyoi
Copy link
Copy Markdown
Contributor

@pijyoi pijyoi commented Nov 15, 2025

This works around an issue when running on Wayland on certain platforms.
When resize occurs after the show, the window did not shrink, leading to image comparison test failures in the test suite.

Wayland platforms where the test failed.

  1. Ubuntu 24.04
  2. Debian Trixie on RPI5

Wayland platforms where the test didn't fail.

  1. WSL2 Ubuntu 24.04

On the platforms where the tests failed, setting QT_QPA_PLATFORM=xcb made it pass.

With this change, there are no longer any users of ui_testing.py::resizeWindow.

More context:
test_ROI.py uses a GraphicsView and was the only user of resizeWindow.
Other tests like test_PlotCurveItem.py, test_NonUniformImage.py, test_ImageItem.py make use of GraphicsLayoutWidget.
The first 2 resize their window before show, but the last one shows before resizing.

this works around an issue when running on wayland on certain platforms.

when resize occurs after the show, the window did not shrink,
leading to image comparison test failures.
there's no point in instantiating a GraphicsLayoutWidget, only to
immediately replace its central widget.
@pijyoi
Copy link
Copy Markdown
Contributor Author

pijyoi commented Nov 15, 2025

test_ImageItem.py and test_NonUniformImage.py create a GraphicsLayoutWidget but immediately replace its central widget (a LayoutWidget) with a ViewBox. For such a use case, it makes more sense to instantiate a GraphicsView instead. (which is what test_ROI.py does.

The same unfortunately can't be done for test_PlotCurveItem.py because it has modified the contents margins of the LayoutWidget. i.e. the reference images were created based on these content margins.
(It could be done, but the reference images would need to be re-generated)

@j9ac9k
Copy link
Copy Markdown
Member

j9ac9k commented Nov 15, 2025

Thanks @pijyoi !

@j9ac9k j9ac9k merged commit 81dc37e into pyqtgraph:master Nov 15, 2025
36 checks passed
@pijyoi pijyoi deleted the fix-wayland-resize branch November 15, 2025 15:44
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