Browse Source

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
pull/168/head
Matthias Melcher 19 years ago
parent
commit
924e8a92d1
  1. 2
      CHANGES
  2. 3
      src/Fl_Menu.cxx

2
CHANGES

@ -1,5 +1,7 @@
CHANGES IN FLTK 1.1.8 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 - Fixed Fl_Window::visible() and shown() for OS X
(STR #1341) (STR #1341)
- Fixed Fl_Window::copy_label() losing copy (STR #1332) - Fixed Fl_Window::copy_label() losing copy (STR #1332)

3
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 static int forward(int menu) { // go to next item in menu menu if possible
menustate &pp = *p; 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]); menuwindow &m = *(pp.p[menu]);
int item = (menu == pp.menu_number) ? pp.item_number : m.selected; int item = (menu == pp.menu_number) ? pp.item_number : m.selected;
while (++item < m.numitems) { while (++item < m.numitems) {

Loading…
Cancel
Save