summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES4
-rw-r--r--src/Fl_Menu.cxx8
2 files changed, 10 insertions, 2 deletions
diff --git a/CHANGES b/CHANGES
index 046ac9e86..ed0a33e60 100644
--- a/CHANGES
+++ b/CHANGES
@@ -3,8 +3,8 @@ CHANGES IN FLTK 1.1.7
- Documentation fixes (STR #571, STR #648, STR #692, STR
#730, STR #744, STR #745, STR #931, STR #942, STR #960,
STR #969)
- - Pressing a Fl_Menu_Button widget now draws it pressed
- in (STR #1140)
+ - Various menu widget fixes (STR #1140, STR #1143, STR
+ #1144)
- The threads demo would display negative prime numbers
on MacOS X; this appears to be a MacOS X bug, but we
added a workaround to "fix" this (STR #1138)
diff --git a/src/Fl_Menu.cxx b/src/Fl_Menu.cxx
index 9b61e3098..f4ce0a7af 100644
--- a/src/Fl_Menu.cxx
+++ b/src/Fl_Menu.cxx
@@ -595,6 +595,14 @@ int menuwindow::handle(int e) {
int mx = Fl::event_x_root();
int my = Fl::event_y_root();
int item=0; int mymenu;
+ if (e == FL_PUSH &&
+ (mx < x() || mx >= (x() + w()) ||
+ my < y() || my >= (y() + h()))) {
+ // Clicking outside menu cancels it...
+ setitem(0, -1, 0);
+ pp.state = DONE_STATE;
+ return 1;
+ }
for (mymenu = pp.nummenus-1; ; mymenu--) {
item = pp.p[mymenu]->find_selected(mx, my);
if (item >= 0) break;