fix some crashes with empty menus, and fixed default workspace names

This commit is contained in:
markt 2007-01-26 21:57:43 +00:00
parent e35670d4a6
commit c0bfde4aca
3 changed files with 9 additions and 7 deletions

View file

@ -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)

View file

@ -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;

View file

@ -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();