]> Dogcows Code - chaz/openbox/blobdiff - openbox/menu.c
changes to the client menu, which entries are there, and reorganizing, and renaming.
[chaz/openbox] / openbox / menu.c
index 7197868b79c76230fd335813b57bc20f5b43854a..741e27c12be7a5fc79375d96c8aa64ee5d9f2a25 100644 (file)
@@ -360,7 +360,7 @@ void menu_free(ObMenu *menu)
     g_hash_table_remove(menu_hash, menu->name);
 }
 
-void menu_show(gchar *name, gint x, gint y, ObClient *client)
+void menu_show(gchar *name, gint x, gint y, gint button, ObClient *client)
 {
     ObMenu *self;
     ObMenuFrame *frame;
@@ -379,13 +379,13 @@ void menu_show(gchar *name, gint x, gint y, ObClient *client)
     menu_frame_hide_all();
 
     frame = menu_frame_new(self, client);
-    if (!menu_frame_show_topmenu(frame, x, y))
+    if (!menu_frame_show_topmenu(frame, x, y, button))
         menu_frame_free(frame);
     else if (frame->entries) {
+        /* select the first entry if it's not a submenu */
         ObMenuEntryFrame *e = frame->entries->data;
-        if (e->entry->type == OB_MENU_ENTRY_TYPE_NORMAL &&
-            e->entry->data.normal.enabled)
-                menu_frame_select(frame, e, FALSE);
+        if (e->entry->type == OB_MENU_ENTRY_TYPE_NORMAL)
+            menu_frame_select(frame, e, FALSE);
     }
 }
 
@@ -515,6 +515,11 @@ void menu_set_destroy_func(ObMenu *self, ObMenuDestroyFunc func)
     self->destroy_func = func;
 }
 
+void menu_set_place_func(ObMenu *self, ObMenuPlaceFunc func)
+{
+    self->place_func = func;
+}
+
 ObMenuEntry* menu_find_entry_id(ObMenu *self, gint id)
 {
     ObMenuEntry *ret = NULL;
This page took 0.026042 seconds and 4 git commands to generate.