aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/Menu.cc
diff options
context:
space:
mode:
authormarkt <markt>2007-07-15 16:32:54 (GMT)
committermarkt <markt>2007-07-15 16:32:54 (GMT)
commit5aecf58d47702e6d12ff1174b03a797b516245b7 (patch)
treef110bca2f57fc838c5e70cb0725276af7548aefd /src/FbTk/Menu.cc
parent857a6d0a6aaafcb453efaa7307194ea1e1387d58 (diff)
downloadfluxbox-5aecf58d47702e6d12ff1174b03a797b516245b7.zip
fluxbox-5aecf58d47702e6d12ff1174b03a797b516245b7.tar.bz2
make sure menus close only when right clicking down and up on the titlebar
Diffstat (limited to 'src/FbTk/Menu.cc')
-rw-r--r--src/FbTk/Menu.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc
index 491ad76..ec0a061 100644
--- a/src/FbTk/Menu.cc
+++ b/src/FbTk/Menu.cc
@@ -600,7 +600,7 @@ void Menu::internal_hide(bool first) {
600 shown = (Menu *) 0; 600 shown = (Menu *) 0;
601 } 601 }
602 602
603 m_torn = m_visible = false; 603 m_torn = m_visible = m_closing = false;
604 m_which_sub = -1; 604 m_which_sub = -1;
605 605
606 if (first && m_parent && m_parent->isVisible() && 606 if (first && m_parent && m_parent->isVisible() &&
@@ -835,12 +835,16 @@ void Menu::handleEvent(XEvent &event) {
835 if (validIndex(m_which_sub) && 835 if (validIndex(m_which_sub) &&
836 menuitems[m_which_sub]->submenu()->isVisible()) 836 menuitems[m_which_sub]->submenu()->isVisible())
837 menuitems[m_which_sub]->submenu()->grabInputFocus(); 837 menuitems[m_which_sub]->submenu()->grabInputFocus();
838 } 838 } else if (event.type == LeaveNotify)
839 m_closing = false;
839} 840}
840 841
841void Menu::buttonPressEvent(XButtonEvent &be) { 842void Menu::buttonPressEvent(XButtonEvent &be) {
842 if (be.window == menu.title) 843 if (be.window == menu.title) {
843 grabInputFocus(); 844 grabInputFocus();
845 m_closing = (be.button == 3);
846 } else
847 m_closing = false;
844 848
845 if (be.window == menu.frame && menu.item_w != 0) { 849 if (be.window == menu.frame && menu.item_w != 0) {
846 850
@@ -879,7 +883,7 @@ void Menu::buttonReleaseEvent(XButtonEvent &re) {
879 } 883 }
880 } 884 }
881 885
882 if (re.button == 3) 886 if (re.button == 3 && m_closing)
883 internal_hide(); 887 internal_hide();
884 888
885 } else if (re.window == menu.frame) { 889 } else if (re.window == menu.frame) {