[gtk/matthiasc/for-master: 7/11] widgetfactory: Create the dialog every time
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/for-master: 7/11] widgetfactory: Create the dialog every time
- Date: Sat, 8 Aug 2020 16:02:42 +0000 (UTC)
commit 56afa05b977d794b9a2722b7cfa1e58f35b6444b
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Aug 8 09:36:05 2020 -0400
widgetfactory: Create the dialog every time
Trying to work around gtk_show_about_dialog() is
not worth it, just recreate the dialog from scratch.
Fixes: #3047
demos/widget-factory/widget-factory.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/demos/widget-factory/widget-factory.c b/demos/widget-factory/widget-factory.c
index 4265cf5322..612ba462eb 100644
--- a/demos/widget-factory/widget-factory.c
+++ b/demos/widget-factory/widget-factory.c
@@ -263,6 +263,7 @@ activate_about (GSimpleAction *action,
char *os_name;
char *os_version;
GString *s;
+ GtkWidget *dialog;
s = g_string_new ("");
@@ -289,7 +290,8 @@ activate_about (GSimpleAction *action,
gtk_get_minor_version (),
gtk_get_micro_version ());
- gtk_show_about_dialog (GTK_WINDOW (gtk_application_get_active_window (app)),
+ dialog = g_object_new (GTK_TYPE_ABOUT_DIALOG,
+ "transient-for", gtk_application_get_active_window (app),
"program-name", "GTK Widget Factory",
"version", version,
"copyright", "© 1997—2020 The GTK Team",
@@ -302,9 +304,11 @@ activate_about (GSimpleAction *action,
"system-information", s->str,
NULL);
- gtk_about_dialog_add_credit_section (GTK_ABOUT_DIALOG (g_object_get_data (G_OBJECT
(gtk_application_get_active_window (app)), "gtk-about-dialog")),
+ gtk_about_dialog_add_credit_section (GTK_ABOUT_DIALOG (dialog),
_("Maintained by"), maintainers);
+ gtk_window_present (GTK_WINDOW (dialog));
+
g_string_free (s, TRUE);
g_free (version);
g_free (os_name);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]