From c0bfde4aca594edc69a59ee36a7a6bbc9fa47a5d Mon Sep 17 00:00:00 2001 From: markt Date: Fri, 26 Jan 2007 21:57:43 +0000 Subject: fix some crashes with empty menus, and fixed default workspace names --- ChangeLog | 2 ++ src/FbTk/Menu.cc | 13 ++++++------- src/Workspace.cc | 1 + 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 256b72d..278079f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ (Format: Year/Month/Day) Changes for 1.0rc3: *07/01/26: + * Fix default workspace names, and don't show empty menus (Mark) + Workspace.cc FbTk/Menu.cc * Opening a window on a different workspace with Focus New Windows enabled should focus the window when you get to that workspace -- as a free bonus, stacking order should be more stable on fluxbox restart (Mark) diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc index 5ee329b..b5536f7 100644 --- a/src/FbTk/Menu.cc +++ b/src/FbTk/Menu.cc @@ -408,6 +408,9 @@ void Menu::updateMenu(int active_index) { menu.item_w = (ii > menu.item_w ? ii : menu.item_w); } + if (menu.item_w < 1) + menu.item_w = 1; + if (!menuitems.empty()) { menu.sublevels = 1; @@ -436,12 +439,8 @@ void Menu::updateMenu(int active_index) { new_height += theme().titleHeight() + ((menu.frame_h > 0)?menu.title.borderWidth():0); - if (new_width == 0) { - if (menu.item_w > 0) - new_width = menu.item_w; - else - new_width = 1; - } + if (new_width == 0) + new_width = menu.item_w; if (new_height < 1) new_height = 1; @@ -530,7 +529,7 @@ void Menu::updateMenu(int active_index) { void Menu::show() { - if (isVisible()) + if (isVisible() || !menuitems.size()) return; m_visible = true; diff --git a/src/Workspace.cc b/src/Workspace.cc index 236aadb..caeb662 100644 --- a/src/Workspace.cc +++ b/src/Workspace.cc @@ -376,6 +376,7 @@ void Workspace::setName(const string &name) { _FB_XTEXT(Workspace, DefaultNameFormat, "Workspace %d", "Default workspace names, with a %d for the workspace number").c_str(), m_id + 1); //m_id starts at 0 + m_name = tname; } screen().updateWorkspaceNamesAtom(); -- cgit v0.11.2