Fix handling of second auxiliary mouse button events in wxMSW

The test for AUX2 mouse button was wrong and checked whether the button
was pressed, instead of checking whether the event was generated by it.

Check the event source correctly by comparing wParam with XBUTTON2 and
not MK_XBUTTON2.

Closes https://github.com/wxWidgets/wxWidgets/pull/753
This commit is contained in:
Trylz 2018-03-06 16:15:31 -05:00 committed by Vadim Zeitlin
parent 0c4c5a2aa9
commit 79170994fc
2 changed files with 2 additions and 1 deletions

View File

@ -78,6 +78,7 @@ wxGTK:
wxMSW:
- Fix hang after clearing wxTAB_TRAVERSAL style on a window with children.
- Fix handling of AUX2 mouse button events (Trylz).
3.1.1: (released 2018-02-19)

View File

@ -5547,7 +5547,7 @@ bool wxWindowMSW::HandleMouseEvent(WXUINT msg, int x, int y, WXUINT flags)
case WM_XBUTTONDOWN:
case WM_XBUTTONUP:
case WM_XBUTTONDBLCLK:
if ( flags & MK_XBUTTON2 )
if (HIWORD(flags) == XBUTTON2)
msg += wxEVT_AUX2_DOWN - wxEVT_AUX1_DOWN;
}