mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Support JavaScript window.moveTo/By() and resizeTo/By() (fixes #698)
Adds new CefDisplayHandler::OnContentsBoundsChange and CefDisplayHandler::GetRootWindowScreenRect callbacks. cefclient: Implement the above callbacks and call CefBrowserHost::NotifyScreenInfoChanged when the root window bounds change. cefclient: osr: Use real screen bounds by default. Pass `--fake-screen-bounds` for the old default behavior. Load https://tests/window in cefclient for additional implementation details and usage examples.
This commit is contained in:
@ -707,12 +707,24 @@ class CefBrowserHost : public virtual CefBaseRefCounted {
|
||||
virtual void WasHidden(bool hidden) = 0;
|
||||
|
||||
///
|
||||
/// Send a notification to the browser that the screen info has changed. The
|
||||
/// browser will then call CefRenderHandler::GetScreenInfo to update the
|
||||
/// screen information with the new values. This simulates moving the webview
|
||||
/// window from one display to another, or changing the properties of the
|
||||
/// current display. This method is only used when window rendering is
|
||||
/// disabled.
|
||||
/// Notify the browser that screen information has changed. Updated
|
||||
/// information will be sent to the renderer process to configure screen size
|
||||
/// and position values used by CSS and JavaScript (window.deviceScaleFactor,
|
||||
/// window.screenX/Y, window.outerWidth/Height, etc.). For background see
|
||||
/// https://bitbucket.org/chromiumembedded/cef/wiki/GeneralUsage.md#markdown-header-coordinate-systems
|
||||
///
|
||||
/// This method is used with (a) windowless rendering and (b) windowed
|
||||
/// rendering with external (client-provided) root window.
|
||||
///
|
||||
/// With windowless rendering the browser will call
|
||||
/// CefRenderHandler::GetScreenInfo, CefRenderHandler::GetRootScreenRect and
|
||||
/// CefRenderHandler::GetViewRect. This simulates moving or resizing the root
|
||||
/// window in the current display, moving the root window from one display to
|
||||
/// another, or changing the properties of the current display.
|
||||
///
|
||||
/// With windowed rendering the browser will call
|
||||
/// CefDisplayHandler::GetRootWindowScreenRect and use the associated
|
||||
/// display properties.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void NotifyScreenInfoChanged() = 0;
|
||||
|
Reference in New Issue
Block a user