Skip to content

CapturePreview completion handler only fires when webview visible #579

@dd8

Description

@dd8

Description
CapturePreview returns S_OK but never calls the CapturePreviewCompletedHandler if:

a) put_IsVisible( FALSE ) has been called on the controller; or
b) WS_VISIBLE wasn't specified on the parent hWnd passed to CreateCoreWebViewController

This causes problems in headless use cases. Workaround is moving window offscreen but this can cause issues with accessibility tools like screen readers.

Version
SDK: 1.0.622.22
Runtime: Release runtime 86.0.622.51
Framework: Win32
OS: Win10 version 1909

Repro Steps

  1. Run WebView2APISample
  2. Choose Toggle Visibility from View menu to hide web view
  3. Choose Save Screenshot from File menu - the Save As dialog appears but the Preview Captured message box doesn't appear
  4. Wait a couple of minutes then choose Toggle Visibility from View menu to show the web view
  5. The CapturePreviewCompletedHandler now fires and the Preview Captured message box appears

AB#29999309

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority-lowWe have considered this issue and decided that we will not be able to address it in the near future.trackedWe are tracking this work internally.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions