Application doesn't terminate when click inside a window with no children

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);

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;
1 Like

Exits every time here.

Fedora 32 up to date.

On a laptop though so not using an actual mouse but clicking using the pad and screen.
That shouldn’t make a difference but…

Thanks for the reply.
I’ll try compiling the last version on gitlab.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.