You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
chrome: Add support for embedded non-Views windows #3294
FrameworkRelated to framework code or APIschromeRelated to the Chrome runtimechrome-styleRelated to Chome runtime + Chrome styleenhancementEnhancement requestnativeRelated to a native (non-Views) framework
Would it be possible to embed CEF windows into Wayland windows with this feature?
This would likely require the Ozone implementation from issue #3263. Basically, the CEF window contents need to become a sub-surface in Wayland because embedding of “windows” on Wayland is generally not supported (based on what I can find, example here).
chrome: win/linux: Add support for browser with native parent (see issue #3294)
This change adds Chrome runtime support on Windows and Linux for creating a
browser parented to a native window supplied by the client application.
Expected API usage and window behavior is similar to what already exists with
the Alloy runtime. The parent window handle should be specified by using
CefWindowInfo::SetAsChild in combination with the CefBrowserHost::CreateBrowser
and CefLifeSpanHandler::OnBeforePopup callbacks.
The previously existing behavior of creating a fully-featured Chrome browser
window when empty CefWindowInfo is used with CreateBrowser remains unchanged
and Views is still the preferred API for creating top-level Chrome windows
with custom styling (e.g. title bar only, frameless, etc).
The cefclient Popup Window test with a native parent window continues to crash
on Linux with both the Alloy and Chrome runtimes (see issue #3165).
Also adds Chrome runtime support for CefDisplayHandler::OnCursorChange.
To test:
Run cefclient --enable-chrome-runtime [--use-views] for the default (and
previously existing) Views-based behavior.
Run cefclient --enable-chrome-runtime --use-native for the new native
parent window behavior.
Run cefclient --enable-chrome-runtime --use-native --no-activate and the
window will not be activated (take input focus) on launch (Windows only).
Run cefclient --enable-chrome-runtime [--use-views|--use-native] --mouse-cursor-change-disabled and the mouse cursor will not change on
mouseover of DOM elements.
cefclient: Add option to create default popups (see issue #3165, see issue #3294)
This change adds a --use-default-popup command-line option to cefclient. When
specified, popup windows will be created with default styling (e.g. without an
application-provided native parent window).
This change also adds some reasonable default window bounds in cases where they
are not specified by the client.
chrome: Change popup default behavior with native parent (see issue #3294)
When using a Views-hosted browser window the client receives Views-related
callbacks for popups and can thereby customize the Views-hosted popup behavior.
When using an external parent window no Views-related callbacks are delivered
and customization options are restricted to providing a new parent handle via
OnBeforePopup. Consequently, we should default to a normal browser window in
the external parent case instead of the very minimial Views-hosted default.
To test (A):
Run cefclient --use-default-popup --enable-chrome-runtime --use-native
Select Tests > Popup Window
Get a normal Chrome browser window
To test (B):
Run cefclient --use-default-popup [--enable-chrome-runtime] [--use-views]
Select Tests > Popup Window
Get a native or Views-hosted browser window with title bar only
I’m not exactly sure how this will work on MacOS. The current CEF API expects CefWindowInfo to be an NSView and, with Chrome, we might need to operate on an NSWindow.
(The following discussion is based on this overview of the Chrome Browser object model.)
One possible approach might be using a “placeholder” NSView to locate the browser in the client’s NSWindow layout. We could then use addChildWindow to position the Chrome NSWindow on top of that “placeholder”.
Once we figure out the above MacOS complications we should consider moving the Alloy implementation to Views as well. We can then share the Chrome Views implementations for context menus, dialogs, etc.
Original comment by Laurenz Bihlmayer (Bitbucket: Laurenz Bihlmayer).
Good to see that Wayland support is being worked on, at least slowly :)
Just a quick question from a CEF noob:
If this was resolved, would this allow applications like Spotify or Steam to finally support Wayland natively (if they update their CEF version)?
Or do they already use Views and don’t have their own top-level window?
And what’s the relationship of this issue and #2804? They seem to deal with pretty similiar topics.
FrameworkRelated to framework code or APIschromeRelated to the Chrome runtimechrome-styleRelated to Chome runtime + Chrome styleenhancementEnhancement requestnativeRelated to a native (non-Views) framework
Activity
magreenblatt commentedon Mar 21, 2022
Original comment by Dominik Mayrhofer-Poldlehner (Bitbucket: dmayrhofer, GitHub: dmayrhofer).
Would it be possible to embed CEF windows into Wayland windows with this feature?
magreenblatt commentedon Mar 21, 2022
This would likely require the Ozone implementation from issue #3263. Basically, the CEF window contents need to become a sub-surface in Wayland because embedding of “windows” on Wayland is generally not supported (based on what I can find, example here).
magreenblatt commentedon Mar 23, 2022
Issue #3289 was marked as a duplicate of this issue.
magreenblatt commentedon Mar 26, 2022
See issue #2804 for embedded Wayland support specifically.
magreenblatt commentedon Apr 12, 2022
Fix dismissal of select popups on NotifyMoveOrResizeStarted (see issue #3294)
This impacts both Alloy and Chrome runtimes when using a native parent window.
→ <<cset 5f4bccd672c1 (bb)>>
magreenblatt commentedon Apr 12, 2022
chrome: win/linux: Add support for browser with native parent (see issue #3294)
This change adds Chrome runtime support on Windows and Linux for creating a
browser parented to a native window supplied by the client application.
Expected API usage and window behavior is similar to what already exists with
the Alloy runtime. The parent window handle should be specified by using
CefWindowInfo::SetAsChild in combination with the CefBrowserHost::CreateBrowser
and CefLifeSpanHandler::OnBeforePopup callbacks.
The previously existing behavior of creating a fully-featured Chrome browser
window when empty CefWindowInfo is used with CreateBrowser remains unchanged
and Views is still the preferred API for creating top-level Chrome windows
with custom styling (e.g. title bar only, frameless, etc).
The cefclient Popup Window test with a native parent window continues to crash
on Linux with both the Alloy and Chrome runtimes (see issue #3165).
Also adds Chrome runtime support for CefDisplayHandler::OnCursorChange.
To test:
cefclient --enable-chrome-runtime [--use-views]for the default (andpreviously existing) Views-based behavior.
cefclient --enable-chrome-runtime --use-nativefor the new nativeparent window behavior.
cefclient --enable-chrome-runtime --use-native --no-activateand thewindow will not be activated (take input focus) on launch (Windows only).
cefclient --enable-chrome-runtime [--use-views|--use-native] --mouse-cursor-change-disabledand the mouse cursor will not change onmouseover of DOM elements.
→ <<cset 3000bc8748d8 (bb)>>
magreenblatt commentedon Apr 12, 2022
cefclient: Add option to create default popups (see issue #3165, see issue #3294)
This change adds a
--use-default-popupcommand-line option to cefclient. Whenspecified, popup windows will be created with default styling (e.g. without an
application-provided native parent window).
This change also adds some reasonable default window bounds in cases where they
are not specified by the client.
→ <<cset 75ca552a4e88 (bb)>>
magreenblatt commentedon Apr 12, 2022
chrome: Change popup default behavior with native parent (see issue #3294)
When using a Views-hosted browser window the client receives Views-related
callbacks for popups and can thereby customize the Views-hosted popup behavior.
When using an external parent window no Views-related callbacks are delivered
and customization options are restricted to providing a new parent handle via
OnBeforePopup. Consequently, we should default to a normal browser window in
the external parent case instead of the very minimial Views-hosted default.
To test (A):
cefclient --use-default-popup --enable-chrome-runtime --use-nativeTo test (B):
cefclient --use-default-popup [--enable-chrome-runtime] [--use-views]→ <<cset a0a7a35fe2d1 (bb)>>
magreenblatt commentedon Apr 12, 2022
Fix dismissal of select popups on NotifyMoveOrResizeStarted (see issue #3294)
This impacts both Alloy and Chrome runtimes when using a native parent window.
→ <<cset c3a6788f6ea1 (bb)>>
magreenblatt commentedon Apr 12, 2022
Fix dismissal of select popups on NotifyMoveOrResizeStarted (see issue #3294)
This impacts both Alloy and Chrome runtimes when using a native parent window.
→ <<cset 579536b10703 (bb)>>
magreenblatt commentedon Apr 18, 2022
Popups are not placed correctly when running
--enable-chrome-runtime --use-native --multi-threaded-message-loop.http://tests/dialogs
magreenblatt commentedon Apr 19, 2022
I’m not exactly sure how this will work on MacOS. The current CEF API expects CefWindowInfo to be an NSView and, with Chrome, we might need to operate on an NSWindow.
(The following discussion is based on this overview of the Chrome Browser object model.)
Chrome’s NativeWidgetMac uses NativeWidgetMacNSWindowHost to communicate with an NSWindow that may be hosted in a separate process (see https://crbug.com/893719). We can currently get a gfx::NativeWindow (wrapper of NSWindow*) representation via
browser->browser_window()->GetNativeWindow(). However, we can’t necessarily extract an NSView from that for parenting to a client-provided NSWindow (retrieving the Chrome NSWindow’s contentView works, but reparenting that to a different NSWindow might cause undefined behavior).One possible approach might be using a “placeholder” NSView to locate the browser in the client’s NSWindow layout. We could then use addChildWindow to position the Chrome NSWindow on top of that “placeholder”.
magreenblatt commentedon Apr 19, 2022
chrome: Implement GetWindowHandle() for --multi-threaded-message-loop (see issue #3294)
→ <<cset c04895b22263 (bb)>>
magreenblatt commentedon Jun 3, 2022
Once we figure out the above MacOS complications we should consider moving the Alloy implementation to Views as well. We can then share the Chrome Views implementations for context menus, dialogs, etc.
magreenblatt commentedon Dec 20, 2022
Original comment by Laurenz Bihlmayer (Bitbucket: Laurenz Bihlmayer).
Good to see that Wayland support is being worked on, at least slowly :)
Just a quick question from a CEF noob:
If this was resolved, would this allow applications like Spotify or Steam to finally support Wayland natively (if they update their CEF version)?
Or do they already use Views and don’t have their own top-level window?
And what’s the relationship of this issue and #2804? They seem to deal with pretty similiar topics.
10 remaining items
Fix dismissal of select popups on NotifyMoveOrResizeStarted (see issue …
chrome: win/linux: Add support for browser with native parent (see is…
cefclient: Add option to create default popups (see issue chromiumemb…
chrome: Change popup default behavior with native parent (see issue c…
chrome: Implement GetWindowHandle() for --multi-threaded-message-loop…
magreenblatt commentedon Nov 15, 2023
Support for DevTools popups with native parent was added in #3600.
Fix dismissal of select popups on NotifyMoveOrResizeStarted (see issue …
Fix dismissal of select popups on NotifyMoveOrResizeStarted (see issue …
magreenblatt commentedon May 9, 2024
This is fully supported (all platforms) with Alloy style. See #3681.
chrome: Fix dangling pointers during child window teardown (fixes #4147)
chrome: Fix dangling pointers during child window teardown (fixes #4147)