[gtk+] demo: only set transient if demo returns a toplevel
- From: William Jon McCann <mccann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] demo: only set transient if demo returns a toplevel
- Date: Mon, 9 Dec 2013 09:01:39 +0000 (UTC)
commit 7ba0083fc9423619f160a13dc181d5776f55df7d
Author: William Jon McCann <william jon mccann gmail com>
Date: Mon Dec 9 09:55:08 2013 +0100
demo: only set transient if demo returns a toplevel
demos/gtk-demo/main.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/demos/gtk-demo/main.c b/demos/gtk-demo/main.c
index 9de99cd..4e239d5 100644
--- a/demos/gtk-demo/main.c
+++ b/demos/gtk-demo/main.c
@@ -142,8 +142,11 @@ activate_run (GSimpleAction *action,
cbdata->model = model;
cbdata->path = gtk_tree_model_get_path (model, &iter);
- gtk_window_set_transient_for (GTK_WINDOW (demo), GTK_WINDOW (window));
- gtk_window_set_modal (GTK_WINDOW (demo), TRUE);
+ if (gtk_widget_is_toplevel (demo))
+ {
+ gtk_window_set_transient_for (GTK_WINDOW (demo), GTK_WINDOW (window));
+ gtk_window_set_modal (GTK_WINDOW (demo), TRUE);
+ }
g_signal_connect (demo, "destroy",
G_CALLBACK (window_closed_cb), cbdata);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]