Added battery icon
[gregoa/zavai.git] / src / app.vala
index 2b2c8d79e1e426e5ba43e7989f71563f59f05c39..43802f3e92bbef28f7f6abaad0bc3abbeb2339e1 100644 (file)
@@ -38,6 +38,9 @@ public class Zavai : Gtk.Window, zavai.Resource
                destroy += Gtk.main_quit;
                set_events(get_events() | Gdk.EventMask.VISIBILITY_NOTIFY_MASK);
                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)
@@ -58,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);
                }
        }
 
@@ -84,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);