all repos — fluxbox @ a26d408964032adec3d4153dc642c5fdf28fb89d

custom fork of the fluxbox windowmanager

fixed menu bug
fluxgen fluxgen
commit

a26d408964032adec3d4153dc642c5fdf28fb89d

parent

5856d7af0d04bf48d4659331b464e171e10343fd

1 files changed, 14 insertions(+), 20 deletions(-)

jump to
M src/Screen.ccsrc/Screen.cc

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.cc,v 1.136 2003/04/26 05:42:35 rathnor Exp $ +// $Id: Screen.cc,v 1.137 2003/04/26 15:00:25 fluxgen Exp $ #include "Screen.hh"

@@ -1731,23 +1731,12 @@ void BScreen::initMenu() {

I18n *i18n = I18n::instance(); if (m_rootmenu.get()) { - /* Rootmenus::iterator it = rootmenuList.begin(); - Rootmenus::iterator it_end = rootmenuList.end(); - for (; it != it_end; ++it) { - if (*it != m_configmenu.get()) { - delete *it; - } - } - rootmenuList.clear(); - */ - while (!rootmenuList.empty()) { - delete rootmenuList.back(); - rootmenuList.pop_back(); - } - + // since all menus in root is submenus in m_rootmenu + // just remove every item in m_rootmenu and then clear rootmenuList while (m_rootmenu->numberOfItems()) m_rootmenu->remove(0); - + rootmenuList.clear(); + } else m_rootmenu.reset(createMenuFromScreen(*this));

@@ -1906,7 +1895,10 @@ "BScreen::parseMenufile: [config] error, "

"no label defined")); cerr<<"Row: "<<row<<endl; } else { - cerr<<"inserts configmenu: "<<m_configmenu.get()<<endl; +#ifdef DEBUG + cerr<<__FILE__<<"("<<__FUNCTION__<< + "): inserts configmenu: "<<m_configmenu.get()<<endl; +#endif // DEBUG menu.insert(str_label.c_str(), m_configmenu.get()); } } // end of config

@@ -2057,6 +2049,8 @@ s_a_reconf_macro->add(saverc_cmd);

s_a_reconf_macro->add(reconf_cmd); FbTk::RefCount<FbTk::Command> save_and_reconfigure(s_a_reconf_macro); // create focus menu + // we don't set this to internal menu so will + // be deleted toghether with the parent FbTk::Menu *focus_menu = createMenuFromScreen(*this); focus_menu->insert(new FocusModelMenuItem(i18n->getMessage(

@@ -2088,16 +2082,16 @@ *resource.auto_raise,

save_and_reconfigure)); focus_menu->update(); - rootmenuList.push_back(focus_menu); - menu.insert(i18n->getMessage( ConfigmenuSet, ConfigmenuFocusModel, "Focus Model"), focus_menu); #ifdef SLIT - if (getSlit() != 0) + if (getSlit() != 0) { + getSlit()->menu().setInternalMenu(); menu.insert("Slit", &getSlit()->menu()); + } #endif // SLIT menu.insert(i18n->getMessage( ToolbarSet, ToolbarToolbarTitle,