diff options
author | fvogel <fvogel@noemail.net> | 2016-03-27 09:58:56 (GMT) |
---|---|---|
committer | fvogel <fvogel@noemail.net> | 2016-03-27 09:58:56 (GMT) |
commit | 65b4db358d112993dad1fd206edbe90a803ff79d (patch) | |
tree | 0e5acf120d43a07e1d5a9718964212d7cc257500 | |
parent | ff5015d897768e2f0fbab44345dfc9f52e5d21d2 (diff) | |
parent | 9e963475f5e4436c92b9d1a1a116f28ecdd5bb34 (diff) | |
download | tk-65b4db358d112993dad1fd206edbe90a803ff79d.zip tk-65b4db358d112993dad1fd206edbe90a803ff79d.tar.gz tk-65b4db358d112993dad1fd206edbe90a803ff79d.tar.bz2 |
Fixed bug [1192095] - Toplevel menus return incorrect active index
FossilOrigin-Name: 6efe4d53965b9a5628c1a6a10c075bf3b4bdcb02
-rw-r--r-- | win/tkWinMenu.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c index 8eede75..8e14669 100644 --- a/win/tkWinMenu.c +++ b/win/tkWinMenu.c @@ -1288,7 +1288,17 @@ TkWinHandleMenuEvent( if (menuPtr != NULL) { long entryIndex = LOWORD(*pwParam); - mePtr = NULL; + if ((menuPtr->menuType == MENUBAR) && menuPtr->tearoff) { + /* + * Windows passes the entry index starting at 0 for + * the first menu entry. However this entry #0 is the + * tearoff entry for Tk (the menu has -tearoff 1), + * which is ignored for MENUBAR menues on Windows. + */ + + entryIndex++; + } + mePtr = NULL; if (flags != 0xFFFF) { if ((flags&MF_POPUP) && (entryIndex<menuPtr->numEntries)) { mePtr = menuPtr->entries[entryIndex]; |