+void client_menu_show(Menu *self, int x, int y, Client *client)
+{
+ int newy;
+ g_assert(!self->invalid);
+ g_assert(client);
+
+ newy = MAX(client->frame->area.y + client->frame->size.top, y);
+ newy -= ob_rr_theme->bwidth;
+
+ POINT_SET(self->location,
+ MIN(x, screen_physical_size.width - self->size.width -
+ ob_rr_theme->bwidth * 2),
+ MIN(newy, screen_physical_size.height - self->size.height -
+ ob_rr_theme->bwidth * 2));
+ XMoveWindow(ob_display, self->frame, self->location.x, self->location.y);
+
+ if (!self->shown) {
+ XMapWindow(ob_display, self->frame);
+ stacking_raise(MENU_AS_WINDOW(self));
+ self->shown = TRUE;
+ } else if (self->shown && self->open_submenu) {
+ menu_hide(self->open_submenu);
+ }
+}
+