[recipes] Only show the dialog once
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [recipes] Only show the dialog once
- Date: Sat, 15 Jul 2017 20:08:57 +0000 (UTC)
commit 1d6f5cb825c4a18ad5fdf708c6f64c1e35428bdc
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Jul 15 16:08:29 2017 -0400
Only show the dialog once
Only show it when the main window is first created.
src/gr-app.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/gr-app.c b/src/gr-app.c
index a266cba..830b7eb 100644
--- a/src/gr-app.c
+++ b/src/gr-app.c
@@ -63,13 +63,18 @@ static void
gr_app_activate (GApplication *app)
{
GtkWindow *win;
+ gboolean new_window = FALSE;
win = gtk_application_get_active_window (GTK_APPLICATION (app));
- if (!win)
+ if (!win) {
win = GTK_WINDOW (gr_window_new (GR_APP (app)));
+ new_window = TRUE;
+ }
+
gtk_window_present (win);
- gr_window_show_surprise (GR_WINDOW (win));
+ if (new_window)
+ gr_window_show_surprise (GR_WINDOW (win));
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]