Hi all!
I’m Gianni and this is my first post on gnome discourse.
I’m trying to learn gtk4 and make some basic tutorials.
When I compile and run the example below, if you try to close the window there are no problems (the app close and you return to the prompt), but if you click with the mouse inside the window and then you try to close it the window will close but the app is still running… You have to press CTRL+C to terminate the application.
The window has no children. Is this a bug?
I using Fedora 32, gcc, and gtk4 (3.98).
#include <gtk/gtk.h>
static void
activate (GtkApplication *app,
gpointer user_data)
{
GtkWidget *window;
window = gtk_application_window_new (app);
gtk_window_set_title (GTK_WINDOW (window), "Tutorial_01");
gtk_widget_set_size_request (window, 200, 200);
gtk_widget_show (window);
}
int
main (int argc, char **argv)
{
GtkApplication *app;
int status;
app = gtk_application_new ("org.gtk.tutorial_01", 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;
}