aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2008-02-09 02:36:06 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2008-02-09 02:36:06 (GMT)
commit26dafdafbe6ac67479e7b78e77d6da178953a3ab (patch)
tree569cac549c830858db38f1129e9cd5bf5b0718e0
parent3a8ec6512bee89ac495891665fc40bf1d893a389 (diff)
downloadfluxbox-26dafdafbe6ac67479e7b78e77d6da178953a3ab.zip
fluxbox-26dafdafbe6ac67479e7b78e77d6da178953a3ab.tar.bz2
fix highlighted menu item on mouse out
-rw-r--r--src/FbTk/Menu.cc15
-rw-r--r--src/FbTk/Menu.hh1
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
839void Menu::buttonPressEvent(XButtonEvent &be) { 838void Menu::buttonPressEvent(XButtonEvent &be) {
@@ -1091,6 +1090,18 @@ void Menu::keyPressEvent(XKeyEvent &event) {
1091 } 1090 }
1092} 1091}
1093 1092
1093void 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
1095void Menu::reconfigure() { 1106void 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();