rem: if (menu->entry_no == 0)
add: if (menu->entry_no <= old_pos)
context: menuIndexForWindow(WMenu *menu, WWindow *wwin, int old_pos){    int idx;    if (menu->entry_no == 0)        return -1;#define WS(i)  ((WWindow*)menu->entries[i]->clientdata)->frame->workspace    if (old_pos >= 0) {        if (WS(old_pos) >= wwin->frame->workspace            && (old_pos == 0 || WS(old_pos-1) <= wwin->frame->workspace)) {            return old_pos;        }    }#undef WS    for (idx = 0; idx < menu->entry_no; idx++) {        WWindow *tw = (WWindow*)menu->entries[idx]->clientdata;        if (!IS_OMNIPRESENT(tw)            && tw->frame->workspace > wwin->frame->workspace) {            break;        }    }    return idx;}