all repos — fluxbox @ 4da8af73fa5fc2a866dc4461a2c0737976e75eaf

custom fork of the fluxbox windowmanager

fix drawing bug when selecting, plus an unnecessary redraw of the
submenu when entering parent on active submenu item
rathnor rathnor
commit

4da8af73fa5fc2a866dc4461a2c0737976e75eaf

parent

8a85867a6966f69c2fc112456c88c8ef7baaf951

2 files changed, 18 insertions(+), 10 deletions(-)

jump to
M ChangeLogChangeLog

@@ -1,5 +1,8 @@

(Format: Year/Month/Day) Changes for 0.9.6: +*03/09/08: + * Fix when selecting + unneeded submenu redraw on enter+motion (Simon) + Menu.cc *03/09/06: * Added Resize x y as command (Thanks Mathias Gumz) FbCommands.cc/hh, FbCommandFactory.cc
M src/FbTk/Menu.ccsrc/FbTk/Menu.cc

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Menu.cc,v 1.37 2003/08/30 01:03:48 fluxgen Exp $ +// $Id: Menu.cc,v 1.38 2003/09/07 14:57:49 rathnor Exp $ //use GNU extensions #ifndef _GNU_SOURCE

@@ -524,8 +524,8 @@ clearWindow();

if (title_vis && visible) redrawTitle(); - /* - if (m_need_update) { + + if (active_index >= 0) { for (unsigned int i = 0; visible && i < menuitems.size(); i++) { if (i == (unsigned int)which_sub) { drawItem(i, true, true, false);

@@ -536,7 +536,7 @@

if (m_parent && visible) m_parent->drawSubmenu(m_parent->which_sub); } - */ + menu.window.clear(); renderTransFrame();

@@ -1067,9 +1067,10 @@ which_sbl = sbl;

MenuItem *item = menuitems[w]; - if (item->submenu()) - drawSubmenu(w); - else + if (item->submenu()) { + if (!item->submenu()->isVisible()) + drawSubmenu(w); + } else drawItem(w, item->isEnabled(), true, true); } } else {

@@ -1109,6 +1110,9 @@ if (re.x > ix && re.x < (signed) (ix + menu.item_w) &&

re.y > iy && re.y < (signed) (iy + menu.item_h)) { menuitems[w]->click(re.button, re.time); itemSelected(re.button, w); + // redraw whole menu as enableds for any item + // may have changed + update(w); } } else { drawItem(p, isItemEnabled(p) && (p == which_sub), true, true);

@@ -1172,9 +1176,10 @@ which_sbl = sbl;

MenuItem *itmp = menuitems[w]; - if (itmp->submenu()) - drawSubmenu(w); - else + if (itmp->submenu()) { + if (!itmp->submenu()->isVisible()) + drawSubmenu(w); + } else if (itmp->isEnabled()) drawItem(w, true, true, true); }