X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fmenu.c;h=a2902ed82400f6a74ebcffb569a5abc59178e8a9;hb=59c5d1cc4e9d149510c62af16354ebd172452f48;hp=34150391fe8e760fb7eb9b0354cc77d39787c420;hpb=d9f14c1d010860e658f4a9adc6682e0264b410aa;p=chaz%2Fopenbox diff --git a/openbox/menu.c b/openbox/menu.c index 34150391..a2902ed8 100644 --- a/openbox/menu.c +++ b/openbox/menu.c @@ -30,6 +30,7 @@ #include "misc.h" #include "client_menu.h" #include "client_list_menu.h" +#include "client_list_combined_menu.h" #include "parser/parse.h" typedef struct _ObMenuParseState ObMenuParseState; @@ -71,6 +72,7 @@ void menu_startup(gboolean reconfig) (GDestroyNotify)menu_destroy_hash_value); client_list_menu_startup(reconfig); + client_list_combined_menu_startup(reconfig); client_menu_startup(); menu_parse_inst = parse_startup(); @@ -112,6 +114,7 @@ void menu_shutdown(gboolean reconfig) menu_parse_inst = NULL; client_list_menu_shutdown(reconfig); + client_list_combined_menu_shutdown(reconfig); menu_frame_hide_all(); g_hash_table_destroy(menu_hash); @@ -240,7 +243,7 @@ parse_menu_fail: g_free(script); } -ObMenu* menu_new(gchar *name, gchar *title, gpointer data) +ObMenu* menu_new(const gchar *name, const gchar *title, gpointer data) { ObMenu *self; @@ -288,7 +291,6 @@ void menu_show(gchar *name, gint x, gint y, ObClient *client) { ObMenu *self; ObMenuFrame *frame; - guint i; if (!(self = menu_from_name(name)) || keyboard_interactively_grabbed()) return; @@ -304,21 +306,7 @@ void menu_show(gchar *name, gint x, gint y, ObClient *client) menu_frame_hide_all(); frame = menu_frame_new(self, client); - if (client && x < 0 && y < 0) { - x = client->frame->area.x + client->frame->size.left; - y = client->frame->area.y + client->frame->size.top; - menu_frame_move(frame, x, y); - } else - menu_frame_move(frame, - x - ob_rr_theme->bwidth, y - ob_rr_theme->bwidth); - for (i = 0; i < screen_num_monitors; ++i) { - Rect *a = screen_physical_area_monitor(i); - if (RECT_CONTAINS(*a, x, y)) { - frame->monitor = i; - break; - } - } - if (!menu_frame_show(frame, NULL)) + if (!menu_frame_show_topmenu(frame, x, y)) menu_frame_free(frame); else if (frame->entries) { ObMenuEntryFrame *e = frame->entries->data; @@ -402,7 +390,7 @@ void menu_entry_remove(ObMenuEntry *self) menu_entry_free(self); } -ObMenuEntry* menu_add_normal(ObMenu *self, gint id, gchar *label, +ObMenuEntry* menu_add_normal(ObMenu *self, gint id, const gchar *label, GSList *actions) { ObMenuEntry *e; @@ -415,7 +403,7 @@ ObMenuEntry* menu_add_normal(ObMenu *self, gint id, gchar *label, return e; } -ObMenuEntry* menu_add_submenu(ObMenu *self, gint id, gchar *submenu) +ObMenuEntry* menu_add_submenu(ObMenu *self, gint id, const gchar *submenu) { ObMenuEntry *e;