summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES2
-rw-r--r--src/Fl_Menu.cxx3
2 files changed, 5 insertions, 0 deletions
diff --git a/CHANGES b/CHANGES
index ec9fd44bd..2552d9eec 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,7 @@
CHANGES IN FLTK 1.1.8
+ - Fixed crash on mixed use of keyboard and mouse for
+ Fl_Menu_Button (STR #1356)
- Fixed Fl_Window::visible() and shown() for OS X
(STR #1341)
- Fixed Fl_Window::copy_label() losing copy (STR #1332)
diff --git a/src/Fl_Menu.cxx b/src/Fl_Menu.cxx
index afb1ade0d..3aee4efcb 100644
--- a/src/Fl_Menu.cxx
+++ b/src/Fl_Menu.cxx
@@ -533,6 +533,9 @@ static void setitem(int m, int n) {
static int forward(int menu) { // go to next item in menu menu if possible
menustate &pp = *p;
+ // Fl_Menu_Button can geberate menu=-1. This line fixes it and selectes the first item.
+ if (menu==-1)
+ menu = 0;
menuwindow &m = *(pp.p[menu]);
int item = (menu == pp.menu_number) ? pp.item_number : m.selected;
while (++item < m.numitems) {