]> Dogcows Code - chaz/openbox/commitdiff
Menus put themselves into the stacking list.
authorDana Jansens <danakj@orodu.net>
Sun, 11 May 2003 19:50:30 +0000 (19:50 +0000)
committerDana Jansens <danakj@orodu.net>
Sun, 11 May 2003 19:50:30 +0000 (19:50 +0000)
Clicking on the menu (but not on an entry) will raise it.

openbox/event.c
openbox/menu.c

index 766be8fd9a5c58370fbd13f2e618aa677e06a423..eecda14efb5cc25c3f8385eb0812d436400ee860 100644 (file)
@@ -874,6 +874,11 @@ static void event_handle_menu(Menu *menu, XEvent *e)
        g_message("BUTTON PRESS");
         if (e->xbutton.button == 3)
             menu_hide(menu);
+        else if (e->xbutton.button == 1) {
+            entry = menu_find_entry(menu, e->xbutton.window);
+            if (!entry)
+                stacking_raise(MENU_AS_WINDOW(menu));
+        }
         break;
     case ButtonRelease:
        g_message("BUTTON RELEASED");
@@ -894,6 +899,7 @@ static void event_handle_menu(Menu *menu, XEvent *e)
                 e->xbutton.y < (signed)(h+b)) {
                 menu_entry_fire(entry);
             }
+        }
        
         break;
     case EnterNotify:
@@ -909,7 +915,6 @@ static void event_handle_menu(Menu *menu, XEvent *e)
             menu_entry_render(entry);
         }
         break;
-       }
     }
 }
 
index 7af380db0a85b3f5993c9b3d6d54b9697e74e5b8..611a53bc897d1fddb0aadd0929a96b59122e1d87 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);
@@ -197,6 +199,9 @@ 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);
+
     return self;
 }
 
@@ -355,6 +360,7 @@ void menu_control_show(Menu *self, int x, int y, Client *client) {
            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.025107 seconds and 4 git commands to generate.