all repos — fluxbox @ 26dafdafbe6ac67479e7b78e77d6da178953a3ab

custom fork of the fluxbox windowmanager

fix highlighted menu item on mouse out
Mark Tiefenbruck mark@fluxbox.org
commit

26dafdafbe6ac67479e7b78e77d6da178953a3ab

parent

3a8ec6512bee89ac495891665fc40bf1d893a389

2 files changed, 14 insertions(+), 2 deletions(-)

jump to
M src/FbTk/Menu.ccsrc/FbTk/Menu.cc

@@ -832,8 +832,7 @@ // if there's a submenu open, focus it instead

if (validIndex(m_which_sub) && menuitems[m_which_sub]->submenu()->isVisible()) menuitems[m_which_sub]->submenu()->grabInputFocus(); - } else if (event.type == LeaveNotify) - m_closing = false; + } } void Menu::buttonPressEvent(XButtonEvent &be) {

@@ -1091,6 +1090,18 @@ break;

} } +void Menu::leaveNotifyEvent(XCrossingEvent &ce) { + m_closing = false; + // if there's a submenu open, highlight its index and stop hide + if (validIndex(m_which_sub) && m_active_index != m_which_sub && + menuitems[m_which_sub]->submenu()->isVisible()) { + int old = m_active_index; + m_active_index = m_which_sub; + clearItem(m_active_index); + clearItem(old); + menuitems[m_which_sub]->submenu()->stopHide(); + } +} void Menu::reconfigure() { m_shape->setPlaces(theme()->shapePlaces());
M src/FbTk/Menu.hhsrc/FbTk/Menu.hh

@@ -103,6 +103,7 @@ virtual void buttonReleaseEvent(XButtonEvent &br);

void motionNotifyEvent(XMotionEvent &mn); void exposeEvent(XExposeEvent &ee); void keyPressEvent(XKeyEvent &ke); + void leaveNotifyEvent(XCrossingEvent &ce); //@} /// get input focus void grabInputFocus();