Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@clarkezone
Copy link

@clarkezone clarkezone commented Aug 21, 2019

#9835 introduced an alternative Windows shell platform implementation. This PR updates the API with a couple of changes:

  • The OS window is now created by the host app, not the engine
  • The host app asks the engine for a Flutter view and the host can then parent the resulting view into it's window hierarchy as it pleases using win32 parenting APIs
  • Since the host app now has direct control of the host window, removed a bunch of the wrapper methods for setting window properties as these can now be set directly on the window by the host.

In a future world where CoreWindow is supported as a native window type alongside HWNDs there would need to be another flavor of Flutter view.

There is a corresponding PR google/flutter-desktop-embedding#493 to switch the testbed and example projects over. That PR should not be accepted until the win32 implementation is the default for the engine.

There is a small amount of remaining cleanup needed hence this is WIP for now.

Part of flutter/flutter#38600

@stuartmorgan for FYI.

@stuartmorgan-g stuartmorgan-g self-requested a review August 22, 2019 02:58
Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't able to spend a lot of time looking at the two patches together so I'm still missing some high-level understanding of the flow. Comments below from looking at this in isolation for now, and I'll look again this weekend if possible.

@canewsin
Copy link

Since this commit is not merged Instead of Opening an Issue i was asking here that, will it possible to change attributes like title and icon of title bar, displayed or such basic things, with this implementation from attributes form flutter framework code
suppose if we implement a material app in flutter
we use title attribute will this can be parsed to displayed as window title bar on win32 window
and on a flutter we need a fullscreen app we use
SystemChrome.setEnabledUiOverlays([]);
will this possible on win32 implemetation
if not will all SystemChrome class variables are ignored ?

@stuartmorgan-g
Copy link
Contributor

will it possible to change attributes like title and icon of title bar, displayed or such basic things, with this implementation from attributes form flutter framework code

There will no longer be framework methods to set all of those properties with this API, because it's no longer necessary; that was a limitation of GLFW. With this structure, setting those things would be done with normal Win32 APIs.

suppose if we implement a material app in flutter
we use title attribute will this can be parsed to displayed as window title bar on win32 window

That doesn't currently happen, so this PR won't change anything in that regard.

and on a flutter we need a fullscreen app we use
SystemChrome.setEnabledUiOverlays([]);
will this possible on win32 implemetation
if not will all SystemChrome class variables are ignored ?

SystemChrome's current methods are very mobile-centric, and probably don't make sense to implement on desktop as-is, but again that's unrelated to this specific change. Please feel free to file Flutter issues requesting specific desktop-related functionality you want to be available from the Dart side, as what/how those things are exposed in the framework is separate from the implementation in a given embedding, so doesn't need to wait for this to land.

@canewsin
Copy link

I will open issues related to dart side once this pr is merged and tested

@clarkezone
Copy link
Author

clarkezone commented Aug 25, 2019

All feedback bar one item addressed, merged in ToT. There is a failure in the bots that doesn’t look related.

@canewsin
Copy link

Will this Exposes Api to Draw Native Textures in Dart code ?

@stuartmorgan-g
Copy link
Contributor

Will this Exposes Api to Draw Native Textures in Dart code ?

That is flutter/flutter#38601

This PR has a very specific scope. The place for general desktop or Windows feature requests is the Flutter issue tracker, not this PR; please limit comments here to things directly related to this PR.

@stuartmorgan-g
Copy link
Contributor

There is a failure in the bots that doesn’t look related.

It is, actually; adding/renaming/deleting files requires updates to the golden file used by the license script. You need to apply the diff at the end of the failure output to ci/licenses_golden/licenses_flutter as part of this PR.

Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of questions, but mostly just small nits. Looks great!

@clarkezone
Copy link
Author

Ok will do

@clarkezone
Copy link
Author

All feedback addressed, gates are now clean. I've also updated the corresponding PR in FDE to pick up the change to using HWND in the wrapper.

Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@clarkezone clarkezone merged commit 51a376d into flutter:master Sep 3, 2019
@clarkezone clarkezone deleted the updateapiwin32 branch September 3, 2019 00:55
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 3, 2019
engine-flutter-autoroll added a commit to flutter/flutter that referenced this pull request Sep 3, 2019
…mplementation (flutter/engine#11327) (#39710)

git@github.com:flutter/engine.git/compare/3deb8f5e45e1...51a376d

git log 3deb8f5..51a376d --no-merges --oneline
2019-09-03 james@clarkezone.net [Windows] Update API for alternative Windows shell platform implementation (flutter/engine#11327)


If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC garyq@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants