Added battery icon
[gregoa/zavai.git] / src / app.vala
index 53712a0b37ad56fc3c0f61781bdbabe9a0161d63..43802f3e92bbef28f7f6abaad0bc3abbeb2339e1 100644 (file)
@@ -40,7 +40,7 @@ public class Zavai : Gtk.Window, zavai.Resource
                visibility_notify_event += on_visibility;
                set_skip_pager_hint(true);
                set_skip_taskbar_hint(true);
-
+               //set_type_hint(Gdk.WindowTypeHint.DESKTOP);
        }
 
        private bool on_visibility(Gdk.Event event)
@@ -61,6 +61,19 @@ public class Zavai : Gtk.Window, zavai.Resource
                } else {
                        visible = true;
                        present();
+                       set_skip_pager_hint(true);
+                       set_skip_taskbar_hint(true);
+               }
+       }
+
+       public void ensure_visible()
+       {
+               if (!visibility)
+               {
+                       visible = true;
+                       present();
+                       set_skip_pager_hint(true);
+                       set_skip_taskbar_hint(true);
                }
        }
 
@@ -87,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);