X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fmenuframe.c;h=7bacf02068e48a9a6e45b795136a4509dcf53716;hb=9dacac5e5e6b9ed86e76680b048bc227d8866ac6;hp=813354cdb03b29b385f024c70411315f7f7fafec;hpb=c4eaa943852c770d09034258ba40ccc07516d2f6;p=chaz%2Fopenbox diff --git a/openbox/menuframe.c b/openbox/menuframe.c index 813354cd..7bacf020 100644 --- a/openbox/menuframe.c +++ b/openbox/menuframe.c @@ -21,6 +21,7 @@ #include "client.h" #include "menu.h" #include "screen.h" +#include "actions.h" #include "grab.h" #include "openbox.h" #include "mainloop.h" @@ -343,6 +344,8 @@ void menu_frame_move_on_screen(ObMenuFrame *self, gint x, gint y, *dx = MAX(*dx, a->x - x); *dy = MAX(*dy, a->y - y); } + + g_free(a); } static void menu_entry_frame_render(ObMenuEntryFrame *self) @@ -499,8 +502,8 @@ static void menu_entry_frame_render(ObMenuEntryFrame *self) self->entry->data.normal.icon_width; self->a_icon->texture[0].data.rgba.height = self->entry->data.normal.icon_height; - /* XXX determine this from iconic window */ - self->a_icon->texture[0].data.rgba.width = 0xff; + self->a_icon->texture[0].data.rgba.alpha = + self->entry->data.normal.icon_alpha; self->a_icon->texture[0].data.rgba.data = self->entry->data.normal.icon_data; self->a_icon->surface.parent = item_a; @@ -731,7 +734,7 @@ void menu_frame_render(ObMenuFrame *self) if (e->entry->data.separator.label != NULL) { e->a_text_title->texture[0].data.text.string = e->entry->data.separator.label; - tw = RrMinWidth(e->a_text_title); + tw = RrMinWidth(e->a_text_title) + 2*ob_rr_theme->paddingx; tw = MIN(tw, MAX_MENU_WIDTH); th = ob_rr_theme->menu_title_height + (ob_rr_theme->mbwidth - PADDING) *2; @@ -888,6 +891,8 @@ static void menu_frame_update(ObMenuFrame *self) } } + g_free(a); + menu_frame_render(self); } @@ -949,7 +954,9 @@ gboolean menu_frame_show_topmenu(ObMenuFrame *self, gint x, gint y, /* find the monitor the menu is on */ for (i = 0; i < screen_num_monitors; ++i) { Rect *a = screen_physical_area_monitor(i); - if (RECT_CONTAINS(*a, x, y)) { + gboolean contains = RECT_CONTAINS(*a, x, y); + g_free(a); + if (contains) { self->monitor = i; break; } @@ -1195,7 +1202,9 @@ void menu_entry_frame_execute(ObMenuEntryFrame *self, guint state, Time time) if (func) func(entry, frame, client, state, data, time); else - action_run(acts, client, state, time); + actions_run_acts(acts, OB_USER_ACTION_MENU_SELECTION, + time, state, -1, -1, OB_FRAME_CONTEXT_NONE, + client); } }