From e76ec92812da70641986fe24278723ea8014fd43 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sat, 2 Jul 2016 16:16:47 +0900 Subject: [PATCH] Set window icon before showing window --- atom/browser/api/atom_api_window.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/atom/browser/api/atom_api_window.cc b/atom/browser/api/atom_api_window.cc index ae6bb77cf9b..ac5fb87c753 100644 --- a/atom/browser/api/atom_api_window.cc +++ b/atom/browser/api/atom_api_window.cc @@ -106,9 +106,6 @@ Window::Window(v8::Isolate* isolate, const mate::Dictionary& options) { options, parent.IsEmpty() ? nullptr : parent->window_.get())); web_contents->SetOwnerWindow(window_.get()); - window_->InitFromOptions(options); - window_->AddObserver(this); - AttachAsUserData(window_.get()); #if defined(TOOLKIT_VIEWS) // Sets the window icon. @@ -116,6 +113,10 @@ Window::Window(v8::Isolate* isolate, const mate::Dictionary& options) { if (options.Get(options::kIcon, &icon)) SetIcon(icon); #endif + + window_->InitFromOptions(options); + window_->AddObserver(this); + AttachAsUserData(window_.get()); } Window::~Window() {