Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overlay browser view not shown when using CefWindow::AddOverlayView #3790

Open
Taronyu opened this issue Sep 18, 2024 · 3 comments
Open

Overlay browser view not shown when using CefWindow::AddOverlayView #3790

Taronyu opened this issue Sep 18, 2024 · 3 comments
Labels
bug Bug report

Comments

@Taronyu
Copy link

Taronyu commented Sep 18, 2024

Describe the bug
We use AddOverlayView with browser views to embed a browser view on top of our main browser. Starting from CEF 125 this was broken due to a crash (issue #3784) which got fixed thankfully. However, now the browser view is not shown anymore. In our application I see that the browser instance is null. According to the documentation the browser is only created once the view is added to the view hierarchy, but as far as I understood this should happen when CefWindow::AddOverlayView is called.

I did not see anything obviously wrong with the calling code. I compared it to other elements of cefclient and cefsimple that are added via AddOverlayView. I suspect that the browser instance is not created, given that CefBrowserView::GetBrowser returns nullptr.

To Reproduce
Steps to reproduce the behavior:

  1. Apply provided patch file to cefclient
  2. Build cefclient
  3. Launch cefclient with --use-views --hide-frame --hide-controls
  4. Only the main website is shown, not the overlay view pointing to https://bitbucket.org/chromiumembedded/cef/

Expected behavior
Browser view is created and shown in parent window on top of its content.

Screenshots
N/A

Versions (please complete the following information):

  • OS: Windows 11
  • CEF Version: master (build tag 129.0.0-master.3051+g6459917+chromium-129.0.6668.0)

Additional context
With the provided patch for cefclient it is possible to reproduce the issue.
cefclient_testcode.patch

@magreenblatt
Copy link
Collaborator

magreenblatt commented Sep 30, 2024

Part of resolving this issue would be adding test coverage for mixing Alloy- and Chrome-style BrowserViews in a single Chrome-style Window. See here for background.

// [...] Alloy style Windows with the
/// Views framework can host only Alloy style BrowserViews but Chrome style
/// Windows can host both style BrowserViews. Additionally, a Chrome style
/// Window can host at most one Chrome style BrowserView but potentially
/// multiple Alloy style BrowserViews.

@magreenblatt
Copy link
Collaborator

magreenblatt commented Oct 4, 2024

@Taronyu With your use case, is the overlay BrowserView always focusable/activatable? For context, a |can_activate| argument was recently added to CefWindow::AddOverlayView (see PR #676).

@Taronyu
Copy link
Author

Taronyu commented Oct 5, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug report
Projects
None yet
Development

No branches or pull requests

2 participants