Skip to content

Commit de6d072

Browse files
authored
fix: remove delete-event from the engine of flutter (#343)
related issue comes: flutter/engine#40033
1 parent 52d35d6 commit de6d072

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

linux/window_manager_plugin.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,6 +1092,14 @@ void window_manager_plugin_register_with_registrar(
10921092
plugin->window_geometry.min_height = -1;
10931093
plugin->window_geometry.max_width = G_MAXINT;
10941094
plugin->window_geometry.max_height = G_MAXINT;
1095+
1096+
// Disconnect all delete-event handlers first in flutter 3.10.1, which causes delete_event not working.
1097+
// Issues from flutter/engine: https://github.com/flutter/engine/pull/40033
1098+
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));
1099+
if (handler_id > 0) {
1100+
g_signal_handler_disconnect(get_window(plugin), handler_id);
1101+
}
1102+
10951103
g_signal_connect(get_window(plugin), "delete_event",
10961104
G_CALLBACK(on_window_close), plugin);
10971105
g_signal_connect(get_window(plugin), "focus-in-event",

0 commit comments

Comments
 (0)