Linux, when published as snap: Closing one window terminates application
When an app using desktop_multi_window is published to the Linux snap store, closing one window closes the entire app. When the same app is run in the development environment, this does not happen. Perhaps there's some kind of GTk-level registratino that's off?
Reproduce Steps
You can see the behavior with, for example, https://snapcraft.io/jrpn15/ . If you install the snap on LInux, run it, and do File -> See Calculator Internals, it opens a sub-window. Close that sub window using the native window manager, and the entire app terminates.
I tried closing the window programmatically, using WindowController.close() to close the window, and the same thing happens: Both windows close, and the app terminates.
When I do the same thing with a non-snap version of the same program, just the one window closes.
**Version **
- Flutter Version: 3/3/8
- OS: Linux (tested on Ubuntu)
- plugin: desktop_multi_window
I get this behaviour during development, not only when packaging this as a snap.
- Flutter 3.10.5 • channel stable • https://github.com/flutter/flutter.git
- Framework • revision 796c8ef792 (vor 3 Wochen) • 2023-06-13 15:51:02 -0700
- Engine • revision 45f6e00911
- Tools • Dart 3.0.5 • DevTools 2.23.1
- desktop_multi_window: ^0.2.0
Actually, for me this is happening too when developing with the provided example. I am using:
- Flutter 3.10.6 • channel stable • https://github.com/flutter/flutter.git
- Framework • revision f468f3366c (4 weeks ago) • 2023-07-12 15:19:05 -0700
- Engine • revision cdbeda788a
- Tools • Dart 3.0.6 • DevTools 2.23.1
Seems that handling the delete-event and calling gtk_widget_destroy explicitly on the created window fixes it. Better solutions are welcome. I'll submit a PR soon.