Windows: Return accepted state of XBUTTON mouse events to the OS.

Qt needs to return false in case it does not handle the "extra"
buttons (like WM_XBUTTONDOWN) which causes Windows to send the
corresponding WM_APPCOMMAND message (like APPCOMMAND_BROWSER_FORWARD).

Task-number: QTBUG-48117
Change-Id: Id2c8005ee992b0abd8af2aacbcb97c4eedcfa32f
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
bb10
Friedemann Kleint 2015-09-07 14:56:15 +02:00
parent 1af2b861d8
commit 28f251993a
1 changed files with 4 additions and 1 deletions

View File

@ -368,7 +368,10 @@ bool QWindowsMouseHandler::translateMouseEvent(QWindow *window, HWND hwnd,
QWindowsKeyMapper::queryKeyboardModifiers(),
source);
m_previousCaptureWindow = hasCapture ? window : 0;
return true;
// QTBUG-48117, force synchronous handling for the extra buttons so that WM_APPCOMMAND
// is sent for unhandled WM_XBUTTONDOWN.
return (msg.message != WM_XBUTTONUP && msg.message != WM_XBUTTONDOWN && msg.message != WM_XBUTTONDBLCLK)
|| QWindowSystemInterface::flushWindowSystemEvents();
}
static bool isValidWheelReceiver(QWindow *candidate)