linux: Implement win.setParentWindow(parent)

This commit is contained in:
Cheng Zhao 2016-06-19 15:47:27 +09:00
parent 4c3c4437da
commit f4bec78ccb
10 changed files with 55 additions and 7 deletions

View file

@ -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;
}