Closed alex-tee closed 2 years ago
I get the following messages every time I attempt to close a dialog with GTK 4.4.0 or GTK 4.5.0:
(hello-world-gtk:89955): Gsk-CRITICAL **: 22:04:18.222: gsk_radial_gradient_node_new: assertion 'color_stops[i].offset >= color_stops[i - 1].offset' failed (hello-world-gtk:89955): Gsk-CRITICAL **: 22:04:18.222: gsk_render_node_ref: assertion 'GSK_IS_RENDER_NODE (node)' failed (hello-world-gtk:89955): Gsk-CRITICAL **: 22:04:18.222: gsk_render_node_unref: assertion 'GSK_IS_RENDER_NODE (node)' failed
#include <gtk/gtk.h> static GtkWidget * menubutton; static GMenu * menu = NULL; static void print_hello_and_set_menubutton_model (GtkWidget *widget, gpointer data) { GtkWindow * window = GTK_WINDOW (data); g_print ("Hello World\n"); GtkWidget * dialog = gtk_message_dialog_new ( GTK_WINDOW (data), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "%s", "test"); gtk_window_set_title (GTK_WINDOW (dialog), "my dialog"); gtk_window_set_icon_name (GTK_WINDOW (dialog), "edit-copy"); gtk_window_set_transient_for (GTK_WINDOW (dialog), window); gtk_widget_show (GTK_WIDGET (dialog)); g_signal_connect (dialog, "response", G_CALLBACK (gtk_window_destroy), NULL); } static void activate (GtkApplication *app, gpointer user_data) { GtkWidget *window; GtkWidget *button; window = gtk_application_window_new (app); gtk_window_set_title (GTK_WINDOW (window), "Window"); gtk_window_set_default_size (GTK_WINDOW (window), 200, 200); button = gtk_button_new_with_label ("Hello World"); g_signal_connect (button, "clicked", G_CALLBACK (print_hello_and_set_menubutton_model), window); gtk_window_set_child (GTK_WINDOW (window), button); gtk_window_present (GTK_WINDOW (window)); } int main (int argc, char **argv) { GtkApplication *app; int status; app = gtk_application_new ("org.gtk.example", G_APPLICATION_FLAGS_NONE); g_signal_connect (app, "activate", G_CALLBACK (activate), NULL); status = g_application_run (G_APPLICATION (app), argc, argv); g_object_unref (app); return status; }
compile with:
gcc -o hello-world-gtk main3.c `pkg-config --cflags --libs gtk4`
Note: I also reported this to GTK because it could be a GTK issue: https://gitlab.gnome.org/GNOME/gtk/-/issues/4424
fixed upstream
I get the following messages every time I attempt to close a dialog with GTK 4.4.0 or GTK 4.5.0:
Steps to reproduce
compile with:
Note: I also reported this to GTK because it could be a GTK issue: https://gitlab.gnome.org/GNOME/gtk/-/issues/4424