Pop up zavai if not visible, when hitting the power button
authorEnrico Zini <enrico@enricozini.org>
Wed, 12 Aug 2009 08:48:56 +0000 (09:48 +0100)
committerEnrico Zini <enrico@enricozini.org>
Wed, 12 Aug 2009 08:48:56 +0000 (09:48 +0100)
src/app.vala
src/app_powerbutton.vala

index 8219534fa283936efa2b43d0f49cf8aaaebd646d..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);
index 0d12a8a25e5880f034cd0c33a4cff5c7423ea12c..aef437d331b005353842cec20626040cf4e898fb 100644 (file)
@@ -191,7 +191,10 @@ private void on_power_button(Posix.timeval* time, bool pressed)
                if (screen_locked)
                        set_screen_lock(false);
                else
+               {
                        zavai.app.push_applet("menu.power");
+                       zavai.app.ensure_visible();
+               }
        }
 }