gtk-demo: Don't create extra windows

When activate() is called via D-Bus, just present the window we
already have.

Fixes: #7213
This commit is contained in:
Matthias Clasen 2024-12-21 10:38:13 -05:00
parent 1fc190596f
commit 6565cb78da

View File

@ -950,6 +950,13 @@ activate (GApplication *app)
GtkFilterListModel *filter_model;
GtkFilter *filter;
GSimpleAction *action;
GList *list;
if ((list = gtk_application_get_windows (GTK_APPLICATION (app))) != NULL)
{
gtk_window_present (GTK_WINDOW (list->data));
return;
}
builder = gtk_builder_new_from_resource ("/ui/main.ui");