aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/Menu.cc
diff options
context:
space:
mode:
authorrathnor <rathnor>2004-09-11 12:33:14 (GMT)
committerrathnor <rathnor>2004-09-11 12:33:14 (GMT)
commit7d793fc6a8d7aa07a7636df2e96054c4a8e2c6a8 (patch)
treead753983b54d61f8a01fb32794d67bf50585789e /src/FbTk/Menu.cc
parentc8f9cf1177b6de1cc210f0706dae302b9aa4f7b5 (diff)
downloadfluxbox-7d793fc6a8d7aa07a7636df2e96054c4a8e2c6a8.zip
fluxbox-7d793fc6a8d7aa07a7636df2e96054c4a8e2c6a8.tar.bz2
fix issues that resulted in unnecessary X errors
Diffstat (limited to 'src/FbTk/Menu.cc')
-rw-r--r--src/FbTk/Menu.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc
index a1fdf8c..c784498 100644
--- a/src/FbTk/Menu.cc
+++ b/src/FbTk/Menu.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Menu.cc,v 1.80 2004/09/09 14:29:10 akir Exp $ 25// $Id: Menu.cc,v 1.81 2004/09/11 12:33:14 rathnor Exp $
26 26
27//use GNU extensions 27//use GNU extensions
28#ifndef _GNU_SOURCE 28#ifndef _GNU_SOURCE
@@ -433,7 +433,7 @@ void Menu::update(int active_index) {
433 } 433 }
434 434
435 int itmp = (theme().itemHeight() * menu.persub); 435 int itmp = (theme().itemHeight() * menu.persub);
436 menu.frame_h = itmp < 0 ? 0 : itmp; 436 menu.frame_h = itmp < 1 ? 1 : itmp;
437 437
438 int new_width = (menu.sublevels * menu.item_w); 438 int new_width = (menu.sublevels * menu.item_w);
439 int new_height = menu.frame_h; 439 int new_height = menu.frame_h;
@@ -442,8 +442,12 @@ void Menu::update(int active_index) {
442 new_height += theme().titleHeight() + ((menu.frame_h > 0)?menu.title.borderWidth():0); 442 new_height += theme().titleHeight() + ((menu.frame_h > 0)?menu.title.borderWidth():0);
443 443
444 444
445 if (new_width < 1) 445 if (new_width < 1) {
446 new_width = menu.item_w; 446 if (menu.item_w > 0)
447 new_width = menu.item_w;
448 else
449 new_width = 1;
450 }
447 451
448 if (new_height < 1) 452 if (new_height < 1)
449 new_height = 1; 453 new_height = 1;
@@ -548,7 +552,7 @@ void Menu::update(int active_index) {
548 } 552 }
549 553
550 menu.frame.moveResize(0, ((title_vis) ? menu.title.y() + menu.title.height() + 554 menu.frame.moveResize(0, ((title_vis) ? menu.title.y() + menu.title.height() +
551 menu.title.borderWidth()*2 : 0), 555 menu.title.borderWidth()*2 : 1),
552 width(), menu.frame_h); 556 width(), menu.frame_h);
553 557
554 558