Basemenu& operator=(const Basemenu&);
protected:
- BasemenuItem *find(int index);
inline void setTitleVisibility(bool b) { title_vis = b; }
inline void setMovable(bool b) { movable = b; }
inline void setHideTree(bool h) { hide_tree = h; }
inline int getY(void) const { return menu.y; }
inline unsigned int getCount(void) { return menuitems.size(); }
inline int getCurrentSubmenu(void) const { return which_sub; }
+ BasemenuItem *find(int index);
inline unsigned int getWidth(void) const { return menu.width; }
inline unsigned int getHeight(void) const { return menu.height; }
workspacemenu->reconfigure();
iconmenu->reconfigure();
- int remember_sub = rootmenu->getCurrentSubmenu();
+ typedef std::vector<int> SubList;
+ SubList remember_subs;
+
+ // save the current open menus
+ Basemenu *menu = rootmenu;
+ int submenu;
+ while ((submenu = menu->getCurrentSubmenu()) >= 0) {
+ remember_subs.push_back(submenu);
+ menu = menu->find(submenu)->submenu();
+ assert(menu);
+ }
+
InitMenu();
raiseWindows(0, 0);
rootmenu->reconfigure();
- rootmenu->drawSubmenu(remember_sub);
+
+ // reopen the saved menus
+ menu = rootmenu;
+ const SubList::iterator subs_end = remember_subs.end();
+ for (SubList::iterator it = remember_subs.begin(); it != subs_end; ++it) {
+ menu->drawSubmenu(*it);
+ menu = menu->find(*it)->submenu();
+ if (! menu)
+ break;
+ }
configmenu->reconfigure();