protected ShutdownButton act_shutdown;
protected RebootButton act_reboot;
protected ServiceRequestLink act_backlight_on;
+ protected bool shown;
public PowerMenu()
{
type = Gtk.WindowType.POPUP;
title = "Power Menu";
+ shown = false;
vbox = new Gtk.VBox(true, 0);
add(vbox);
public void toggle()
{
- // TODO: do more in case it is visible but has no visibility (is covered by others)
- visible = !visible;
- if (visible)
- present();
+ if (!shown)
+ {
+ show_all();
+ shown = true;
+ } else {
+ // TODO: do more in case it is visible but has no visibility (is covered by others)
+ visible = !visible;
+ if (visible)
+ present();
+ }
}
public void hide()