[gnome-characters: 1/2] Issue #41 Single Instance Mode - - Check if mainwindow is created, if so present it, if not create i



commit 4b81d4e34690b99d6af8dce84b8a11b04000be22
Author: tommy shem <tommyshem485 gmail com>
Date:   Sat Sep 28 16:10:06 2019 +0000

    Issue #41 Single Instance Mode - - Check if mainwindow is created, if so present it, if not create 
instance

 src/main.js | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/main.js b/src/main.js
index 202e7a6..afe002c 100644
--- a/src/main.js
+++ b/src/main.js
@@ -84,8 +84,13 @@ var MyApplication = GObject.registerClass({
         log(_("Characters Application started"));
     }
 
-    vfunc_activate () {
-        (new Window.MainWindow({ application: this })).show();
+    vfunc_activate() {
+        if (!this._appwindow) {
+            this._appwindow = new Window.MainWindow({ application: this });
+        }
+
+        this._appwindow.present();
+        log(_("Characters Application activate"));
     }
 
     vfunc_shutdown() {


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