Merge branch 'warn-show-destoyed-window' into 'main'

Show a warning when a destroyed window is shown

See merge request GNOME/gtk!5122
This commit is contained in:
Matthias Clasen 2023-04-09 20:16:52 +00:00
commit d8796b3075

View File

@ -3828,6 +3828,9 @@ gtk_window_show (GtkWidget *widget)
GtkWindow *window = GTK_WINDOW (widget);
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
if (!g_list_store_find (toplevel_list, window, NULL))
g_warning ("A window is shown after it has been destroyed. This will leave the window in an inconsistent state.");
_gtk_widget_set_visible_flag (widget, TRUE);
gtk_css_node_validate (gtk_widget_get_css_node (widget));