diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/FbTk/Menu.cc | 15 | ||||
-rw-r--r-- | src/FbTk/Menu.hh | 1 |
2 files changed, 14 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()); |
diff --git a/src/FbTk/Menu.hh b/src/FbTk/Menu.hh index 4ebab83..2675502 100644 --- a/src/FbTk/Menu.hh +++ b/src/FbTk/Menu.hh | |||
@@ -103,6 +103,7 @@ public: | |||
103 | void motionNotifyEvent(XMotionEvent &mn); | 103 | void motionNotifyEvent(XMotionEvent &mn); |
104 | void exposeEvent(XExposeEvent &ee); | 104 | void exposeEvent(XExposeEvent &ee); |
105 | void keyPressEvent(XKeyEvent &ke); | 105 | void keyPressEvent(XKeyEvent &ke); |
106 | void leaveNotifyEvent(XCrossingEvent &ce); | ||
106 | //@} | 107 | //@} |
107 | /// get input focus | 108 | /// get input focus |
108 | void grabInputFocus(); | 109 | void grabInputFocus(); |