Changeset 55336 in vbox
- Timestamp:
- Apr 20, 2015 12:06:38 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.cpp
r54076 r55336 561 561 QPoint p = QPoint(pDeltaEvent->xDelta() + m_lastMousePos.x(), 562 562 pDeltaEvent->yDelta() + m_lastMousePos.y()); 563 if (mouseEvent(pDeltaEvent->mouseEventType(), uScreenId,564 m_viewports[uScreenId]->mapFromGlobal(p), p,565 pDeltaEvent->buttons(),566 pDeltaEvent->wheelDelta(), pDeltaEvent->orientation()))563 /* Old Qt versions had a bug where mouse-buttons coming with the event were not quite valid. 564 * For now we will be asking the QApplication for the valid button combination instead. */ 565 if (mouseEvent(pDeltaEvent->mouseEventType(), uScreenId, m_viewports[uScreenId]->mapFromGlobal(p), p, 566 QApplication::mouseButtons(), pDeltaEvent->wheelDelta(), pDeltaEvent->orientation())) 567 567 return true; 568 568 break; … … 639 639 QMouseEvent *pMouseEvent = static_cast<QMouseEvent*>(pEvent); 640 640 m_iLastMouseWheelDelta = 0; 641 if (mouseEvent(pMouseEvent->type(), uScreenId, 642 pMouseEvent->pos(), pMouseEvent->globalPos(), 643 pMouseEvent->buttons(), 0, Qt::Horizontal)) 641 /* Old Qt versions had a bug where mouse-buttons coming with the event were not quite valid. 642 * For now we will be asking the QApplication for the valid button combination instead. */ 643 if (mouseEvent(pMouseEvent->type(), uScreenId, pMouseEvent->pos(), pMouseEvent->globalPos(), 644 QApplication::mouseButtons(), 0, Qt::Horizontal)) 644 645 return true; 645 646 break; … … 667 668 m_iLastMouseWheelDelta = m_iLastMouseWheelDelta % 120; 668 669 } 669 if (mouseEvent(pWheelEvent->type(), uScreenId, 670 pWheelEvent->pos(), pWheelEvent->globalPos(), 671 #ifdef QT_MAC_USE_COCOA 672 /* Qt Cocoa is buggy. It always reports a left button pressed when the 673 * mouse wheel event occurs. A workaround is to ask the application which 674 * buttons are pressed currently: */ 675 QApplication::mouseButtons(), 676 #else /* QT_MAC_USE_COCOA */ 677 pWheelEvent->buttons(), 678 #endif /* !QT_MAC_USE_COCOA */ 679 iDelta, pWheelEvent->orientation())) 670 /* Old Qt versions had a bug where mouse-buttons coming with the event were not quite valid. 671 * For now we will be asking the QApplication for the valid button combination instead. */ 672 if (mouseEvent(pWheelEvent->type(), uScreenId, pWheelEvent->pos(), pWheelEvent->globalPos(), 673 QApplication::mouseButtons(), iDelta, pWheelEvent->orientation())) 680 674 return true; 681 675 break;
Note:
See TracChangeset
for help on using the changeset viewer.