aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk
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 /src/FbTk
parente35670d4a6a1ace394ff13cae39e41c2171b9054 (diff)
downloadfluxbox_paul-c0bfde4aca594edc69a59ee36a7a6bbc9fa47a5d.zip
fluxbox_paul-c0bfde4aca594edc69a59ee36a7a6bbc9fa47a5d.tar.bz2
fix some crashes with empty menus, and fixed default workspace names
Diffstat (limited to 'src/FbTk')
-rw-r--r--src/FbTk/Menu.cc13
1 files changed, 6 insertions, 7 deletions
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;