mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
views: Fix multiple issues with hide-frame (fixes issue #3168)
This commit is contained in:
@@ -488,13 +488,7 @@ void ViewsWindow::OnWindowCreated(CefRefPtr<CefWindow> window) {
|
||||
|
||||
delegate_->OnViewsWindowCreated(this);
|
||||
|
||||
CefRect bounds = delegate_->GetWindowBounds();
|
||||
if (bounds.IsEmpty()) {
|
||||
// Use the default size.
|
||||
bounds.width = 800;
|
||||
bounds.height = 600;
|
||||
}
|
||||
|
||||
const CefRect bounds = GetInitialBounds();
|
||||
if (bounds.x == 0 && bounds.y == 0) {
|
||||
// Size the Window and center it.
|
||||
window_->CenterWindow(CefSize(bounds.width, bounds.height));
|
||||
@@ -569,6 +563,18 @@ CefRefPtr<CefWindow> ViewsWindow::GetParentWindow(CefRefPtr<CefWindow> window,
|
||||
return parent_window;
|
||||
}
|
||||
|
||||
CefRect ViewsWindow::GetInitialBounds(CefRefPtr<CefWindow> window) {
|
||||
CEF_REQUIRE_UI_THREAD();
|
||||
if (frameless_) {
|
||||
// Need to provide a size for frameless windows that will be centered.
|
||||
const CefRect bounds = GetInitialBounds();
|
||||
if (bounds.x == 0 && bounds.y == 0) {
|
||||
return bounds;
|
||||
}
|
||||
}
|
||||
return CefRect();
|
||||
}
|
||||
|
||||
bool ViewsWindow::IsFrameless(CefRefPtr<CefWindow> window) {
|
||||
CEF_REQUIRE_UI_THREAD();
|
||||
return frameless_;
|
||||
@@ -1016,4 +1022,15 @@ void ViewsWindow::OnExtensionWindowClosed() {
|
||||
extension_button_pressed_lock_ = nullptr;
|
||||
}
|
||||
|
||||
CefRect ViewsWindow::GetInitialBounds() const {
|
||||
CEF_REQUIRE_UI_THREAD();
|
||||
CefRect bounds = delegate_->GetWindowBounds();
|
||||
if (bounds.IsEmpty()) {
|
||||
// Use the default size.
|
||||
bounds.width = 800;
|
||||
bounds.height = 600;
|
||||
}
|
||||
return bounds;
|
||||
}
|
||||
|
||||
} // namespace client
|
||||
|
Reference in New Issue
Block a user