- for (i = 0; i < screen_num_desktops; ++i) {
- MenuEntry *e;
- Action *a = action_from_string("sendtodesktop");
- a->data.sendto.desk = i;
- a->data.sendto.follow = FALSE;
- e = menu_entry_new(screen_desktop_names[i], a);
- menu_add_entry(self, e);
+ for (i = 0; i < screen_num_monitors; ++i) {
+ a = screen_physical_area_monitor(i);
+ if (RECT_CONTAINS(*a, x, y))
+ break;
+ }
+ g_assert(a != NULL);
+ self->xin_area = i;
+
+ newx = MAX(x, client->area.x);
+ newy = MAX(y, client->area.y);
+ POINT_SET(self->location,
+ MIN(newx, client->area.x + client->area.width - self->size.width),
+ MIN(newy, client->area.y + client->area.height -
+ self->size.height));
+
+ 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);