Fixed crash on mixed use of keyboard and mouse for Fl_Menu_Button (STR #1356)

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5259 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Matthias Melcher 2006-07-17 20:33:45 +00:00
parent f0fcbb3866
commit 924e8a92d1
2 changed files with 5 additions and 0 deletions

View File

@ -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)

View File

@ -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) {