diff options
Diffstat (limited to 'src/FbTk/Menu.cc')
-rw-r--r-- | src/FbTk/Menu.cc | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc index 696d847..ff57bde 100644 --- a/src/FbTk/Menu.cc +++ b/src/FbTk/Menu.cc | |||
@@ -832,8 +832,7 @@ void Menu::handleEvent(XEvent &event) { | |||
832 | if (validIndex(m_which_sub) && | 832 | if (validIndex(m_which_sub) && |
833 | menuitems[m_which_sub]->submenu()->isVisible()) | 833 | menuitems[m_which_sub]->submenu()->isVisible()) |
834 | menuitems[m_which_sub]->submenu()->grabInputFocus(); | 834 | menuitems[m_which_sub]->submenu()->grabInputFocus(); |
835 | } else if (event.type == LeaveNotify) | 835 | } |
836 | m_closing = false; | ||
837 | } | 836 | } |
838 | 837 | ||
839 | void Menu::buttonPressEvent(XButtonEvent &be) { | 838 | void Menu::buttonPressEvent(XButtonEvent &be) { |
@@ -1091,6 +1090,18 @@ void Menu::keyPressEvent(XKeyEvent &event) { | |||
1091 | } | 1090 | } |
1092 | } | 1091 | } |
1093 | 1092 | ||
1093 | void Menu::leaveNotifyEvent(XCrossingEvent &ce) { | ||
1094 | m_closing = false; | ||
1095 | // if there's a submenu open, highlight its index and stop hide | ||
1096 | if (validIndex(m_which_sub) && m_active_index != m_which_sub && | ||
1097 | menuitems[m_which_sub]->submenu()->isVisible()) { | ||
1098 | int old = m_active_index; | ||
1099 | m_active_index = m_which_sub; | ||
1100 | clearItem(m_active_index); | ||
1101 | clearItem(old); | ||
1102 | menuitems[m_which_sub]->submenu()->stopHide(); | ||
1103 | } | ||
1104 | } | ||
1094 | 1105 | ||
1095 | void Menu::reconfigure() { | 1106 | void Menu::reconfigure() { |
1096 | m_shape->setPlaces(theme()->shapePlaces()); | 1107 | m_shape->setPlaces(theme()->shapePlaces()); |