linux: Implement win.setParentWindow(parent)
This commit is contained in:
parent
4c3c4437da
commit
f4bec78ccb
10 changed files with 55 additions and 7 deletions
|
@ -144,6 +144,17 @@ void Window::WillCloseWindow(bool* prevent_default) {
|
|||
*prevent_default = Emit("close");
|
||||
}
|
||||
|
||||
void Window::WillDestoryNativeObject() {
|
||||
// Close all child windows before closing current window.
|
||||
v8::Locker locker(isolate());
|
||||
v8::HandleScope handle_scope(isolate());
|
||||
for (v8::Local<v8::Value> value : child_windows_.Values(isolate())) {
|
||||
mate::Handle<Window> child;
|
||||
if (mate::ConvertFromV8(isolate(), value, &child))
|
||||
child->window_->CloseImmediately();
|
||||
}
|
||||
}
|
||||
|
||||
void Window::OnWindowClosed() {
|
||||
api_web_contents_->DestroyWebContents();
|
||||
|
||||
|
@ -734,6 +745,7 @@ void Window::SetModal(bool modal, mate::Arguments* args) {
|
|||
parent->Disable();
|
||||
else
|
||||
parent->Enable();
|
||||
window_->SetModal(modal);
|
||||
is_modal_ = modal;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue