rem: if (entry->cascade>=0 && menu->cascades && entry->flags.enabled) {  submenu = menu->cascades[entry->cascade]; if (submenu && submenu->flags.brother) submenu = submenu->brother;
add: if (entry->cascade>=0 && menu->cascades) { if (!menu->cascades[entry->cascade]->flags.buttoned) { wMenuUnmap(menu->cascades[entry->cascade]); } } }
context: selectEntry(WMenu *menu, int entry_no){    WMenuEntry *entry;    WMenu *submenu;    int old_entry;    if (menu->entries==NULL)	return;        if (entry_no >= menu->entry_no)	return;    old_entry = menu->selected_entry;    menu->selected_entry = entry_no;    if (old_entry!=entry_no) {		/* unselect previous entry */	if (old_entry>=0) {	    paintEntry(menu, old_entry, False);	    entry = menu->entries[old_entry];	    	    /* unmap cascade */	    if (entry->cascade>=0 && menu->cascades) {		if (!menu->cascades[entry->cascade]->flags.buttoned) {		    wMenuUnmap(menu->cascades[entry->cascade]);		}	    }	}	if (entry_no<0) {	    menu->selected_entry = -1;	    return;	}	entry = menu->entries[entry_no];	if (entry->cascade>=0 && menu->cascades && entry->flags.enabled) {	    /* Callback for when the submenu is opened.	     */	    submenu = menu->cascades[entry->cascade];	    if (submenu && submenu->flags.brother)		submenu = submenu->brother;	    if (entry->callback) {		/* Only call the callback if the submenu is not yet mapped.		 */		if (menu->flags.brother) {		    if (!submenu || !submenu->flags.mapped)			(*entry->callback)(menu->brother, entry);		} else {		    if (!submenu || !submenu->flags.buttoned)			(*entry->callback)(menu, entry);		}	    }	    /* the submenu menu might have changed */	    submenu = menu->cascades[entry->cascade];	    	    /* map cascade */	    if (!submenu->flags.mapped) {                int x, y;                if (!submenu->flags.realized)                    wMenuRealize(submenu);                if (wPreferences.wrap_menus) {                    if (menu->flags.open_to_left)                        submenu->flags.open_to_left = 1;                    if (submenu->flags.open_to_left) {                        x = menu->frame_x - MENUW(submenu);                        if (x<0) {                            x = 0;                            submenu->flags.open_to_left = 0;                        }                    } else {                        x = menu->frame_x + MENUW(menu);                        if (x + MENUW(submenu)			    >= menu->frame->screen_ptr->scr_width) {                            x = menu->frame_x - MENUW(submenu);                            submenu->flags.open_to_left = 1;                        }                    }                } else {                    x = menu->frame_x + MENUW(menu);		}                if (wPreferences.align_menus) {                    y = menu->frame_y;                } else {                    y = menu->frame_y + menu->entry_height*entry_no;                    if (menu->flags.titled)                        y += menu->frame->top_width;                    if (menu->cascades[entry->cascade]->flags.titled)                        y -= menu->cascades[entry->cascade]->frame->top_width;                }                wMenuMapAt(menu->cascades[entry->cascade], x, y, False);                menu->cascades[entry->cascade]->parent = menu;            } else {                return;            }        }        paintEntry(menu, entry_no, True);    }}