From 4e5e7668504ee511b0a422df08f2338f3f68e0fe Mon Sep 17 00:00:00 2001 From: markt Date: Mon, 2 Jul 2007 03:02:19 +0000 Subject: fix DOS when toolbar.button.borderWidth is large and toolbar.bevelWidth > 0 move transparency menu up with the other submenus --- src/Screen.cc | 47 ++++++++++++++++++++++++----------------------- src/Toolbar.cc | 3 +++ 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/src/Screen.cc b/src/Screen.cc index b0dc62f..293247b 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -1885,29 +1885,6 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) { menu.insert(tabmenu_label, tab_menu); - Configmenus::iterator it = m_configmenu_list.begin(); - Configmenus::iterator it_end = m_configmenu_list.end(); - for (; it != it_end; ++it) - menu.insert(it->first, it->second); - - _BOOLITEM(menu, Configmenu, ImageDithering, - "Image Dithering", "Image Dithering", - *resource.image_dither, save_and_reconfigure); - _BOOLITEM(menu, Configmenu, OpaqueMove, - "Opaque Window Moving", - "Window Moving with whole window visible (as opposed to outline moving)", - *resource.opaque_move, saverc_cmd); - _BOOLITEM(menu, Configmenu, WorkspaceWarping, - "Workspace Warping", - "Workspace Warping - dragging windows to the edge and onto the next workspace", - *resource.workspace_warping, saverc_cmd); - _BOOLITEM(menu, Configmenu, DecorateTransient, - "Decorate Transient Windows", "Decorate Transient Windows", - *resource.decorate_transient, saverc_cmd); - _BOOLITEM(menu, Configmenu, ClickRaises, - "Click Raises", "Click Raises", - *resource.click_raises, saverc_cmd); - #ifdef HAVE_XRENDER if (FbTk::Transparent::haveRender() || FbTk::Transparent::haveComposite()) { @@ -1958,6 +1935,30 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) { menu.insert(alphamenu_label, alpha_menu); } #endif // HAVE_XRENDER + + Configmenus::iterator it = m_configmenu_list.begin(); + Configmenus::iterator it_end = m_configmenu_list.end(); + for (; it != it_end; ++it) + menu.insert(it->first, it->second); + + _BOOLITEM(menu, Configmenu, ImageDithering, + "Image Dithering", "Image Dithering", + *resource.image_dither, save_and_reconfigure); + _BOOLITEM(menu, Configmenu, OpaqueMove, + "Opaque Window Moving", + "Window Moving with whole window visible (as opposed to outline moving)", + *resource.opaque_move, saverc_cmd); + _BOOLITEM(menu, Configmenu, WorkspaceWarping, + "Workspace Warping", + "Workspace Warping - dragging windows to the edge and onto the next workspace", + *resource.workspace_warping, saverc_cmd); + _BOOLITEM(menu, Configmenu, DecorateTransient, + "Decorate Transient Windows", "Decorate Transient Windows", + *resource.decorate_transient, saverc_cmd); + _BOOLITEM(menu, Configmenu, ClickRaises, + "Click Raises", "Click Raises", + *resource.click_raises, saverc_cmd); + #undef _BOOLITEM // finaly update menu diff --git a/src/Toolbar.cc b/src/Toolbar.cc index a1906c0..4a174bd 100644 --- a/src/Toolbar.cc +++ b/src/Toolbar.cc @@ -1034,6 +1034,7 @@ void Toolbar::rearrangeItems() { (*item_it)->hide(); // make sure it still gets told the toolbar height tmpw = 1; tmph = height - 2*(bevel_width+borderW); + if (tmph >= (1<<30)) tmph = 1; FbTk::translateSize(orient, tmpw, tmph); (*item_it)->resize(tmpw, tmph); // width of 0 changes to 1 anyway continue; @@ -1070,6 +1071,8 @@ void Toolbar::rearrangeItems() { tmpw = itemw; tmph = height - size_offset; } + if (tmpw >= (1<<30)) tmpw = 1; + if (tmph >= (1<<30)) tmph = 1; next_x += tmpw + bevel_width; if (bevel_width != 0) next_x += 2*borderW; -- cgit v0.11.2