[gnome-games/wip/exalm/search-provider: 5/7] application-window: Don't open games if a game is already opened



commit 5183f12a4793147cfa9fc5448b708704e2fb3570
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Wed Feb 12 14:05:45 2020 +0500

    application-window: Don't open games if a game is already opened
    
    This will be easy to trigger accidentally with the search provider, so only
    allow opening games if we're currently at the collection.

 src/ui/application-window.vala | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/ui/application-window.vala b/src/ui/application-window.vala
index e2d2a985..a3269442 100644
--- a/src/ui/application-window.vala
+++ b/src/ui/application-window.vala
@@ -116,6 +116,9 @@ private class Games.ApplicationWindow : Gtk.ApplicationWindow {
        }
 
        public void run_game (Game game) {
+               if (current_view != collection_view)
+                       return;
+
                current_view = display_view;
                display_view.run_game (game);
 


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