summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarkt <markt>2007-01-26 21:57:43 (GMT)
committermarkt <markt>2007-01-26 21:57:43 (GMT)
commitc0bfde4aca594edc69a59ee36a7a6bbc9fa47a5d (patch)
tree3dc9883cecf95eed5970d0891b601ac54e1074a0
parente35670d4a6a1ace394ff13cae39e41c2171b9054 (diff)
downloadfluxbox_lack-c0bfde4aca594edc69a59ee36a7a6bbc9fa47a5d.zip
fluxbox_lack-c0bfde4aca594edc69a59ee36a7a6bbc9fa47a5d.tar.bz2
fix some crashes with empty menus, and fixed default workspace names
-rw-r--r--ChangeLog2
-rw-r--r--src/FbTk/Menu.cc13
-rw-r--r--src/Workspace.cc1
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 @@
1 (Format: Year/Month/Day) 1 (Format: Year/Month/Day)
2Changes for 1.0rc3: 2Changes for 1.0rc3:
3*07/01/26: 3*07/01/26:
4 * Fix default workspace names, and don't show empty menus (Mark)
5 Workspace.cc FbTk/Menu.cc
4 * Opening a window on a different workspace with Focus New Windows enabled 6 * Opening a window on a different workspace with Focus New Windows enabled
5 should focus the window when you get to that workspace -- as a free bonus, 7 should focus the window when you get to that workspace -- as a free bonus,
6 stacking order should be more stable on fluxbox restart (Mark) 8 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) {
408 menu.item_w = (ii > menu.item_w ? ii : menu.item_w); 408 menu.item_w = (ii > menu.item_w ? ii : menu.item_w);
409 } 409 }
410 410
411 if (menu.item_w < 1)
412 menu.item_w = 1;
413
411 if (!menuitems.empty()) { 414 if (!menuitems.empty()) {
412 menu.sublevels = 1; 415 menu.sublevels = 1;
413 416
@@ -436,12 +439,8 @@ void Menu::updateMenu(int active_index) {
436 new_height += theme().titleHeight() + ((menu.frame_h > 0)?menu.title.borderWidth():0); 439 new_height += theme().titleHeight() + ((menu.frame_h > 0)?menu.title.borderWidth():0);
437 440
438 441
439 if (new_width == 0) { 442 if (new_width == 0)
440 if (menu.item_w > 0) 443 new_width = menu.item_w;
441 new_width = menu.item_w;
442 else
443 new_width = 1;
444 }
445 444
446 if (new_height < 1) 445 if (new_height < 1)
447 new_height = 1; 446 new_height = 1;
@@ -530,7 +529,7 @@ void Menu::updateMenu(int active_index) {
530 529
531void Menu::show() { 530void Menu::show() {
532 531
533 if (isVisible()) 532 if (isVisible() || !menuitems.size())
534 return; 533 return;
535 534
536 m_visible = true; 535 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) {
376 _FB_XTEXT(Workspace, DefaultNameFormat, 376 _FB_XTEXT(Workspace, DefaultNameFormat,
377 "Workspace %d", "Default workspace names, with a %d for the workspace number").c_str(), 377 "Workspace %d", "Default workspace names, with a %d for the workspace number").c_str(),
378 m_id + 1); //m_id starts at 0 378 m_id + 1); //m_id starts at 0
379 m_name = tname;
379 } 380 }
380 381
381 screen().updateWorkspaceNamesAtom(); 382 screen().updateWorkspaceNamesAtom();