]> Dogcows Code - chaz/openbox/blobdiff - openbox/menu.c
Added a menu to read from a pipe.
[chaz/openbox] / openbox / menu.c
index 7af380db0a85b3f5993c9b3d6d54b9697e74e5b8..11d040092bb1b917a4247260309832610c080069 100644 (file)
@@ -38,6 +38,8 @@ void menu_destroy_hash_value(Menu *self)
     g_hash_table_remove(menu_map, &self->frame);
     g_hash_table_remove(menu_map, &self->items);
 
+    stacking_remove(self);
+
     appearance_free(self->a_title);
     XDestroyWindow(ob_display, self->title);
     XDestroyWindow(ob_display, self->frame);
@@ -90,13 +92,11 @@ void menu_startup()
 
     menu_add_entry(m, menu_entry_new_submenu("subz", s));
 
-    /*
     t = (Menu *)plugin_create("timed_menu");
     a = action_from_string("execute");
     a->data.execute.path = g_strdup("xeyes");
     menu_add_entry(t, menu_entry_new("xeyes", a));
     menu_add_entry(m, menu_entry_new_submenu("timed", t));
-    */
     
     s = menu_new("empty", "chub", m);
     menu_add_entry(m, menu_entry_new_submenu("empty", s));
@@ -119,7 +119,7 @@ void menu_startup()
     menu_add_entry(s, menu_entry_new("exit", a));
 
     menu_add_entry(m, menu_entry_new_submenu("long", s));
-
+    
     m = menu_new(NULL, "client", NULL);
     a = action_from_string("iconify");
     menu_add_entry(m, menu_entry_new("iconify", a));
@@ -197,6 +197,10 @@ Menu *menu_new_full(char *label, char *name, Menu *parent,
     g_hash_table_insert(menu_map, &self->title, self);
     g_hash_table_insert(menu_map, &self->items, self);
     g_hash_table_insert(menu_hash, g_strdup(name), self);
+
+    stacking_add(self);
+    stacking_raise(MENU_AS_WINDOW(self));
+
     return self;
 }
 
@@ -306,6 +310,7 @@ void menu_clear(Menu *self) {
        menu_entry_free(entry);
     }
     self->entries = NULL;
+    self->invalid = TRUE;
 }
 
 
@@ -351,10 +356,8 @@ void menu_control_show(Menu *self, int x, int y, Client *client) {
              MIN(y, screen_physical_size.height - self->size.height));
 
     if (!self->shown) {
-        /* XXX gotta add to the stacking list first!
-           stacking_raise(MENU_AS_WINDOW(self));
-        */
        XMapWindow(ob_display, self->frame);
+        stacking_raise(MENU_AS_WINDOW(self));
        self->shown = TRUE;
     } else if (self->shown && self->open_submenu) {
        menu_hide(self->open_submenu);
This page took 0.024756 seconds and 4 git commands to generate.