leanflutter / window_manager

This plugin allows Flutter desktop apps to resizing and repositioning the window.
https://pub.dev/packages/window_manager
MIT License
676 stars 177 forks source link

Exiting app throws an error in Win10 #425

Closed hare-siterwell closed 1 month ago

hare-siterwell commented 7 months ago

The error message for exiting the application is as follows:

Lost connection to device.
../../flutter/shell/platform/embedder/embedder.cc (2450): 'FlutterEngineSendPlatformMessage' returned 'kInvalidArguments'. Invalid engine handle.

Exited.

After my testing, the error only occurs when I enable size or titleBarStyle in WindowOptions:

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await windowManager.ensureInitialized();

  WindowOptions windowOptions = const WindowOptions(
    size: Size(800, 600),
    titleBarStyle: TitleBarStyle.hidden,
  );
  windowManager.waitUntilReadyToShow(windowOptions, () async {
    await windowManager.show();
    await windowManager.focus();
  });

  runApp(const MyApp());
}
lijy91 commented 1 month ago

This is not caused by window_manager, see here https://github.com/leanflutter/window_manager/issues/420#issuecomment-2118576979