Flutter-desktop-embedding: Support multiple windows

Created on 10 Jul 2018  路  5Comments  路  Source: google/flutter-desktop-embedding

This would require Flutter itself having a concept of multiple widget tree roots, and then embedding API changes that would support controlling the size of each, focusing each one's context, etc.

It's definitely worth exploring whether the Flutter team is open to doing that though, since many desktop use cases require multiple windows (document-based apps, accessory windows like tool palettes or background task monitoring)

Most helpful comment

A feature worth having, yet might be out of scope, is to have window docking. With docking, and proper multiple monitor support (save/restore layouts) it'll make flutter serious desktop contender to Qt, MFC, wxWidgets, etc. Off course, this means support for "splitter" controls too, so at least this might be worth looking into first.

All 5 comments

There are a few different models that have been discussed.

The one that seems to have the most traction currently is for each flutter engine instance to control a window, and for the native layer to associate any number of engine instances with a given process. This avoids any semantic changes to the Flutter framework layer, but it does force clients to use the native layer for any cross-window communication, and to maintain separate Dart-level state for each window.

Another option is to allow each Dart isolate to control a window, although this again forces each window to have separately maintained state given that isolates don't share global state.

The drawback to the solution you describe is that the single Flutter render pipeline would be in charge of rendering graphics for more than one window, which could present performance issues. However, in many cases I could imagine that the workload for secondary windows is no greater than e.g. a docked panel in a main window, so giving clients that flexibility would be nice.

Allowing each window to have its own Flutter engine instance, and hence control their views individually is what i favour. On Mobile i do exactly the same approach with many flutter apps on the same device.
The view state is controlled by a Message Bus that pumps business data changes out to any subscribers.

On Mobile i do exactly the same approach with many flutter apps on the same device

Having multiple apps on one device is fundamentally different than a multi-window desktop application. There's a reason native desktop applications on all three platforms this project supports have windows as a fundamental concept rather than forcing developers to make every window a different application.

A feature worth having, yet might be out of scope, is to have window docking. With docking, and proper multiple monitor support (save/restore layouts) it'll make flutter serious desktop contender to Qt, MFC, wxWidgets, etc. Off course, this means support for "splitter" controls too, so at least this might be worth looking into first.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pmatteo1998 picture pmatteo1998  路  7Comments

stuartmorgan picture stuartmorgan  路  10Comments

ghost picture ghost  路  8Comments

sachinkum0009 picture sachinkum0009  路  10Comments

YazeedAlKhalaf picture YazeedAlKhalaf  路  5Comments