Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
fcbee10d
Unverified
Commit
fcbee10d
authored
Aug 13, 2020
by
stuartmorgan
Committed by
GitHub
Aug 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[windows] Propagate startup errors in template (#63612)
parent
337c5cfc
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
8 deletions
+18
-8
flutter_window.cpp
...ools/templates/app/windows.tmpl/runner/flutter_window.cpp
+9
-2
flutter_window.h
..._tools/templates/app/windows.tmpl/runner/flutter_window.h
+1
-1
win32_window.cpp
..._tools/templates/app/windows.tmpl/runner/win32_window.cpp
+6
-3
win32_window.h
...er_tools/templates/app/windows.tmpl/runner/win32_window.h
+2
-2
No files found.
packages/flutter_tools/templates/app/windows.tmpl/runner/flutter_window.cpp
View file @
fcbee10d
...
@@ -8,15 +8,22 @@ FlutterWindow::FlutterWindow(RunLoop* run_loop,
...
@@ -8,15 +8,22 @@ FlutterWindow::FlutterWindow(RunLoop* run_loop,
FlutterWindow
::~
FlutterWindow
()
{}
FlutterWindow
::~
FlutterWindow
()
{}
void
FlutterWindow
::
OnCreate
()
{
bool
FlutterWindow
::
OnCreate
()
{
Win32Window
::
OnCreate
();
if
(
!
Win32Window
::
OnCreate
())
{
return
false
;
}
// The size here is arbitrary since SetChildContent will resize it.
// The size here is arbitrary since SetChildContent will resize it.
flutter_controller_
=
flutter_controller_
=
std
::
make_unique
<
flutter
::
FlutterViewController
>
(
100
,
100
,
project_
);
std
::
make_unique
<
flutter
::
FlutterViewController
>
(
100
,
100
,
project_
);
// Ensure that basic setup of the controller was successful.
if
(
!
flutter_controller_
->
engine
()
||
!
flutter_controller_
->
view
())
{
return
false
;
}
RegisterPlugins
(
flutter_controller_
.
get
());
RegisterPlugins
(
flutter_controller_
.
get
());
run_loop_
->
RegisterFlutterInstance
(
flutter_controller_
.
get
());
run_loop_
->
RegisterFlutterInstance
(
flutter_controller_
.
get
());
SetChildContent
(
flutter_controller_
->
view
()
->
GetNativeWindow
());
SetChildContent
(
flutter_controller_
->
view
()
->
GetNativeWindow
());
return
true
;
}
}
void
FlutterWindow
::
OnDestroy
()
{
void
FlutterWindow
::
OnDestroy
()
{
...
...
packages/flutter_tools/templates/app/windows.tmpl/runner/flutter_window.h
View file @
fcbee10d
...
@@ -20,7 +20,7 @@ class FlutterWindow : public Win32Window {
...
@@ -20,7 +20,7 @@ class FlutterWindow : public Win32Window {
protected
:
protected
:
// Win32Window:
// Win32Window:
void
OnCreate
()
override
;
bool
OnCreate
()
override
;
void
OnDestroy
()
override
;
void
OnDestroy
()
override
;
private
:
private
:
...
...
packages/flutter_tools/templates/app/windows.tmpl/runner/win32_window.cpp
View file @
fcbee10d
...
@@ -122,9 +122,11 @@ bool Win32Window::CreateAndShow(const std::wstring& title,
...
@@ -122,9 +122,11 @@ bool Win32Window::CreateAndShow(const std::wstring& title,
Scale
(
size
.
width
,
scale_factor
),
Scale
(
size
.
height
,
scale_factor
),
Scale
(
size
.
width
,
scale_factor
),
Scale
(
size
.
height
,
scale_factor
),
nullptr
,
nullptr
,
GetModuleHandle
(
nullptr
),
this
);
nullptr
,
nullptr
,
GetModuleHandle
(
nullptr
),
this
);
OnCreate
();
if
(
!
window
)
{
return
false
;
}
return
window
!=
nullptr
;
return
OnCreate
()
;
}
}
// static
// static
...
@@ -240,8 +242,9 @@ void Win32Window::SetQuitOnClose(bool quit_on_close) {
...
@@ -240,8 +242,9 @@ void Win32Window::SetQuitOnClose(bool quit_on_close) {
quit_on_close_
=
quit_on_close
;
quit_on_close_
=
quit_on_close
;
}
}
void
Win32Window
::
OnCreate
()
{
bool
Win32Window
::
OnCreate
()
{
// No-op; provided for subclasses.
// No-op; provided for subclasses.
return
true
;
}
}
void
Win32Window
::
OnDestroy
()
{
void
Win32Window
::
OnDestroy
()
{
...
...
packages/flutter_tools/templates/app/windows.tmpl/runner/win32_window.h
View file @
fcbee10d
...
@@ -62,8 +62,8 @@ class Win32Window {
...
@@ -62,8 +62,8 @@ class Win32Window {
LPARAM
const
lparam
)
noexcept
;
LPARAM
const
lparam
)
noexcept
;
// Called when CreateAndShow is called, allowing subclass window-related
// Called when CreateAndShow is called, allowing subclass window-related
// setup.
// setup.
Subclasses should return false if setup fails.
virtual
void
OnCreate
();
virtual
bool
OnCreate
();
// Called when Destroy is called.
// Called when Destroy is called.
virtual
void
OnDestroy
();
virtual
void
OnDestroy
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment