mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
views: Support specification of screen bounds for CefWindow creation (fixes issue #2980)
This commit is contained in:
@@ -254,13 +254,15 @@ void CefWindowView::CreateWidget() {
|
||||
views::Widget::InitParams params;
|
||||
params.delegate = this;
|
||||
params.type = views::Widget::InitParams::TYPE_WINDOW;
|
||||
params.bounds = gfx::Rect(CalculatePreferredSize());
|
||||
bool can_activate = true;
|
||||
|
||||
if (cef_delegate()) {
|
||||
CefRefPtr<CefWindow> cef_window = GetCefWindow();
|
||||
is_frameless_ = cef_delegate()->IsFrameless(cef_window);
|
||||
|
||||
auto bounds = cef_delegate()->GetInitialBounds(cef_window);
|
||||
params.bounds = gfx::Rect(bounds.x, bounds.y, bounds.width, bounds.height);
|
||||
|
||||
bool is_menu = false;
|
||||
bool can_activate_menu = true;
|
||||
CefRefPtr<CefWindow> parent_window = cef_delegate()->GetParentWindow(
|
||||
@@ -283,6 +285,11 @@ void CefWindowView::CreateWidget() {
|
||||
}
|
||||
}
|
||||
|
||||
if (params.bounds.IsEmpty()) {
|
||||
// The window will be placed on the default screen with origin (0,0).
|
||||
params.bounds = gfx::Rect(CalculatePreferredSize());
|
||||
}
|
||||
|
||||
#if defined(OS_WIN)
|
||||
if (is_frameless_) {
|
||||
// Don't show the native window caption. Setting this value on Linux will
|
||||
|
Reference in New Issue
Block a user