From 65d6876c1366851119d93f61d1d052767893f75b Mon Sep 17 00:00:00 2001 From: Stanislas Polu Date: Mon, 10 Nov 2014 10:13:03 -0800 Subject: [PATCH 1/3] Frameless animation windows fix --- src/browser/thrust_window_views.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/browser/thrust_window_views.cc b/src/browser/thrust_window_views.cc index 0f47bb9..d580f02 100644 --- a/src/browser/thrust_window_views.cc +++ b/src/browser/thrust_window_views.cc @@ -259,6 +259,16 @@ ThrustWindow::PlatformCreateWindow( set_background(views::Background::CreateStandardPanelBackground()); AddChildView(inspectable_web_contents()->GetView()->GetView()); +#if defined(OS_WIN) + if (!has_frame_) { + /* Set Window style so that we get a minimize and maximize animation */ + /* when frameless. */ + DWORD frame_style = WS_THICKFRAME | WS_MINIMIZEBOX | + WS_MAXIMIZEBOX | WS_CAPTION; + ::SetWindowLong(GetAcceleratedWidget(), GWL_STYLE, frame_style); + } +#endif + window_->UpdateWindowIcon(); window_->CenterWindow(bounds.size()); Layout(); From 795a8c75cbf6d8afc525aa8287ffc581e1edd07b Mon Sep 17 00:00:00 2001 From: Stanislas Polu Date: Mon, 10 Nov 2014 10:15:06 -0800 Subject: [PATCH 2/3] Build Fix --- src/browser/thrust_window_views.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/browser/thrust_window_views.cc b/src/browser/thrust_window_views.cc index d580f02..6a3032c 100644 --- a/src/browser/thrust_window_views.cc +++ b/src/browser/thrust_window_views.cc @@ -265,7 +265,9 @@ ThrustWindow::PlatformCreateWindow( /* when frameless. */ DWORD frame_style = WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_CAPTION; - ::SetWindowLong(GetAcceleratedWidget(), GWL_STYLE, frame_style); + ::SetWindowLong( + GetNativeWindow()->GetHost()->GetAcceleratedWidget(), + GWL_STYLE, frame_style); } #endif From 79b9234550ab83914e34c615db795dc91dac267b Mon Sep 17 00:00:00 2001 From: Stanislas Polu Date: Mon, 10 Nov 2014 11:11:13 -0800 Subject: [PATCH 3/3] Don't install bindings if not top frame [fix #220] --- README.md | 2 +- src/renderer/renderer_client.cc | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f695c68..11011b1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -thrust +Thrust ====== The require-able cross-platform native application framework based on Chromium's diff --git a/src/renderer/renderer_client.cc b/src/renderer/renderer_client.cc index fe0a020..7c57e7b 100644 --- a/src/renderer/renderer_client.cc +++ b/src/renderer/renderer_client.cc @@ -21,6 +21,7 @@ #include "content/public/common/content_switches.h" #include "content/public/renderer/render_thread.h" #include "content/public/renderer/render_view.h" +#include "content/public/renderer/render_frame.h" #include "content/public/test/layouttest_support.h" #include "src/common/switches.h" @@ -135,7 +136,17 @@ ThrustShellRendererClient::DidCreateScriptContext( int extension_group, int world_id) { - LOG(INFO) << "&&&&&&&&&&&&&&&&&&&&&&&&&&& DID CREATE SCRIPT CONTEXT `" << frame->uniqueName().utf8() << "`"; + /* We limit the injection of WebViewBindings to the top level RenderFrames */ + content::RenderFrame* render_frame = + content::RenderFrame::FromWebFrame(frame); + if(render_frame != render_frame->GetRenderView()->GetMainRenderFrame()) { + return; + } + + LOG(INFO) << "ThrustShellRendererClient::DidCreateScriptContext `" + << frame->uniqueName().utf8() << "` " + << extension_group << " " + << world_id; ScriptContext* context = new ScriptContext(v8_context, frame); { scoped_ptr module_system(new ModuleSystem(context,