Skip to content

anywidget in vscode: snapshot stays pending when canvas isn't visible #218

Closed

Description

@Vipitis

I am on my laptop at the moment, So my screen is only 1080 pixels tall. When I tried the example notebook I noticed something odd:

canvas_outofview.mp4

if the canvas is not visible, the screenshot remains pending. So if you never let a cell output the canvas, screenshot remains pending. But also if you scroll the screenshot out of the view. I tried to read the code a bit or even debug step it. I saw there was even logic for this exact case.

should_draw = (
self._rfb_draw_requested
and frames_in_flight < self._max_buffered_frames
and (self._has_visible_views or self._rfb_pending_snapshot_display)
)
# Do the draw if we should.

But it seems like we never get there in the first place. _maybe_draw never gets reached, because _shedule_maybe_draw never gets reached but _rc_request_draw seems to only get reached when the canvas is running... so I looked into the self.request_draw() situation and that said it sets a flag that only works in "ondemand" mode.

so I tried that update mode and now the snapshots is response, even without a canvas in view. But not if you never let the canvas display in the first case (while a closed canvas is okay...).

So something in the timeline is not working out. Perhaps it would be okay to but a _shedule_maybe_draw at the end of .snapshot?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions