[gnome-games] application: If the app is launched while already running, focus existing window



commit e59152bc3328463ef096eb00674d8bd4f2edbfc6
Author: Yetizone <andreii lisita gmail com>
Date:   Tue Feb 12 18:09:51 2019 +0200

    application: If the app is launched while already running, focus existing window

 src/ui/application.vala | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/src/ui/application.vala b/src/ui/application.vala
index c0b285cb..a448661f 100644
--- a/src/ui/application.vala
+++ b/src/ui/application.vala
@@ -228,6 +228,11 @@ public class Games.Application : Gtk.Application {
                                list_store.append (game);
                });
 
+               if (window != null) {
+                       window.present ();
+                       return;
+               }
+
                window = new ApplicationWindow (list_store);
                this.add_window (window);
                window.destroy.connect (() => {


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