#include "client.h"
#include "menu.h"
#include "screen.h"
+#include "actions.h"
#include "grab.h"
#include "openbox.h"
#include "mainloop.h"
*dx = MAX(*dx, a->x - x);
*dy = MAX(*dy, a->y - y);
}
+
+ g_free(a);
}
static void menu_entry_frame_render(ObMenuEntryFrame *self)
text_a->texture[0].data.text.string = self->entry->data.normal.label;
if (self->entry->data.normal.shortcut &&
(self->frame->menu->show_all_shortcuts ||
+ self->entry->data.normal.shortcut_always_show ||
self->entry->data.normal.shortcut_position > 0))
{
text_a->texture[0].data.text.shortcut = TRUE;
sub = self->entry->data.submenu.submenu;
text_a->texture[0].data.text.string = sub ? sub->title : "";
if (sub->shortcut && (self->frame->menu->show_all_shortcuts ||
+ sub->shortcut_always_show ||
sub->shortcut_position > 0))
{
text_a->texture[0].data.text.shortcut = TRUE;
}
}
+ g_free(a);
+
menu_frame_render(self);
}
}
gboolean menu_frame_show_topmenu(ObMenuFrame *self, gint x, gint y,
- gint button)
+ gboolean mouse)
{
gint px, py;
guint i;
/* 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;
}
}
if (self->menu->place_func)
- self->menu->place_func(self, &x, &y, button, self->menu->data);
+ self->menu->place_func(self, &x, &y, mouse, self->menu->data);
else
menu_frame_place_topmenu(self, &x, &y);
menu_frame_show_submenu(f, self->frame, self);
}
-void menu_entry_frame_execute(ObMenuEntryFrame *self, guint state, Time time)
+void menu_entry_frame_execute(ObMenuEntryFrame *self, guint state)
{
if (self->entry->type == OB_MENU_ENTRY_TYPE_NORMAL &&
self->entry->data.normal.enabled)
}
if (func)
- func(entry, frame, client, state, data, time);
+ func(entry, frame, client, state, data);
else
- action_run(acts, client, state, time);
+ actions_run_acts(acts, OB_USER_ACTION_MENU_SELECTION,
+ state, -1, -1, 0, OB_FRAME_CONTEXT_NONE, client);
}
}