Resize against sizeElement, notViewElement#148
Merged
Conversation
Member
|
Thanks for the report and the suggested fix! I took a different approach to fixing this, because it's important that the reported size matches the viewElement, because in GPU apis we want to know the exact physical size. I fixed it upstream in pygfx/renderview#16, I'll copy the code over to here soon. |
Member
|
Oh crap, merged the wrong PR 😆 Anyway, I'll overwrite the same file soon. |
gselzer
added a commit
to gselzer/scenex
that referenced
this pull request
Apr 8, 2026
It switches to anywidget, which is great, except for a couple of bugs that break usage. See vispy/jupyter_rfb#148 and also kinda vispy/jupyter_rfb#151. Once both of those are resolved (currently only the first is) we should just enforce a new minimum bound >1.0.2. And then we may want to consider renaming the jupyter backend, because anywidget might be better.
gselzer
added a commit
to pyapp-kit/scenex
that referenced
this pull request
Apr 9, 2026
* Avoid jupyter-rfb 1.0.2 It switches to anywidget, which is great, except for a couple of bugs that break usage. See vispy/jupyter_rfb#148 and also kinda vispy/jupyter_rfb#151. Once both of those are resolved (currently only the first is) we should just enforce a new minimum bound >1.0.2. And then we may want to consider renaming the jupyter backend, because anywidget might be better. * Linting fixes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi!
I've been dealing with examples over in pyapp-kit/scenex where, on the newest release of jupyter-rfb, my views cotinuously get smaller. I've tracked it down to a simple example, and the changeset here fixes things.
MCVE reproducing error:
main:uv run jupyter notebook examples/pygfx1.ipynb(with pygfx installed)Without these changes, it prints out
(398.0, 398.0)Through some Claude-assisted digging, it seems like this is because of this line in the CSS - removing this line makes the example print out
(400.0, 400.0).This PR instead changes the target of the
BaseRenderView._resizeObserverto listen to thesizeElementinstead of theviewElement, which takes the border out of play.There are probably other ways to fix this - I don't have a comprehensive understanding of
jupyter_rfb- so please feel free to suggest alternative fixes. I also don't know how to go about testing this fix, so pointers there would be appreciated.