Skip to content

Commit

Permalink
fix: remove delete-event from the engine of flutter
Browse files Browse the repository at this point in the history
related issue comes:  flutter/engine#40033
  • Loading branch information
Kingtous committed May 22, 2023
1 parent cc90b9d commit fde5629
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions linux/window_manager_plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1063,6 +1063,14 @@ void window_manager_plugin_register_with_registrar(
plugin->window_geometry.min_height = -1;
plugin->window_geometry.max_width = G_MAXINT;
plugin->window_geometry.max_height = G_MAXINT;

// Disconnect all delete-event handlers first in flutter 3.10.1, which causes delete_event not working.
// Issues from flutter/engine: https://github.com/flutter/engine/pull/40033
guint handler_id = g_signal_handler_find(get_window(plugin), G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, fl_plugin_registrar_get_view(plugin->registrar));
if (handler_id > 0) {
g_signal_handler_disconnect(get_window(plugin), handler_id);
}

g_signal_connect(get_window(plugin), "delete_event",
G_CALLBACK(on_window_close), plugin);
g_signal_connect(get_window(plugin), "focus-in-event",
Expand Down

0 comments on commit fde5629

Please sign in to comment.