X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fmenu.c;h=a2902ed82400f6a74ebcffb569a5abc59178e8a9;hb=59c5d1cc4e9d149510c62af16354ebd172452f48;hp=868293c68cd9550b4c6594111834067237885b32;hpb=ec304c9e433e4b1cedf924ca64d783f05db7d42d;p=chaz%2Fopenbox diff --git a/openbox/menu.c b/openbox/menu.c index 868293c6..a2902ed8 100644 --- a/openbox/menu.c +++ b/openbox/menu.c @@ -243,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; @@ -291,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; @@ -307,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->mbwidth, y - ob_rr_theme->mbwidth); - 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; @@ -405,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; @@ -418,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;