[gnome-tetravex] Ensure scores dialog unity.



commit 94bf641dbea3fa0a79b352ca4f80ec507c846040
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Mon Sep 16 20:32:26 2019 +0200

    Ensure scores dialog unity.
    
    I was not able to reproduce
    the issue, but that ensures
    two scores dialog cannot be
    displayed at the same time.
    
    Fixes #5.

 src/gnome-tetravex.vala | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/gnome-tetravex.vala b/src/gnome-tetravex.vala
index df2b39f..53e20a2 100644
--- a/src/gnome-tetravex.vala
+++ b/src/gnome-tetravex.vala
@@ -334,14 +334,17 @@ private class Tetravex : Gtk.Application
             new_game ();
     }
 
+    private bool scores_dialog_visible = false; // security for #5
     private int show_scores (HistoryEntry? selected_entry = null, bool show_quit = false)
     {
+        scores_dialog_visible = true;
         ScoreDialog dialog = new ScoreDialog (history, selected_entry, show_quit);
         dialog.modal = true;
         dialog.transient_for = window;
 
         int result = dialog.run ();
         dialog.destroy ();
+        scores_dialog_visible = false;
 
         return result;
     }


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