Added battery icon
[gregoa/zavai.git] / src / app.vala
index 6aa8e2da5acbb5158679ae565c638f39b85ee5db..43802f3e92bbef28f7f6abaad0bc3abbeb2339e1 100644 (file)
@@ -66,6 +66,17 @@ public class Zavai : Gtk.Window, zavai.Resource
                }
        }
 
+       public void ensure_visible()
+       {
+               if (!visibility)
+               {
+                       visible = true;
+                       present();
+                       set_skip_pager_hint(true);
+                       set_skip_taskbar_hint(true);
+               }
+       }
+
        public void show_applet(string name)
        {
                zavai.Applet applet = zavai.registry.geta(name);
@@ -89,6 +100,10 @@ public class Zavai : Gtk.Window, zavai.Resource
 
        public void push_applet(string name)
        {
+               // Make the function idempotent
+               if (current_name == name)
+                       return;
+
 stderr.printf("push applet %s -> %s\n", current_name, name);
                zavai.Applet applet = zavai.registry.geta(name);