InstallGlobalSwizzling() in src/platform/linux/window_manager_linux.cpp adds show / hide emission hooks on GtkWidget with g_signal_add_emission_hook(), but doesn't keep the hook ids, so they are never removed. The focus-in/focus-out hooks next to them are removed properly.
window_manager had a similar never-removed button-press-event emission hook in its Linux plugin. Users reported crashes when the app exits, or when a secondary Flutter window closes: FlutterEngineRemoveView ... The implicit view cannot be removed, followed by an epoxy/GLX assertion. The hooks here pass no user data, so they probably can't use a freed plugin pointer, but that should be confirmed:
- keep the hook ids and remove them when the manager shuts down
- check that a Flutter app with nativeapi exits cleanly on Linux (X11 and Wayland), including after a secondary window created through
package:nativeapi/windowing.dart is closed
Background:
InstallGlobalSwizzling()insrc/platform/linux/window_manager_linux.cppaddsshow/hideemission hooks onGtkWidgetwithg_signal_add_emission_hook(), but doesn't keep the hook ids, so they are never removed. The focus-in/focus-out hooks next to them are removed properly.window_manager had a similar never-removed
button-press-eventemission hook in its Linux plugin. Users reported crashes when the app exits, or when a secondary Flutter window closes:FlutterEngineRemoveView ... The implicit view cannot be removed, followed by an epoxy/GLX assertion. The hooks here pass no user data, so they probably can't use a freed plugin pointer, but that should be confirmed:package:nativeapi/windowing.dartis closedBackground: