mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
views: Fix crash when setSizeConstrains is called early
This commit is contained in:
@@ -390,7 +390,10 @@ gfx::Size NativeWindowViews::GetContentSize() {
|
||||
void NativeWindowViews::SetContentSizeConstraints(
|
||||
const extensions::SizeConstraints& size_constraints) {
|
||||
NativeWindow::SetContentSizeConstraints(size_constraints);
|
||||
window_->OnSizeConstraintsChanged();
|
||||
// widget_delegate() is only available after Init() is called, we make use of
|
||||
// this to determine whether native widget has initialized.
|
||||
if (window_ && window_->widget_delegate())
|
||||
window_->OnSizeConstraintsChanged();
|
||||
#if defined(USE_X11)
|
||||
if (resizable_)
|
||||
old_size_constraints_ = size_constraints;
|
||||
|
||||
Reference in New Issue
Block a user