[gnome-robots] Fix multiple activations



commit 66e0ead571709898de8218d67d4d3866a164fd86
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Fri Jan 3 20:19:14 2020 -0600

    Fix multiple activations
    
    The current code isn't prepared for multiple activations. Much of this
    code is initializing global state and it's certainly not designed to
    ever be called multiple times.

 src/gnome-robots.c | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/src/gnome-robots.c b/src/gnome-robots.c
index 980df25..a269eb5 100644
--- a/src/gnome-robots.c
+++ b/src/gnome-robots.c
@@ -354,6 +354,12 @@ activate (GtkApplication *app, gpointer user_data)
   GtkStyleContext *style_context;
   GamesScoresDirectoryImporter *importer;
 
+  if (window != NULL)
+  {
+    gtk_window_present_with_time (GTK_WINDOW (window), gtk_get_current_event_time ());
+    return;
+  }
+
   headerbar = gtk_header_bar_new ();
   gtk_header_bar_set_title (GTK_HEADER_BAR (headerbar), _("Robots"));
   gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (headerbar), TRUE);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]